Xalan-C++ API Reference 1.12.0
XalanMatchPatternData.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
19#if !defined(XALAN_MATCHPATTERNDATA_HEADER_GUARD)
20#define XALAN_MATCHPATTERNDATA_HEADER_GUARD
21
22
23
24// Base include file. Must be first.
26
27
28
29#include <cstddef>
30
31
32
34
35
36
38
39
40
41namespace XALAN_CPP_NAMESPACE {
42
43
44class ElemTemplate;
45
46
47
48/**
49 * This class contains information concerning a match pattern in
50 * a stylesheet.
51 */
53{
54
55public:
56
58
59 typedef std::size_t size_type;
60
61
62 /**
63 * Construct a XalanMatchPatternData from a pattern and template.
64 *
65 * @param theTemplate The ElemTemplate node that contains the template for this pattern
66 * @param thePosition The position in the stylesheet
67 * @param theTargetString The target string for match pattern
68 * @param TheMatchPattern The match pattern
69 * @param thePatternString the pattern string
70 * @param thePriority The priority for the match pattern.
71 */
73 MemoryManager& theManager,
80 m_template(&theTemplate),
81 m_position(thePosition),
82 m_targetString(theTargetString, theManager),
83 m_matchPattern(&theMatchPattern),
84 m_pattern(&thePatternString),
85 m_priority(thePriority)
86 {
87 }
88
92
93 /**
94 * Retrieve string for target.
95 *
96 * @return target string
97 */
98 const XalanDOMString&
100 {
101 return m_targetString;
102 }
103
104 /**
105 * Retrieve the match pattern associated with pattern.
106 *
107 * @return XPath for pattern
108 */
109 const XPath*
111 {
112 return m_matchPattern;
113 }
114
115 /**
116 * Retrieve position of pattern in stylesheet.
117 *
118 * @return The position in the stylesheet
119 */
122 {
123 return m_position;
124 }
125
126 /**
127 * Retrieve pattern string.
128 *
129 * @return string that contains element pattern
130 */
131 const XalanDOMString*
133 {
134 return m_pattern;
135 }
136
137 /**
138 * Retrieve node that contains the template for this pattern.
139 *
140 * @return template node
141 */
142 const ElemTemplate*
144 {
145 return m_template;
146 }
147
148 eMatchScore
150 {
151 return m_priority;
152 }
153
154 double
156
157private:
158 // not implemented
161
162 const ElemTemplate* m_template;
163
164 size_type m_position;
165
166 XalanDOMString m_targetString;
167
168 const XPath* m_matchPattern;
169
170 const XalanDOMString* m_pattern;
171
172 eMatchScore m_priority;
173};
174
175
176
177}
178
179
180
181#endif // XALAN_MATCHPATTERNDATA_HEADER_GUARD
#define XALAN_XSLT_EXPORT
#define XALAN_CPP_NAMESPACE
Xalan-C++ namespace, including major and minor version.
This class contains information concerning a match pattern in a stylesheet.
double getPriorityOrDefault() const
const XalanDOMString * getPattern() const
Retrieve pattern string.
XalanMatchPatternData(MemoryManager &theManager, const ElemTemplate &theTemplate, size_type thePosition, const XalanDOMString &theTargetString, const XPath &theMatchPattern, const XalanDOMString &thePatternString, eMatchScore thePriority)
Construct a XalanMatchPatternData from a pattern and template.
size_type getPosition() const
Retrieve position of pattern in stylesheet.
const XPath * getExpression() const
Retrieve the match pattern associated with pattern.
const XalanDOMString & getTargetString() const
Retrieve string for target.
const ElemTemplate * getTemplate() const
Retrieve node that contains the template for this pattern.
size_t size_type
Definition XalanMap.hpp:46