CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
xpath_expression.h
1
2
3#pragma once
4
5#include <system/object_ext.h>
6#include <system/enum.h>
7#include <cstdint>
8
9
11namespace System
12{
13namespace Collections
14{
15namespace Generic
16{
17template <typename> class IComparer;
18} // namespace Generic
19} // namespace Collections
20namespace Xml
21{
22class IXmlNamespaceResolver;
23class XmlNamespaceManager;
24} // namespace Xml
25} // namespace System
27
28namespace System {
29
30namespace Xml {
31
32namespace XPath {
33
35enum class XmlSortOrder
36{
39 Ascending = 1,
42 Descending = 2
43};
44
46enum class XmlCaseOrder
47{
49 None = 0,
51 UpperFirst = 1,
53 LowerFirst = 2
54};
55
57enum class XmlDataType
58{
60 Text = 1,
62 Number = 2
63};
64
67{
69 Number = 0,
71 String = 1,
73 Boolean = 2,
75 NodeSet = 3,
77 Navigator = static_cast<int32_t>(XPathResultType::String),
79 Any = 5,
81 Error
82};
83
85class ASPOSECPP_SHARED_CLASS XPathExpression : public System::Object
86{
89
90 typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
91 ASPOSECPP_SHARED_RTTI_INFO_DECL();
92
93public:
94
97
98public:
99
102 virtual ASPOSECPP_SHARED_API String get_Expression() = 0;
105 virtual ASPOSECPP_SHARED_API XPathResultType get_ReturnType() = 0;
106
113 virtual ASPOSECPP_SHARED_API void AddSort(SharedPtr<Object> expr, SharedPtr<Collections::Generic::IComparer<SharedPtr<Object>>> comparer) = 0;
126 virtual ASPOSECPP_SHARED_API void AddSort(SharedPtr<Object> expr, XmlSortOrder order, XmlCaseOrder caseOrder, String lang, XmlDataType dataType) = 0;
129 virtual ASPOSECPP_SHARED_API SharedPtr<XPathExpression> Clone() = 0;
133 virtual ASPOSECPP_SHARED_API void SetContext(SharedPtr<XmlNamespaceManager> nsManager) = 0;
137 virtual ASPOSECPP_SHARED_API void SetContext(SharedPtr<IXmlNamespaceResolver> nsResolver) = 0;
143 static ASPOSECPP_SHARED_API SharedPtr<XPathExpression> Compile(const String& xpath);
151 static ASPOSECPP_SHARED_API SharedPtr<XPathExpression> Compile(const String& xpath, const SharedPtr<IXmlNamespaceResolver>& nsResolver);
152
153protected:
154
158
159};
160
161} // namespace XPath
162} // namespace Xml
163} // namespace System
164
166template<>
167struct EnumMetaInfo<System::Xml::XPath::XmlSortOrder>
168{
169 static const ASPOSECPP_SHARED_API std::array<std::pair<System::Xml::XPath::XmlSortOrder, const char_t*>, 2>& values();
170};
171
172template<>
173struct EnumMetaInfo<System::Xml::XPath::XmlCaseOrder>
174{
175 static const ASPOSECPP_SHARED_API std::array<std::pair<System::Xml::XPath::XmlCaseOrder, const char_t*>, 3>& values();
176};
177
178template<>
179struct EnumMetaInfo<System::Xml::XPath::XmlDataType>
180{
181 static const ASPOSECPP_SHARED_API std::array<std::pair<System::Xml::XPath::XmlDataType, const char_t*>, 2>& values();
182};
183
184template<>
185struct EnumMetaInfo<System::Xml::XPath::XPathResultType>
186{
187 static const ASPOSECPP_SHARED_API std::array<std::pair<System::Xml::XPath::XPathResultType, const char_t*>, 7>& values();
188};
190
191
Class that keeps static members of System.Boolean .Net type.
Definition: boolean.h:44
Interface that compares two objects in greater-equal-less sense. Objects of this class should only be...
Definition: icomparer.h:20
Base class that enables using methods available for System.Object class in C#. All non-trivial classe...
Definition: object.h:62
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: smart_ptr.h:180
String class used across the library. Is a substitute for C# System.String when translating code....
Definition: string.h:122
Provides a typed class that represents a compiled XPath expression.
Definition: xpath_expression.h:86
virtual void SetContext(SharedPtr< IXmlNamespaceResolver > nsResolver)=0
When overridden in a derived class, specifies the IXmlNamespaceResolver object to use for namespace r...
static SharedPtr< XPathExpression > Compile(const String &xpath, const SharedPtr< IXmlNamespaceResolver > &nsResolver)
Compiles the specified XPath expression, with the IXmlNamespaceResolver object specified for namespac...
virtual XPathResultType get_ReturnType()=0
When overridden in a derived class, gets the result type of the XPath expression.
virtual void AddSort(SharedPtr< Object > expr, XmlSortOrder order, XmlCaseOrder caseOrder, String lang, XmlDataType dataType)=0
When overridden in a derived class, sorts the nodes selected by the XPath expression according to the...
virtual void SetContext(SharedPtr< XmlNamespaceManager > nsManager)=0
When overridden in a derived class, specifies the XmlNamespaceManager object to use for namespace res...
virtual SharedPtr< XPathExpression > Clone()=0
When overridden in a derived class, returns a clone of this XPathExpression.
virtual String get_Expression()=0
When overridden in a derived class, gets a string representation of the XPathExpression.
static SharedPtr< XPathExpression > Compile(const String &xpath)
Compiles the XPath expression specified and returns an XPathExpression object representing the XPath ...
virtual void AddSort(SharedPtr< Object > expr, SharedPtr< Collections::Generic::IComparer< SharedPtr< Object > > > comparer)=0
When overridden in a derived class, sorts the nodes selected by the XPath expression according to the...
XPathResultType
Specifies the return type of the XPath expression.
Definition: xpath_expression.h:67
XmlCaseOrder
Specifies the sort order for uppercase and lowercase letters.
Definition: xpath_expression.h:47
@ LowerFirst
Lowercase letters are sorted before uppercase letters.
@ UpperFirst
Uppercase letters are sorted before lowercase letters.
XmlSortOrder
Specifies the sort order.
Definition: xpath_expression.h:36
@ Ascending
Nodes are sorted in ascending order. For example, if the numbers 1,2,3, and 4 are sorted in ascending...
@ Descending
Nodes are sorted in descending order. For example, if the numbers 1,2,3, and 4 are sorted in descendi...
XmlDataType
Specifies the data type used to determine sort order.
Definition: xpath_expression.h:58
@ Xml
Serialize according to the XML 1.0 rules.
Definition: db_command.h:9