SaxonC 12.7.0
Saxon Processor library for C/C++, PHP and Python
Loading...
Searching...
No Matches
XdmAtomicValue.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_XDMATOMICVALUE_h
11#define SAXON_XDMATOMICVALUE_h
12
13#include "saxonc_export.h"
14#include "saxonc/XdmItem.h"
15#include <string>
16
17#include <stdlib.h>
18#include <string.h>
19
27class SAXONC_EXPORT XdmAtomicValue : public XdmItem {
28
29public:
35
40 XdmAtomicValue(const XdmAtomicValue &other);
41
45 virtual ~XdmAtomicValue();
46
51 XdmAtomicValue(int64_t val);
52
58 XdmAtomicValue(int64_t val, const char *ty);
59
69 const char *getPrimitiveTypeName();
70
79 bool getBooleanValue();
80
91 double getDoubleValue();
92
105 const char *getStringValue(const char *encoding = nullptr);
106
114 long getLongValue();
115
120 void setType(const char *ty);
121
126 XdmItem *getHead();
127
133 bool isAtomic() { return true; }
134
139 int getHashCode();
140
145 XDM_TYPE getType() { return XDM_ATOMIC_VALUE; }
146
147private:
148 std::string valType;
149};
150
151#endif
SAXONC_EXPORT bool getBooleanValue(sxnc_environment *environi, sxnc_value value)
Get the boolean value of the item.
Definition SaxonCXPath.c:321
SAXONC_EXPORT long getLongValue(sxnc_environment *environi, sxnc_value value, long failureVal)
Get the long value of the item.
Definition SaxonCXPath.c:326
SAXONC_EXPORT double getDoubleValue(sxnc_environment *environi, sxnc_value value, double failureVal)
Get the double value of the item.
Definition SaxonCXPath.c:338
The class XdmAtomicValue represents an item in an XPath sequence that is an atomic value.
Definition XdmAtomicValue.h:27
bool isAtomic()
Determine whether the item is an atomic value or some other type of item.
Definition XdmAtomicValue.h:133
XDM_TYPE getType()
Get the type of this XDM value.
Definition XdmAtomicValue.h:145
The class XdmItem represents an item in a sequence, as defined by the XDM data model.
Definition XdmItem.h:31
virtual const char * getStringValue(const char *encoding=nullptr)
Get the string value of the item.
Definition XdmItem.cpp:56
virtual XdmItem * getHead()
Get the first item in the sequence consisting of just this item.
Definition XdmItem.cpp:41