CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
xml_atomic_value.h
1
2
3#pragma once
4
5#include <xml/xpath/xpath_item.h>
6#include <xml/xml_namespace_scope.h>
7#include <xml/ixml_namespace_resolver.h>
8#include <system/string.h>
9#include <system/date_time.h>
10#include <cstdint>
11
12
14namespace System
15{
16namespace Collections
17{
18namespace Generic
19{
20template <typename, typename> class IDictionary;
21} // namespace Generic
22} // namespace Collections
23enum class TypeCode;
24class TypeInfo;
25namespace Xml
26{
27namespace Schema
28{
29class Datatype_List;
30class XmlAnyConverter;
31class XmlBooleanConverter;
32class XmlDateTimeConverter;
33class XmlMiscConverter;
34class XmlNumeric10Converter;
35class XmlNumeric2Converter;
36class XmlSchemaType;
37class XmlStringConverter;
38class XmlUntypedConverter;
39} // namespace Schema
40} // namespace Xml
41} // namespace System
43
44namespace System {
45
46namespace Xml {
47
48namespace Schema {
49
54class ASPOSECPP_SHARED_CLASS XmlAtomicValue final : public System::Xml::XPath::XPathItem
55{
58
59 typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
60 ASPOSECPP_SHARED_RTTI_INFO_DECL();
61
62public:
63
66
67private:
69 friend class Datatype_List;
70 friend class XmlNumeric10Converter;
71 friend class XmlNumeric2Converter;
72 friend class XmlDateTimeConverter;
73 friend class XmlBooleanConverter;
74 friend class XmlMiscConverter;
75 friend class XmlStringConverter;
76 friend class XmlUntypedConverter;
77 friend class XmlAnyConverter;
79
80private:
81
82 class Union : public System::Object
83 {
84 typedef Union ThisType;
86
87 typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
88 RTTI_INFO_DECL();
89
90 public:
91
92 bool boolVal;
93 double dblVal;
94 int64_t i64Val;
95 int32_t i32Val;
96 DateTime dtVal;
97
98 Union();
99
100 protected:
101
102 #ifdef ASPOSE_GET_SHARED_MEMBERS
103 void GetSharedMembers(System::Object::shared_members_type& result) const override;
104 #endif
105
106
107 };
108
109 class NamespacePrefixForQName : public IXmlNamespaceResolver
110 {
111 typedef NamespacePrefixForQName ThisType;
112 typedef IXmlNamespaceResolver BaseType;
113
114 typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
115 RTTI_INFO_DECL();
116
117 public:
118
119 String prefix;
120 String ns;
121
122 NamespacePrefixForQName(const String& prefix, const String& ns);
123
124 String LookupNamespace(const String& prefix) override;
125 String LookupPrefix(const String& namespaceName) override;
127
128 };
129
130
131public:
132
136 ASPOSECPP_SHARED_API bool get_IsNode() override;
139 ASPOSECPP_SHARED_API SharedPtr<XmlSchemaType> get_XmlType() override;
142 ASPOSECPP_SHARED_API TypeInfo get_ValueType() override;
145 ASPOSECPP_SHARED_API SharedPtr<Object> get_TypedValue() override;
150 ASPOSECPP_SHARED_API bool get_ValueAsBoolean() override;
155 ASPOSECPP_SHARED_API DateTime get_ValueAsDateTime() override;
161 ASPOSECPP_SHARED_API double get_ValueAsDouble() override;
167 ASPOSECPP_SHARED_API int32_t get_ValueAsInt() override;
173 ASPOSECPP_SHARED_API int64_t get_ValueAsLong() override;
176 ASPOSECPP_SHARED_API String get_Value() override;
177
180 ASPOSECPP_SHARED_API SharedPtr<XmlAtomicValue> Clone();
189 ASPOSECPP_SHARED_API SharedPtr<Object> ValueAs(const TypeInfo& type, SharedPtr<IXmlNamespaceResolver> nsResolver) override;
192 ASPOSECPP_SHARED_API String ToString() const override;
193
194protected:
195
197 XmlAtomicValue(const SharedPtr<XmlSchemaType>& xmlType, bool value);
198 MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(XmlAtomicValue, CODEPORTING_ARGS(SharedPtr<XmlSchemaType> xmlType, bool value));
199
200 XmlAtomicValue(const SharedPtr<XmlSchemaType>& xmlType, DateTime value);
201 MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(XmlAtomicValue, CODEPORTING_ARGS(SharedPtr<XmlSchemaType> xmlType, DateTime value));
202
203 XmlAtomicValue(const SharedPtr<XmlSchemaType>& xmlType, double value);
204 MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(XmlAtomicValue, CODEPORTING_ARGS(SharedPtr<XmlSchemaType> xmlType, double value));
205
206 XmlAtomicValue(const SharedPtr<XmlSchemaType>& xmlType, int32_t value);
207 MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(XmlAtomicValue, CODEPORTING_ARGS(SharedPtr<XmlSchemaType> xmlType, int32_t value));
208
209 XmlAtomicValue(const SharedPtr<XmlSchemaType>& xmlType, int64_t value);
210 MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(XmlAtomicValue, CODEPORTING_ARGS(SharedPtr<XmlSchemaType> xmlType, int64_t value));
211
212 XmlAtomicValue(const SharedPtr<XmlSchemaType>& xmlType, const String& value);
213 MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(XmlAtomicValue, CODEPORTING_ARGS(SharedPtr<XmlSchemaType> xmlType, String value));
214
215 XmlAtomicValue(const SharedPtr<XmlSchemaType>& xmlType, const String& value, const SharedPtr<IXmlNamespaceResolver>& nsResolver);
216 MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(XmlAtomicValue, CODEPORTING_ARGS(SharedPtr<XmlSchemaType> xmlType, String value, SharedPtr<IXmlNamespaceResolver> nsResolver));
217
218 XmlAtomicValue(const SharedPtr<XmlSchemaType>& xmlType, const SharedPtr<Object>& value);
219 MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(XmlAtomicValue, CODEPORTING_ARGS(SharedPtr<XmlSchemaType> xmlType, SharedPtr<Object> value));
220
221 XmlAtomicValue(const SharedPtr<XmlSchemaType>& xmlType, const SharedPtr<Object>& value, const SharedPtr<IXmlNamespaceResolver>& nsResolver);
222 MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(XmlAtomicValue, CODEPORTING_ARGS(SharedPtr<XmlSchemaType> xmlType, SharedPtr<Object> value, SharedPtr<IXmlNamespaceResolver> nsResolver));
224
225 virtual ASPOSECPP_SHARED_API ~XmlAtomicValue();
226
228 #ifdef ASPOSE_GET_SHARED_MEMBERS
229 ASPOSECPP_SHARED_API void GetSharedMembers(System::Object::shared_members_type& result) const override;
230 #endif
232
233private:
234
236 SharedPtr<Object> _objVal;
237 TypeCode _clrType;
238 XmlAtomicValue::Union _unionVal;
240
241 String ToString_NonConst();
242 String GetPrefixFromQName(const String& value);
243
244};
245
246} // namespace Schema
247} // namespace Xml
248} // namespace System
249
250
Represents a specific date and time value on the time continuum. This type should be allocated on sta...
Definition: date_time.h:50
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
Represents a particular type and provides information about it.
Definition: type_info.h:109
Provides read-only access to a set of prefix and namespace mappings.
Definition: ixml_namespace_resolver.h:29
Represents the typed value of a validated XML element or attribute. The XmlAtomicValue class cannot b...
Definition: xml_atomic_value.h:55
bool get_ValueAsBoolean() override
Returns the validated XML element or attribute's value as a Boolean.
SharedPtr< Object > ValueAs(const TypeInfo &type, SharedPtr< IXmlNamespaceResolver > nsResolver) override
Returns the validated XML element or attribute's value as the type specified using the IXmlNamespaceR...
double get_ValueAsDouble() override
Returns the validated XML element or attribute's value as a Double.
String get_Value() override
Returns the String value of the validated XML element or attribute.
String ToString() const override
Returns the String value of the validated XML element or attribute.
TypeInfo get_ValueType() override
Returns the type of the validated XML element or attribute.
SharedPtr< Object > get_TypedValue() override
Returns the current validated XML element or attribute as a boxed object of the most appropriate type...
int32_t get_ValueAsInt() override
Returns the validated XML element or attribute's value as an Int32.
int64_t get_ValueAsLong() override
Returns the validated XML element or attribute's value as an Int64.
SharedPtr< XmlSchemaType > get_XmlType() override
Returns the XmlSchemaType for the validated XML element or attribute.
bool get_IsNode() override
Returns a value indicating whether the validated XML element or attribute is an XPath node or an atom...
DateTime get_ValueAsDateTime() override
Returns the validated XML element or attribute's value as a DateTime.
SharedPtr< XmlAtomicValue > Clone()
Returns a copy of this XmlAtomicValue object.
Represents an item in the XQuery 1.0 and XPath 2.0 Data Model.
Definition: xpath_item.h:34
@ TypeInfo
Specifies that the member is a type.
@ Schema
Validate according to XML Schema definition language (XSD) schemas, including inline XML Schemas....
@ Xml
Serialize according to the XML 1.0 rules.
XmlNamespaceScope
Defines the namespace scope.
Definition: xml_namespace_scope.h:15
Definition: db_command.h:9
TypeCode
Represents the type of an object.
Definition: type_code.h:19