SaxonC 12.7.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(const XdmArray &d);
41
45 virtual ~XdmArray() {}
46
51 XdmArray(int64_t obj);
52
58 XdmArray(int64_t obj, int len);
59
66 int arrayLength();
67
78 XdmValue *get(int n);
79
92 XdmArray *put(int n, XdmValue *value);
93
102 XdmArray *addMember(XdmValue *value);
103
112 XdmArray *concat(XdmArray *value);
113
118 std::list<XdmValue *> asList();
119
124 XdmValue **values();
125
132 int getArity() { return 1; }
133
142 const char *getStringValue(const char *encoding = nullptr);
143
149 bool isFunction() { return true; }
150
155 XDM_TYPE getType() { return XDM_ARRAY; }
156
162 bool isArray() { return true; }
163
170 const char *toString(const char *encoding = nullptr);
171
172private:
173 int arrayLen;
174};
175
176#endif
An array in the XDM data model.
Definition XdmArray.h:27
virtual ~XdmArray()
Destructor method for XdmArray.
Definition XdmArray.h:45
bool isFunction()
Determine whether the item is an XDM function or some other type of item.
Definition XdmArray.h:149
bool isArray()
Determine whether the item is an XDM array or some other type of item.
Definition XdmArray.h:162
XDM_TYPE getType()
Get the type of this XDM value.
Definition XdmArray.h:155
int getArity()
Get the arity of the function.
Definition XdmArray.h:132
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:120
const char * toString(const char *encoding=nullptr)
Create a string representation of the item.
Definition XdmItem.cpp:71
An XdmValue represents a value in the XDM data model.
Definition XdmValue.h:43
XdmItem ** values
Definition XdmValue.h:218