Xalan-C++ API Reference 1.12.0
AVT.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(XALAN_AVT_HEADER_GUARD)
19#define XALAN_AVT_HEADER_GUARD
20
21// Base include file. Must be first.
23
24
25
27
28
29
30namespace XERCES_CPP_NAMESPACE
31{
32 class Locator;
33}
34
35
36
37namespace XALAN_CPP_NAMESPACE {
38
39
40
41typedef xercesc::Locator LocatorType;
42using xercesc::Locator;
43
44
45
46class AVTPart;
47class PrefixResolver;
48class XPathExecutionContext;
49class XalanNode;
50class StringTokenizer;
51class StylesheetConstructionContext;
52
53
54
55/**
56 * Class to hold an Attribute Value Template.
57 */
58class AVT
59{
60public:
61
62 typedef std::size_t size_type;
63
64 /**
65 * Construct an Attribute Value Template(AVT) by parsing the string, and
66 * either constructing a vector of AVTParts, or simply hold on to the
67 * string if the AVT is simple.
68 *
69 * @param constructionContext context for construction of AVT
70 * @param locator the Locator for the AVT. May be null.
71 * @param name name of AVT
72 * @param stringedValue string value to parse
73 * @param resolver resolver for namespace resolution
74 */
77 const Locator* locator,
78 const XalanDOMChar* name,
81
82 virtual
84
85 /**
86 * Retrieve the name of the Attribute Value Template
87 *
88 * @return name of AVT
89 */
90 const XalanDOMString&
91 getName() const
92 {
93 return m_name;
94 }
95
96 /**
97 * Append the value to the buffer.
98 *
99 * @param buf buffer to write into
100 * @param contextNode current context node
101 * @param prefixResolver prefix resolver to use
102 * @param executionContext execution context
103 */
104 void
110 {
111 if(m_simpleString != 0)
112 {
113 buf.assign(m_simpleString, m_simpleStringLength);
114 }
115 else
116 {
118 }
119 }
120
121 /**
122 * Append the value to the buffer.
123 *
124 * @param buf buffer to write into
125 * @param prefixResolver prefix resolver to use
126 * @param executionContext execution context
127 */
128 void
133 {
134 if(m_simpleString != 0)
135 {
136 buf.assign(m_simpleString, m_simpleStringLength);
137 }
138 else
139 {
140 doEvaluate(buf, prefixResolver, executionContext);
141 }
142 }
143
144private:
145
146 void
147 doEvaluate(
151
152 void
153 doEvaluate(
158
159 void
160 nextToken(
162 const Locator* locator,
165
166 // not implemented
167 AVT(const AVT&);
168
169 AVT&
170 operator=(const AVT&);
171
172 bool
173 operator==(const AVT&) const;
174
175
176 // Data members...
177 const AVTPart** m_parts;
178
179 size_type m_partsSize;
180
181 const XalanDOMChar* m_simpleString;
182
183 XalanDOMString::size_type m_simpleStringLength;
184
185 const XalanDOMString& m_name;
186
187 static const XalanDOMString s_emptyString;
188};
189
190
191
192}
193
194
195
196#endif // XALAN_AVT_HEADER_GUARD
#define XALAN_CPP_NAMESPACE
Xalan-C++ namespace, including major and minor version.
Class to hold a part, either a string or XPath, of an Attribute Value Template.
Definition AVTPart.hpp:44
Class to hold an Attribute Value Template.
Definition AVT.hpp:59
std::size_t size_type
Definition AVT.hpp:62
virtual ~AVT()
void evaluate(XalanDOMString &buf, const PrefixResolver &prefixResolver, XPathExecutionContext &executionContext) const
Append the value to the buffer.
Definition AVT.hpp:129
const XalanDOMString & getName() const
Retrieve the name of the Attribute Value Template.
Definition AVT.hpp:91
void evaluate(XalanDOMString &buf, XalanNode *contextNode, const PrefixResolver &prefixResolver, XPathExecutionContext &executionContext) const
Append the value to the buffer.
Definition AVT.hpp:105
AVT(StylesheetConstructionContext &constructionContext, const Locator *locator, const XalanDOMChar *name, const XalanDOMChar *stringedValue, const PrefixResolver &resolver)
Construct an Attribute Value Template(AVT) by parsing the string, and either constructing a vector of...
This class defines an interface for classes that resolve namespace prefixes to their URIs.
size_t size_type
Definition XalanMap.hpp:46
xercesc::Locator LocatorType
bool operator==(const XalanVector< Type > &theLHS, const XalanVector< Type > &theRHS)