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 
37 #include "xalanc/XPath/XPath.hpp"
38 
39 
40 
41 namespace XALAN_CPP_NAMESPACE {
42 
43 
44 class ElemTemplate;
45 
46 
47 
48 /**
49  * This class contains information concerning a match pattern in
50  * a stylesheet.
51  */
53 {
54 
55 public:
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,
74  const ElemTemplate& theTemplate,
75  size_type thePosition,
76  const XalanDOMString& theTargetString,
77  const XPath& theMatchPattern,
78  const XalanDOMString& thePatternString,
79  eMatchScore thePriority) :
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 
90  {
91  }
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  */
120  size_type
121  getPosition() const
122  {
123  return m_position;
124  }
125 
126  /**
127  * Retrieve pattern string.
128  *
129  * @return string that contains element pattern
130  */
131  const XalanDOMString*
132  getPattern() const
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*
143  getTemplate() const
144  {
145  return m_template;
146  }
147 
148  eMatchScore
150  {
151  return m_priority;
152  }
153 
154  double
155  getPriorityOrDefault() const;
156 
157 private:
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
XALAN_CPP_NAMESPACE
#define XALAN_CPP_NAMESPACE
Xalan-C++ namespace, including major and minor version.
Definition: XalanVersion.hpp:76
xalanc::XalanMatchPatternData::XalanMatchPatternData
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.
Definition: XalanMatchPatternData.hpp:72
XalanDOMString.hpp
xalanc::XalanMatchPatternData::getDefaultPriority
eMatchScore getDefaultPriority() const
Definition: XalanMatchPatternData.hpp:149
xalanc::XPath
Definition: XPath.hpp:67
XALAN_XSLT_EXPORT
#define XALAN_XSLT_EXPORT
Definition: XSLTDefinitions.hpp:27
xalanc::XalanMatchPatternData::~XalanMatchPatternData
~XalanMatchPatternData()
Definition: XalanMatchPatternData.hpp:89
xalanc::size_type
size_t size_type
Definition: XalanMap.hpp:46
xalanc::XalanMatchPatternData
This class contains information concerning a match pattern in a stylesheet.
Definition: XalanMatchPatternData.hpp:52
xalanc::XalanMatchPatternData::eMatchScore
XPath::eMatchScore eMatchScore
Definition: XalanMatchPatternData.hpp:57
xalanc::XalanMatchPatternData::getTemplate
const ElemTemplate * getTemplate() const
Retrieve node that contains the template for this pattern.
Definition: XalanMatchPatternData.hpp:143
xalanc::XalanMatchPatternData::size_type
std::size_t size_type
Definition: XalanMatchPatternData.hpp:59
xalanc::XPath::eMatchScore
eMatchScore
Definition: XPath.hpp:89
XPath.hpp
xalanc::ElemTemplate
Definition: ElemTemplate.hpp:43
xalanc::XalanMatchPatternData::getExpression
const XPath * getExpression() const
Retrieve the match pattern associated with pattern.
Definition: XalanMatchPatternData.hpp:110
XSLTDefinitions.hpp
xalanc::XalanDOMString
Definition: XalanDOMString.hpp:45
xalanc::XalanMatchPatternData::getPattern
const XalanDOMString * getPattern() const
Retrieve pattern string.
Definition: XalanMatchPatternData.hpp:132
xalanc::XalanMatchPatternData::getPosition
size_type getPosition() const
Retrieve position of pattern in stylesheet.
Definition: XalanMatchPatternData.hpp:121
xalanc::XalanMatchPatternData::getTargetString
const XalanDOMString & getTargetString() const
Retrieve string for target.
Definition: XalanMatchPatternData.hpp:99