SourceForge.net Logo
Node.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2001, 2008,
3  * DecisionSoft Limited. All rights reserved.
4  * Copyright (c) 2004, 2018 Oracle and/or its affiliates. All rights reserved.
5  *
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 
20 #ifndef _XQILLANODE_HPP
21 #define _XQILLANODE_HPP
22 
25 #include <xqilla/ast/XQStep.hpp>
26 
27 class DynamicContext;
29 class Sequence;
30 class Result;
31 class NodeTest;
32 
33 class XQILLA_API Node : public Item
34 {
35 public:
37 
39  virtual bool isNode() const;
40 
42  virtual bool isAtomicValue() const;
43 
44  virtual bool isFunction() const;
45 
46  virtual void typeToBuffer(DynamicContext *context, XERCES_CPP_NAMESPACE_QUALIFIER XMLBuffer &buffer) const;
47 
49  virtual const XMLCh* asString(const DynamicContext* context) const = 0;
50 
52  virtual bool hasInstanceOfType(const XMLCh* typeURI, const XMLCh* typeName, const DynamicContext* context) const = 0;
53 
56  virtual Sequence dmBaseURI(const DynamicContext* context) const = 0;
57 
59  virtual const XMLCh* dmNodeKind() const = 0;
60 
62  virtual ATQNameOrDerived::Ptr dmNodeName(const DynamicContext* context) const = 0;
63 
65  virtual const XMLCh* dmStringValue(const DynamicContext* context) const = 0;
66 
70  virtual Sequence dmTypedValue(DynamicContext* context) const = 0;
71 
74  virtual Sequence dmDocumentURI(const DynamicContext* context) const = 0;
75 
77  virtual ATQNameOrDerived::Ptr dmTypeName(const DynamicContext* context) const = 0;
78 
80  virtual ATBooleanOrDerived::Ptr dmNilled(const DynamicContext* context) const = 0;
81 
84  virtual bool lessThan(const Node::Ptr &other, const DynamicContext *context) const = 0;
85 
87  virtual bool equals(const Node::Ptr &other) const = 0;
88 
91  virtual bool uniqueLessThan(const Node::Ptr &other, const DynamicContext *context) const = 0;
92 
94  virtual Node::Ptr root(const DynamicContext* context) const = 0;
95 
97  virtual Node::Ptr dmParent(const DynamicContext* context) const = 0;
98 
100  virtual Result dmAttributes(const DynamicContext* context, const LocationInfo *info) const = 0;
101 
103  virtual Result dmNamespaceNodes(const DynamicContext* context, const LocationInfo *info) const = 0;
104 
106  virtual Result dmChildren(const DynamicContext *context, const LocationInfo *info) const = 0;
107 
113  virtual Result getAxisResult(XQStep::Axis axis, const NodeTest *nodeTest, const DynamicContext *context, const LocationInfo *info) const = 0;
114 
116  virtual ATBooleanOrDerived::Ptr dmIsId(const DynamicContext* context) const = 0;
117 
119  virtual ATBooleanOrDerived::Ptr dmIsIdRefs(const DynamicContext* context) const = 0;
120 
121  /* Get the namespace URI for the DOM type */
122  virtual const XMLCh* getTypeURI() const = 0;
123 
124  /* Get the name of the DOM type (ie "integer" for xs:integer) */
125  virtual const XMLCh* getTypeName() const = 0;
126 
127  static const XMLCh document_string[];
128  static const XMLCh element_string[];
129  static const XMLCh attribute_string[];
130  static const XMLCh text_string[];
131  static const XMLCh processing_instruction_string[];
132  static const XMLCh comment_string[];
133  static const XMLCh namespace_string[];
134 };
135 #endif
Definition: XPath2MemoryManager.hpp:45
virtual const XMLCh * getTypeName() const =0
virtual bool isAtomicValue() const =0
virtual bool isNode() const =0
Definition: Node.hpp:33
virtual bool isFunction() const =0
Super class of all the reference counted wrappers for Items.
Definition: ReferenceCounted.hpp:61
A scoped pointer wrapper for the lazily evaluated query result.
Definition: Result.hpp:37
Definition: Item.hpp:36
virtual void typeToBuffer(DynamicContext *context, xercesc::XMLBuffer &buffer) const =0
Debug method to output the type of the item in SequenceType notation.
The execution time dynamic context interface.
Definition: DynamicContext.hpp:38
A class that gives records a location in the query.
Definition: LocationInfo.hpp:29
virtual const XMLCh * getTypeURI() const =0
An eagerly evaluated result of a query execution.
Definition: Sequence.hpp:39
virtual const XMLCh * asString(const DynamicContext *context) const =0
RefCountPointer< const Node > Ptr
Definition: Node.hpp:36