Xalan-C++ API Reference 1.12.0
NodeSortKey.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_NODESORTKEY_HEADER_GUARD)
20#define XALAN_NODESORTKEY_HEADER_GUARD
21
22// Base include file. Must be first.
23#include "XSLTDefinitions.hpp"
24
25
26
27// $$$ ToDo: This is necessary while XalanDOMString is a typedef.
29
30
31
33
34
35
36namespace XALAN_CPP_NAMESPACE {
37
38
39
40class ExecutionContext;
41class PrefixResolver;
42class XPath;
43
44
45
46/**
47 * Simple data structure class for use by the NodeSorter class.
48 */
50{
51public:
52
53 /**
54 * Construct a node sort key.
55 *
56 * @param executionContext current execution context
57 * @param selectPat XPath for selection
58 * @param treatAsNumbers treat as numeric values if true
59 * @param descending sort in descending order if true
60 * @param caseOrder case sort order enum
61 * @param langValue language
62 * @param resolver resolver for namespace resolution
63 */
66 const XPath* selectPat,
67 bool treatAsNumbers,
68 bool descending,
72
74
76
78
81
82 /**
83 * Retrieve the selection XPath.
84 *
85 * @return XPath for selection
86 */
87 const XPath*
89 {
90 return m_selectPat;
91 }
92
93 /**
94 * Whether to treat values as numbers.
95 *
96 * @return treat as numeric values if true
97 */
98 bool
100 {
101 return m_treatAsNumbers;
102 }
103
104 /**
105 * Whether to sort in descending order.
106 *
107 * @return sort in descending order if true
108 */
109 bool
111 {
112 return m_descending;
113 }
114
115 /**
116 * Get the enumeration value for the case order.
117 *
118 * @return sort upper case before lower case if true
119 */
122 {
123 return m_caseOrder;
124 }
125
126 /**
127 * Retrieve the resolver for namespaces.
128 *
129 * @return object for namespace resolution
130 */
131 const PrefixResolver*
133 {
134 return m_prefixResolver;
135 }
136
137 const XalanDOMString&
139 {
140 return *m_languageString;
141 }
142
143private:
144
145 ExecutionContext* m_executionContext; // needed for error reporting.
146
147 const XPath* m_selectPat;
148
149 bool m_treatAsNumbers;
150 bool m_descending;
151
153
154 const PrefixResolver* m_prefixResolver;
155
156 const XalanDOMString* m_languageString;
157};
158
159
160
161}
162
163
164
165#endif
#define XALAN_XSLT_EXPORT
#define XALAN_CPP_NAMESPACE
Xalan-C++ namespace, including major and minor version.
Simple data structure class for use by the NodeSorter class.
const PrefixResolver * getPrefixResolver() const
Retrieve the resolver for namespaces.
const XPath * getSelectPattern() const
Retrieve the selection XPath.
NodeSortKey & operator=(const NodeSortKey &theRHS)
bool getTreatAsNumbers() const
Whether to treat values as numbers.
NodeSortKey(const NodeSortKey &theSource)
const XalanDOMString & getLanguageString() const
NodeSortKey(ExecutionContext &executionContext, const XPath *selectPat, bool treatAsNumbers, bool descending, XalanCollationServices::eCaseOrder caseOrder, const XalanDOMString &langValue, const PrefixResolver &resolver)
Construct a node sort key.
XalanCollationServices::eCaseOrder getCaseOrder() const
Get the enumeration value for the case order.
bool getDescending() const
Whether to sort in descending order.
This class defines an interface for classes that resolve namespace prefixes to their URIs.