Xalan-C++ API Reference  1.12.0
XNodeSetBase.hpp
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements. See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership. The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 #if !defined(XNODESETBASE_HEADER_GUARD_1357924680)
19 #define XNODESETBASE_HEADER_GUARD_1357924680
20 
21 
22 
23 // Base include file. Must be first.
25 
26 
27 
28 // Base class header file.
29 #include <xalanc/XPath/XObject.hpp>
30 
31 
32 
35 
36 
37 
38 namespace XALAN_CPP_NAMESPACE {
39 
40 
41 
42 /**
43  * Class to hold XPath return types.
44  */
46 {
47 public:
48 
50 
52 
53  virtual
55 
56  // These methods are inherited from XObject ...
57 
58 
59  virtual const XalanDOMString&
60  getTypeString() const;
61 
62  virtual double
63  num(XPathExecutionContext& executionContext) const;
64 
65  using ParentType::num;
66 
67  virtual bool
68  boolean(XPathExecutionContext& executionContext) const;
69 
70  virtual const XalanDOMString&
71  str(XPathExecutionContext& executionContext) const;
72 
73  virtual const XalanDOMString&
74  str() const;
75 
76  virtual void
77  str(
78  XPathExecutionContext& executionContext,
79  FormatterListener& formatterListener,
80  MemberFunctionPtr function) const;
81 
82  virtual void
83  str(
84  FormatterListener& formatterListener,
85  MemberFunctionPtr function) const;
86 
87  virtual void
88  str(
89  XPathExecutionContext& executionContext,
90  XalanDOMString& theBuffer) const;
91 
92  virtual void
93  str(XalanDOMString& theBuffer) const;
94 
95  virtual double
96  stringLength(XPathExecutionContext& executionContext) const;
97 
98  virtual const XalanDocumentFragment&
99  rtree() const;
100 
101  virtual const NodeRefListBase&
102  nodeset() const = 0;
103 
104  virtual void
106 
107  virtual void
109 
110  virtual XalanNode*
111  item(size_type index) const = 0;
112 
113  virtual size_type
114  getLength() const = 0;
115 
116 protected:
117 
118  /**
119  * Create an XNodeSetBase
120  */
121  XNodeSetBase(MemoryManager& theMemoryManager);
122 
123  /**
124  * Create an XNodeSetBase from another.
125  *
126  * @param source object to copy
127  */
129  const XNodeSetBase& source,
130  MemoryManager& theMemoryManager);
131 
132  void
134 
135 private:
136 
137  // Not implemented...
138  XNodeSetBase();
139  XNodeSetBase(const XNodeSetBase&);
140  XNodeSetBase&
141  operator=(const XNodeSetBase&);
142 
143  // Data members...
145 
146  mutable XalanDOMString m_cachedStringValue;
147 
148  mutable double m_cachedNumberValue;
149 };
150 
151 
152 
153 }
154 
155 
156 
157 #endif // XNODESETBASE_HEADER_GUARD_1357924680
xalanc::XNodeSetBase::stringLength
virtual double stringLength(XPathExecutionContext &executionContext) const
Get the length of the string value of the instance.
XALAN_CPP_NAMESPACE
#define XALAN_CPP_NAMESPACE
Xalan-C++ namespace, including major and minor version.
Definition: XalanVersion.hpp:76
xalanc::XalanNode
Definition: XalanNode.hpp:39
xalanc::XNodeSetBase::str
virtual void str(XPathExecutionContext &executionContext, FormatterListener &formatterListener, MemberFunctionPtr function) const
Send the string value to a FormatterListener instance.
xalanc::XNodeSetBase::rtree
virtual const XalanDocumentFragment & rtree() const
Cast result object to a result tree fragment.
xalanc::XNodeSetBase::clearCachedValues
void clearCachedValues()
xalanc::XNodeSetBase::str
virtual void str(FormatterListener &formatterListener, MemberFunctionPtr function) const
Send the string value to a FormatterListener instance.
xalanc::XNodeSetBase::XNodeSetBase
XNodeSetBase(MemoryManager &theMemoryManager)
Create an XNodeSetBase.
xalanc::XNodeSetBase::nodeset
virtual const NodeRefListBase & nodeset() const =0
Cast result object to a nodelist.
xalanc::XNodeSetBase::str
virtual void str(XPathExecutionContext &executionContext, XalanDOMString &theBuffer) const
Append the string value directly a string.
XALAN_XPATH_EXPORT
#define XALAN_XPATH_EXPORT
Definition: XPathDefinitions.hpp:35
xalanc::XObjectTypeCallback
The purpose of this class is to provide a way to get the "preferred" or closest matching type for XOb...
Definition: XObjectTypeCallback.hpp:55
xalanc::XNodeSetBase::item
virtual XalanNode * item(size_type index) const =0
XNodeSetResultTreeFragProxy.hpp
xalanc::XNodeSetBase::XNodeSetBase
XNodeSetBase(const XNodeSetBase &source, MemoryManager &theMemoryManager)
Create an XNodeSetBase from another.
xalanc::XNodeSetBase::getLength
virtual size_type getLength() const =0
xalanc::XObject
Class to hold XPath return types.
Definition: XObject.hpp:64
xalanc::XNodeSetBase
Class to hold XPath return types.
Definition: XNodeSetBase.hpp:46
xalanc::XNodeSetBase::size_type
NodeRefListBase::size_type size_type
Definition: XNodeSetBase.hpp:49
xalanc::XNodeSetBase::ProcessXObjectTypeCallback
virtual void ProcessXObjectTypeCallback(XObjectTypeCallback &theCallbackObject)
Process a callback request for preferred type information.
xalanc::XNodeSetBase::getTypeString
virtual const XalanDOMString & getTypeString() const
Given a request type, return the equivalent string.
xalanc::XNodeSetBase::~XNodeSetBase
virtual ~XNodeSetBase()
NodeRefListBase.hpp
xalanc::XNodeSetResultTreeFragProxy
Definition: XNodeSetResultTreeFragProxy.hpp:41
xalanc::XNodeSetBase::ProcessXObjectTypeCallback
virtual void ProcessXObjectTypeCallback(XObjectTypeCallback &theCallbackObject) const
Process a callback request for preferred type information.
xalanc::XNodeSetBase::boolean
virtual bool boolean(XPathExecutionContext &executionContext) const
Cast result object to a boolean.
xalanc::XNodeSetBase::str
virtual void str(XalanDOMString &theBuffer) const
Append the string value directly a string.
xalanc::FormatterListener
A SAX-based formatter interface for the XSL processor.
Definition: FormatterListener.hpp:57
xalanc::XPathExecutionContext
Definition: XPathExecutionContext.hpp:83
xalanc::NodeRefListBase
Local implementation of NodeRefList.
Definition: NodeRefListBase.hpp:45
xalanc::XNodeSetBase::ParentType
XObject ParentType
Definition: XNodeSetBase.hpp:51
xalanc::XNodeSetBase::str
virtual const XalanDOMString & str(XPathExecutionContext &executionContext) const
Cast result object to a string.
xalanc::XNodeSetBase::str
virtual const XalanDOMString & str() const
Cast result object to a string.
xalanc::NodeRefListBase::size_type
XalanSize_t size_type
Definition: NodeRefListBase.hpp:53
xalanc::XalanDOMString
Definition: XalanDOMString.hpp:46
xalanc::XalanDocumentFragment
Definition: XalanDocumentFragment.hpp:33
xalanc::XNodeSetBase::num
virtual double num(XPathExecutionContext &executionContext) const
Cast result object to a number.
XObject.hpp
XPathDefinitions.hpp