Xalan-C++ API Reference  1.12.0
XalanEXSLTCommonImpl.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(EXSLT_COMMONIMPL_HEADER_GUARD_1357924680)
19 #define EXSLT_COMMONIMPL_HEADER_GUARD_1357924680
20 
21 
22 
24 
25 
26 
28 
29 
30 
32 
33 
34 
36 
37 
38 
39 namespace XALAN_CPP_NAMESPACE {
40 
41 
42 
44 {
45 public:
46 
48  FunctionNodeSet(true)
49  {
50  }
51 
52  virtual
54  {
55  }
56 
58  clone(MemoryManager& theManager) const
59  {
60  return XalanCopyConstruct(theManager, *this);
61  }
62 
63 protected:
64 
65  virtual const XalanDOMString&
66  getError(XalanDOMString& theBuffer) const
67  {
68  XalanMessageLoader::getMessage(
69  theBuffer,
70  XalanMessages::EXSLTFunctionAcceptsOneArgument_1Param,
71  "node-set()");
72 
73  return theBuffer;
74  }
75 
76 
77  virtual const XalanDOMString&
79  {
80  XalanMessageLoader::getMessage(
81  theResult,
82  XalanMessages::InvalidArgumentType_1Param,
83  "node-set()");
84 
85  return theResult;
86  }
87 
88 private:
89 
90  // Not implemented...
92  operator=(const XalanEXSLTFunctionNodeSet&);
93 
94  bool
96 };
97 
98 
99 
101 {
102 public:
103 
105 
106  XalanEXSLTFunctionObjectType(MemoryManager& theManager) :
107  Function(),
108  m_boolean(s_booleanString, theManager),
109  m_external(s_externalString, theManager),
110  m_nodeSet(s_nodeSetString, theManager),
111  m_number(s_numberString, theManager),
112  m_rtf(s_rtfString, theManager),
113  m_string(s_stringString, theManager)
114  {
115  }
116 
117  // A dummy constructor for use internally. Do not use this one!!!!
118  XalanEXSLTFunctionObjectType(MemoryManager& theManager, int /* theDummy */) :
119  Function(),
120  m_boolean(theManager),
121  m_external(theManager),
122  m_nodeSet(theManager),
123  m_number(theManager),
124  m_rtf(theManager),
125  m_string(theManager)
126  {
127  }
128 
129  virtual
131  {
132  }
133 
134  // These methods are inherited from Function ...
135 
136  virtual XObjectPtr
137  execute(
138  XPathExecutionContext& executionContext,
139  XalanNode* context,
140  const XObjectArgVectorType& args,
141  const Locator* locator) const;
142 
143  using ParentType::execute;
144 
146  clone(MemoryManager& theManager) const
147  {
148  typedef XalanEXSLTFunctionObjectType ThisType;
149 
150  XalanAllocationGuard theGuard(theManager, theManager.allocate(sizeof(ThisType)));
151 
152  ThisType* const theResult =
153  new (theGuard.get()) ThisType(theManager);
154 
155  theGuard.release();
156 
157  return theResult;
158  }
159 
160 protected:
161 
162 
163 
164  const XalanDOMString&
165  getError(XalanDOMString& theResult) const;
166 
167 private:
168 
169  // Not implemented...
171 
173  operator=(const XalanEXSLTFunctionObjectType&);
174 
175  bool
177 
178 
179  // Data members...
180  const XalanDOMString m_boolean;
181  const XalanDOMString m_external;
182  const XalanDOMString m_nodeSet;
183  const XalanDOMString m_number;
184  const XalanDOMString m_rtf;
185  const XalanDOMString m_string;
186 
187  static const XalanDOMChar s_booleanString[];
188  static const XalanDOMChar s_externalString[];
189  static const XalanDOMChar s_nodeSetString[];
190  static const XalanDOMChar s_numberString[];
191  static const XalanDOMChar s_rtfString[];
192  static const XalanDOMChar s_stringString[];
193 };
194 
195 
196 
197 }
198 
199 
200 
201 #endif // EXSLT_COMMONIMPL_HEADER_GUARD_1357924680
xalanc::XalanEXSLTFunctionObjectType::XalanEXSLTFunctionObjectType
XalanEXSLTFunctionObjectType(MemoryManager &theManager, int)
Definition: XalanEXSLTCommonImpl.hpp:118
XALAN_CPP_NAMESPACE
#define XALAN_CPP_NAMESPACE
Xalan-C++ namespace, including major and minor version.
Definition: XalanVersion.hpp:76
xalanc::XalanAllocationGuard::release
void release()
Definition: XalanMemoryManagement.hpp:133
xalanc::XalanNode
Definition: XalanNode.hpp:38
xalanc::XalanEXSLTFunctionObjectType::~XalanEXSLTFunctionObjectType
virtual ~XalanEXSLTFunctionObjectType()
Definition: XalanEXSLTCommonImpl.hpp:130
xalanc::XalanEXSLTFunctionNodeSet::getError
virtual const XalanDOMString & getError(XalanDOMString &theBuffer) const
Get the error message to report when the function is called with the wrong number of arguments.
Definition: XalanEXSLTCommonImpl.hpp:66
xalanc::XalanEXSLTFunctionObjectType::ParentType
Function ParentType
Definition: XalanEXSLTCommonImpl.hpp:104
XALAN_EXSLT_EXPORT
#define XALAN_EXSLT_EXPORT
Definition: XalanEXSLTDefinitions.hpp:35
xalanc::operator==
bool operator==(const XalanVector< Type > &theLHS, const XalanVector< Type > &theRHS)
Definition: XalanVector.hpp:1118
xalanc::XalanEXSLTFunctionNodeSet::getInvalidArgumentTypeError
virtual const XalanDOMString & getInvalidArgumentTypeError(XalanDOMString &theResult) const
Definition: XalanEXSLTCommonImpl.hpp:78
XalanMessageLoader.hpp
xalanc::XObjectPtr
Class to hold XObjectPtr return types.
Definition: XObject.hpp:883
xalanc::XalanEXSLTFunctionObjectType
Definition: XalanEXSLTCommonImpl.hpp:100
xalanc::XalanAllocationGuard
Definition: XalanMemoryManagement.hpp:96
xalanc::XalanEXSLTFunctionNodeSet
Definition: XalanEXSLTCommonImpl.hpp:43
xalanc::XalanCopyConstruct
Type * XalanCopyConstruct(MemoryManager &theMemoryManager, const Type &theSource)
Definition: XalanMemoryManagement.hpp:450
xalanc::Function
Definition: Function.hpp:57
xalanc::XalanEXSLTFunctionNodeSet::XalanEXSLTFunctionNodeSet
XalanEXSLTFunctionNodeSet()
Definition: XalanEXSLTCommonImpl.hpp:47
xalanc::XalanEXSLTFunctionNodeSet::~XalanEXSLTFunctionNodeSet
virtual ~XalanEXSLTFunctionNodeSet()
Definition: XalanEXSLTCommonImpl.hpp:53
xalanc::FunctionNodeSet
XPath implementation of "node-set" function.
Definition: FunctionNodeSet.hpp:44
xalanc::XalanEXSLTFunctionObjectType::clone
virtual XalanEXSLTFunctionObjectType * clone(MemoryManager &theManager) const
Create a copy of the function object.
Definition: XalanEXSLTCommonImpl.hpp:146
xalanc::XalanEXSLTFunctionObjectType::XalanEXSLTFunctionObjectType
XalanEXSLTFunctionObjectType(MemoryManager &theManager)
Definition: XalanEXSLTCommonImpl.hpp:106
xalanc::XalanAllocationGuard::get
void * get() const
Definition: XalanMemoryManagement.hpp:127
xalanc::XPathExecutionContext
Definition: XPathExecutionContext.hpp:82
XalanEXSLTDefinitions.hpp
FunctionNodeSet.hpp
xalanc::XalanDOMString
Definition: XalanDOMString.hpp:45
Function.hpp
xalanc::XalanEXSLTFunctionNodeSet::clone
virtual XalanEXSLTFunctionNodeSet * clone(MemoryManager &theManager) const
Create a copy of the function object.
Definition: XalanEXSLTCommonImpl.hpp:58