SaxonC  11.6
Saxon Processor library for C/C++, PHP and Python
XdmAtomicValue.h
1 // Copyright (c) 2022 Saxonica Limited.
3 // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
4 // If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
5 // This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0.
7 
8 #ifndef SAXON_XDMATOMICVALUE_h
9 #define SAXON_XDMATOMICVALUE_h
10 
11 
12 #include "XdmItem.h"
13 #include <string>
14 
15 #include <stdlib.h>
16 #include <string.h>
17 
18 
26 class XdmAtomicValue : public XdmItem {
27 
28 public:
29 
31 
35 
37 
41  XdmAtomicValue(const XdmAtomicValue &other);
42 
44 
47  virtual ~XdmAtomicValue();
48 
50 
54  XdmAtomicValue(jobject val);
55 
57 
62  XdmAtomicValue(jobject val, const char* ty);
63 
65 
72  const char* getPrimitiveTypeName();
73 
75 
82  bool getBooleanValue();
83 
85 
93  double getDoubleValue();
94 
96 
107  const char * getStringValue();
108 
110 
116  long getLongValue();
117 
119 
123  void setType(const char* ty);
124 
126 
130  XdmItem * getHead();
131 
133 
138  bool isAtomic(){
139  return true;
140  }
141 
143 
147  int getHashCode();
148 
152  XDM_TYPE getType() {
153  return XDM_ATOMIC_VALUE;
154  }
155 
156 
157 private:
158 
159  std::string valType;
162 };
163 
164 
165 
166 
167 #endif
Definition: XdmAtomicValue.h:26
const char * getStringValue()
Get the string value of the item.
Definition: XdmAtomicValue.cpp:122
void setType(const char *ty)
Set the type annotation of the atomic value.
Definition: XdmAtomicValue.cpp:32
virtual ~XdmAtomicValue()
Destructor.
Definition: XdmAtomicValue.cpp:24
int getHashCode()
Get a hashcode that reflects the rules for equality matching.
Definition: XdmAtomicValue.cpp:81
double getDoubleValue()
Get the value converted to a double using the XPath casting rules.
Definition: XdmAtomicValue.cpp:100
XdmAtomicValue()
A default Constructor.
Definition: XdmAtomicValue.cpp:6
const char * getPrimitiveTypeName()
Get the primitive type of this atomic value, as a QName.
Definition: XdmAtomicValue.cpp:36
bool isAtomic()
Determine whether the item is an atomic value or some other type of item.
Definition: XdmAtomicValue.h:138
bool getBooleanValue()
Get the value converted to a boolean using the XPath casting rules.
Definition: XdmAtomicValue.cpp:62
XdmItem * getHead()
Get the first item in the sequence.
Definition: XdmAtomicValue.cpp:13
long getLongValue()
Get the value converted to an integer using the XPath casting rules.
Definition: XdmAtomicValue.cpp:126
XDM_TYPE getType()
Definition: XdmAtomicValue.h:152
Definition: XdmItem.h:29