SaxonC
13.0.0
Saxon Processor library for C/C++, PHP and Python
Toggle main menu visibility
Loading...
Searching...
No Matches
src
include
saxonc
XdmValue.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_XDMVALUE_H
11
#define SAXON_XDMVALUE_H
12
13
#include "saxonc_export.h"
14
#include "
saxonc/SaxonCGlue.h
"
15
#include "
saxonc/SaxonCXPath.h
"
16
#include "saxonc/SaxonProcessor.h"
17
#include <deque>
18
#include <list>
19
#include <string.h>
20
#include <typeinfo>
//used for testing only
21
#include <vector>
22
23
class
SaxonProcessor
;
24
class
XdmItem
;
25
class
XdmAtomicValue
;
26
class
XdmNode
;
27
33
class
SAXONC_EXPORT
XdmValue
{
34
35
public
:
40
XdmValue
() {
initialize
(); }
41
46
XdmValue
(
const
XdmValue
&other);
47
53
void
addXdmItem(
XdmItem
*val);
54
55
virtual
bool
operator==(
const
XdmValue
& other)
const
56
{
57
return
false
;
58
/*char result = j_xdmNodeEquals(SaxonProcessor::sxn_environ->thread, (void *)value, (void *)other.value);
59
if((int)result == SXN_EXCEPTION) {
60
throw SaxonApiException();
61
}
62
return result != 0;*/
63
}
64
69
void
addXdmItemFromUnderlyingValue(XdmItem *val);
70
76
void
addUnderlyingValue(int64_t val);
77
86
XdmValue(int64_t val,
bool
arrFlag);
87
92
XdmValue(int64_t val);
93
97
virtual
~XdmValue();
98
104
void
releaseXdmValue();
105
112
virtual
XdmItem *getHead();
113
125
virtual
XdmItem *itemAt(
int
n);
126
131
virtual
int
size
();
132
141
virtual
const
char
*toString(
const
char
*encoding =
nullptr
);
142
147
int
getRefCount
() {
148
if
(getenv(
"SAXONC_DEBUG_FLAG"
)) {
149
std::cerr <<
"getRefCount-xdmVal="
<<
refCount
<<
" ob ref="
<< (
this
)
150
<< std::endl;
151
}
152
return
refCount
;
153
}
154
159
virtual
void
incrementRefCount();
160
165
virtual
void
decrementRefCount();
166
171
virtual
int64_t getUnderlyingValue();
172
177
virtual
XDM_TYPE getType();
178
182
void
resetRelinquishedItems();
183
187
void
incrementRefCountForRelinquishedValue(
int
i);
188
189
protected
:
193
inline
void
initialize
() {
194
jValues = SXN_UNSET;
195
refCount
= 0;
196
valueType
=
nullptr
;
197
xdmSize
= 0;
198
toStringValue =
nullptr
;
199
values_cap
= 0;
200
values
=
nullptr
;
201
emptyValue
= SXN_UNSET;
202
relinquished_values
=
nullptr
;
203
// relinquished_values[0] = 0;
204
}
205
206
char
*
valueType
;
207
208
XdmItem
**
values
;
209
char
*
relinquished_values
;
210
int
values_cap
;
211
int
xdmSize
;
212
int
refCount
;
214
int64_t
value
;
215
int64_t
emptyValue
;
216
217
private
:
218
char
*toStringValue;
220
int64_t jValues;
222
223
int
addXdmItemToValue(
XdmItem
*val);
224
};
225
226
#endif
SaxonCGlue.h
This C header file contains a number of factory functions for running SaxonC C/C++ APIs,...
SaxonCXPath.h
SaxonCXPath.h provides the C API for XPath processing. This file contains a set of functions to compi...
size
SAXONC_EXPORT int size(sxnc_environment *environi, sxnc_value val)
Get the number of items in the sequence.
Definition
SaxonCXPath.c:245
SaxonProcessor
The SaxonProcessor class acts as a factory for generating XQuery, XPath, Schema and XSLT compilers.
Definition
SaxonProcessor.h:137
XdmAtomicValue
The class XdmAtomicValue represents an item in an XPath sequence that is an atomic value.
Definition
XdmAtomicValue.h:27
XdmItem
The class XdmItem represents an item in a sequence, as defined by the XDM data model.
Definition
XdmItem.h:31
XdmNode
This class represents a node in the XDM data model.
Definition
XdmNode.h:57
XdmValue
An XdmValue represents a value in the XDM data model.
Definition
XdmValue.h:33
XdmValue::values_cap
int values_cap
Definition
XdmValue.h:210
XdmValue::value
int64_t value
Definition
XdmValue.h:214
XdmValue::refCount
int refCount
Definition
XdmValue.h:212
XdmValue::relinquished_values
char * relinquished_values
Definition
XdmValue.h:209
XdmValue::xdmSize
int xdmSize
Definition
XdmValue.h:211
XdmValue::getRefCount
int getRefCount()
Get the number of references on this XdmValue - internal use only This method is used for internal me...
Definition
XdmValue.h:147
XdmValue::values
XdmItem ** values
Definition
XdmValue.h:208
XdmValue::emptyValue
int64_t emptyValue
Definition
XdmValue.h:215
XdmValue::valueType
char * valueType
Definition
XdmValue.h:206
XdmValue::initialize
void initialize()
Initialize this XdmValue with default values.
Definition
XdmValue.h:193
XdmValue::XdmValue
XdmValue()
Default constructor.
Definition
XdmValue.h:40
Generated on
for SaxonC by
1.17.0