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 
36 namespace XALAN_CPP_NAMESPACE {
37 
38 
39 
40 class ExecutionContext;
41 class PrefixResolver;
42 class XPath;
43 
44 
45 
46 /**
47  * Simple data structure class for use by the NodeSorter class.
48  */
50 {
51 public:
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  */
65  ExecutionContext& executionContext,
66  const XPath* selectPat,
67  bool treatAsNumbers,
68  bool descending,
70  const XalanDOMString& langValue,
71  const PrefixResolver& resolver);
72 
73  NodeSortKey();
74 
75  NodeSortKey(const NodeSortKey& theSource);
76 
77  ~NodeSortKey();
78 
80  operator=(const NodeSortKey& theRHS);
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  */
121  getCaseOrder() const
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 
143 private:
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
xalanc::NodeSortKey::getDescending
bool getDescending() const
Whether to sort in descending order.
Definition: NodeSortKey.hpp:110
XALAN_CPP_NAMESPACE
#define XALAN_CPP_NAMESPACE
Xalan-C++ namespace, including major and minor version.
Definition: XalanVersion.hpp:76
xalanc::NodeSortKey
Simple data structure class for use by the NodeSorter class.
Definition: NodeSortKey.hpp:49
xalanc::NodeSortKey::getSelectPattern
const XPath * getSelectPattern() const
Retrieve the selection XPath.
Definition: NodeSortKey.hpp:88
XalanDOMString.hpp
xalanc::XPath
Definition: XPath.hpp:67
XALAN_XSLT_EXPORT
#define XALAN_XSLT_EXPORT
Definition: XSLTDefinitions.hpp:27
xalanc::XalanCollationServices::eCaseOrder
eCaseOrder
Definition: XalanCollationServices.hpp:40
xalanc::NodeSortKey::getCaseOrder
XalanCollationServices::eCaseOrder getCaseOrder() const
Get the enumeration value for the case order.
Definition: NodeSortKey.hpp:121
xalanc::ExecutionContext
Definition: ExecutionContext.hpp:60
XalanCollationServices.hpp
xalanc::NodeSortKey::getTreatAsNumbers
bool getTreatAsNumbers() const
Whether to treat values as numbers.
Definition: NodeSortKey.hpp:99
xalanc::PrefixResolver
This class defines an interface for classes that resolve namespace prefixes to their URIs.
Definition: PrefixResolver.hpp:39
xalanc::NodeSortKey::getLanguageString
const XalanDOMString & getLanguageString() const
Definition: NodeSortKey.hpp:138
XSLTDefinitions.hpp
xalanc::XalanDOMString
Definition: XalanDOMString.hpp:45
xalanc::NodeSortKey::getPrefixResolver
const PrefixResolver * getPrefixResolver() const
Retrieve the resolver for namespaces.
Definition: NodeSortKey.hpp:132