SaxonC 12.7.0
Saxon Processor library for C/C++, PHP and Python
Loading...
Searching...
No Matches
XdmMap.h
1
2// Copyright (c) 2022 - 2025 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_MAP_h
11#define SAXON_XDM_MAP_h
12
13#include "saxonc_export.h"
14#include "saxonc/XdmArray.h"
15#include "saxonc/XdmFunctionItem.h"
16#include <string>
17
18#include <map>
19#include <set>
20#include <stdlib.h>
21#include <string.h>
22
30class SAXONC_EXPORT XdmMap : public XdmFunctionItem {
31
32public:
37 XdmMap();
38
43 XdmMap(const XdmMap &d);
44
48 virtual ~XdmMap() {}
49
54 XdmMap(int64_t obj);
55
61 XdmMap(std::map<XdmAtomicValue *, XdmValue *> map);
62
69 int mapSize();
70
79 XdmValue *get(XdmAtomicValue *key);
80
94 XdmValue *get(const char *key);
95
109 XdmValue *get(int key);
110
123 XdmValue *get(double key);
124
137 XdmValue *get(long key);
138
148 XdmMap *put(XdmAtomicValue *key, XdmValue *value);
149
159 XdmMap *remove(XdmAtomicValue *key);
160
166 std::set<XdmAtomicValue *> keySet();
167
173 XdmAtomicValue **keys();
174
175 // std::map<XdmAtomicValue*, XdmValue*> asMap();
176
181 bool isEmpty();
182
193 bool containsKey(XdmAtomicValue *key);
194
202 std::list<XdmValue *> valuesAsList();
203
211 XdmValue **values();
212
217 bool isFunction() { return true; }
218
223 bool isMap() { return true; }
224
229 XDM_TYPE getType() { return XDM_MAP; }
230
238 const char *toString(const char *encoding = nullptr);
239
240};
241
242#endif
The class XdmAtomicValue represents an item in an XPath sequence that is an atomic value.
Definition XdmAtomicValue.h:27
The class XdmFunctionItem represents a function item.
Definition XdmFunctionItem.h:26
const char * toString(const char *encoding=nullptr)
Create a string representation of the item.
Definition XdmItem.cpp:71
A map in the XDM data model.
Definition XdmMap.h:30
virtual ~XdmMap()
Destructor method for XdmMap.
Definition XdmMap.h:48
bool isFunction()
Determine whether the item is a function or some other type of item.
Definition XdmMap.h:217
bool isMap()
Determine whether the item is an XDM map or some other type of item.
Definition XdmMap.h:223
XDM_TYPE getType()
Get the type of this XDM value.
Definition XdmMap.h:229
XdmMap(std::map< XdmAtomicValue *, XdmValue * > map)
Create an XdmMap supplying the entries in the form of a std::map.
An XdmValue represents a value in the XDM data model.
Definition XdmValue.h:43
XdmItem ** values
Definition XdmValue.h:218