SaxonC 12.9.0
Saxon Processor library for C/C++, PHP and Python
Loading...
Searching...
No Matches
XdmArray.h
1
2// Copyright (c) 2022 - 2023 Saxonica Limited.
3// This Source Code Form is subject to the terms of the Mozilla Public License,
4// v. 2.0. If a copy of the MPL was not distributed with this file, You can
5// obtain one at http://mozilla.org/MPL/2.0/. This Source Code Form is
6// "Incompatible With Secondary Licenses", as defined by the Mozilla Public
7// License, v. 2.0.
9
10#ifndef SAXON_XDM_ARRAY_h
11#define SAXON_XDM_ARRAY_h
12
13#include "saxonc_export.h"
14#include "saxonc/XdmFunctionItem.h"
15#include <string>
16
17#include <set>
18#include <stdlib.h>
19#include <string.h>
20
27class SAXONC_EXPORT XdmArray : public XdmFunctionItem {
28
29public:
34 XdmArray();
35
40 //XdmArray(bool);
41
46 XdmArray(const XdmArray &d);
47
51 virtual ~XdmArray() {}
52
57 XdmArray(int64_t obj);
58
64 XdmArray(int64_t obj, int len);
65
72 int arrayLength();
73
84 XdmValue *get(int n);
85
98 XdmArray *put(int n, XdmValue *value);
99
108 XdmArray *addMember(XdmValue *value);
109
118 XdmArray *concat(XdmArray *value);
119
124 std::list<XdmValue *> asList();
125
130 XdmValue **values();
131
138 int getArity() { return 1; }
139
148 const char *getStringValue(const char *encoding = nullptr);
149
155 bool isFunction() { return true; }
156
161 XDM_TYPE getType() { return XDM_ARRAY; }
162
168 bool isArray() { return true; }
169
176 const char *toString(const char *encoding = nullptr);
177
178
179private:
180 int arrayLen;
181};
182
183#endif
An array in the XDM data model.
Definition XdmArray.h:27
virtual ~XdmArray()
Destructor method for XdmArray.
Definition XdmArray.h:51
bool isFunction()
Determine whether the item is an XDM function or some other type of item.
Definition XdmArray.h:155
bool isArray()
Determine whether the item is an XDM array or some other type of item.
Definition XdmArray.h:168
XDM_TYPE getType()
Get the type of this XDM value.
Definition XdmArray.h:161
int getArity()
Get the arity of the function.
Definition XdmArray.h:138
The class XdmFunctionItem represents a function item.
Definition XdmFunctionItem.h:26
const char * getStringValue(const char *encoding=nullptr)
Get the string value of the XdmFunctionItem.
Definition XdmFunctionItem.cpp:70
const char * toString(const char *encoding=nullptr)
Create a string representation of the item.
Definition XdmItem.cpp:74
An XdmValue represents a value in the XDM data model.
Definition XdmValue.h:33
XdmItem ** values
Definition XdmValue.h:208