SaxonC 12.7.0
Saxon Processor library for C/C++, PHP and Python
Loading...
Searching...
No Matches
XdmItem.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_XDMITEM_h
11#define SAXON_XDMITEM_h
12
13#include "saxonc_export.h"
14#include "saxonc/XdmValue.h"
15
16class SaxonProcessor;
17
31class SAXONC_EXPORT XdmItem : public XdmValue {
32
33public:
38 XdmItem();
39
44 explicit XdmItem(int64_t objRef);
45
50 XdmItem(const XdmItem &item);
51
52 bool operator==(const XdmItem& other) const
53 {
54 //std::cerr<<"C++ XdmItem equals operator called !!!!"<<std::endl;
55 return false;
56 /*char result = j_xdmNodeEquals(SaxonProcessor::sxn_environ->thread, (void *)value, (void *)other.value);
57 if((int)result == SXN_EXCEPTION) {
58 throw SaxonApiException();
59 }
60 return result != 0;*/
61 }
62
66 virtual ~XdmItem();
67
72 virtual void incrementRefCount();
73
78 virtual void decrementRefCount();
79
86 virtual bool isAtomic();
87
94 virtual bool isNode();
95
102 virtual bool isFunction();
103
109 virtual bool isMap();
110
116 virtual bool isArray();
117
122 virtual int64_t getUnderlyingValue();
123
139 virtual const char *getStringValue(const char *encoding = nullptr);
140
148 const char *toString(const char *encoding = nullptr);
149
154 virtual XdmItem *getHead();
155
166 XdmItem *itemAt(int n);
167
172 int size();
173
178 virtual XDM_TYPE getType();
179
180protected:
181
182 const char *stringValue;
184 const char *itemToString;
186};
187
188#endif
SAXONC_EXPORT const char * getStringValue(sxnc_environment *environi, sxnc_value value)
Get the string value of the item.
Definition SaxonCXPath.c:223
The SaxonProcessor class acts as a factory for generating XQuery, XPath, Schema and XSLT compilers.
Definition SaxonProcessor.h:117
The class XdmItem represents an item in a sequence, as defined by the XDM data model.
Definition XdmItem.h:31
const char * stringValue
Definition XdmItem.h:182
const char * itemToString
Definition XdmItem.h:184
An XdmValue represents a value in the XDM data model.
Definition XdmValue.h:43
virtual int64_t getUnderlyingValue()
Get the underlying Java XdmValue object - internal use only.
Definition XdmValue.cpp:323
virtual XDM_TYPE getType()
Get the type of this XDM value.
Definition XdmValue.cpp:372
virtual XdmItem * itemAt(int n)
Get the n'th item in the sequence, counting from zero.
Definition XdmValue.cpp:363
virtual void incrementRefCount()
Increment reference count of this XdmValue - internal use only This method is used for internal memor...
Definition XdmValue.cpp:285
virtual void decrementRefCount()
Decrement reference count of this XdmValue - internal use only This method is used for internal memor...
Definition XdmValue.cpp:303
virtual XdmItem * getHead()
Get the first item in the sequence represented by this XdmValue.
Definition XdmValue.cpp:313
virtual const char * toString(const char *encoding=nullptr)
Create a string representation of the sequence.
Definition XdmValue.cpp:42
virtual int size()
Get the number of items in the sequence.
Definition XdmValue.cpp:73