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 #ifdef __DBG_FOR_EACH_MEMBER
107 public:
110 ASPOSECPP_SHARED_API void DBG_for_each_member(DBG::for_each_member_visitor& visitor) const override;
113 const char* DBG_class_name() const override { return "Union"; }
114 #endif
115
116
117 };
118
119 class NamespacePrefixForQName : public IXmlNamespaceResolver
120 {
121 typedef NamespacePrefixForQName ThisType;
122 typedef IXmlNamespaceResolver BaseType;
123
124 typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
125 RTTI_INFO_DECL();
126
127 public:
128
129 String prefix;
130 String ns;
131
132 NamespacePrefixForQName(const String& prefix, const String& ns);
133
134 String LookupNamespace(const String& prefix) override;
135 String LookupPrefix(const String& namespaceName) override;
137
138 };
139
140
141public:
142
146 ASPOSECPP_SHARED_API bool get_IsNode() override;
149 ASPOSECPP_SHARED_API SharedPtr<XmlSchemaType> get_XmlType() override;
152 ASPOSECPP_SHARED_API TypeInfo get_ValueType() override;
155 ASPOSECPP_SHARED_API SharedPtr<Object> get_TypedValue() override;
160 ASPOSECPP_SHARED_API bool get_ValueAsBoolean() override;
165 ASPOSECPP_SHARED_API DateTime get_ValueAsDateTime() override;
171 ASPOSECPP_SHARED_API double get_ValueAsDouble() override;
177 ASPOSECPP_SHARED_API int32_t get_ValueAsInt() override;
183 ASPOSECPP_SHARED_API int64_t get_ValueAsLong() override;
186 ASPOSECPP_SHARED_API String get_Value() override;
187
190 ASPOSECPP_SHARED_API SharedPtr<XmlAtomicValue> Clone();
199 ASPOSECPP_SHARED_API SharedPtr<Object> ValueAs(const TypeInfo& type, SharedPtr<IXmlNamespaceResolver> nsResolver) override;
202 ASPOSECPP_SHARED_API String ToString() const override;
203
204protected:
205
207 XmlAtomicValue(const SharedPtr<XmlSchemaType>& xmlType, bool value);
208 MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(XmlAtomicValue, CODEPORTING_ARGS(SharedPtr<XmlSchemaType> xmlType, bool value));
209
210 XmlAtomicValue(const SharedPtr<XmlSchemaType>& xmlType, DateTime value);
211 MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(XmlAtomicValue, CODEPORTING_ARGS(SharedPtr<XmlSchemaType> xmlType, DateTime value));
212
213 XmlAtomicValue(const SharedPtr<XmlSchemaType>& xmlType, double value);
214 MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(XmlAtomicValue, CODEPORTING_ARGS(SharedPtr<XmlSchemaType> xmlType, double value));
215
216 XmlAtomicValue(const SharedPtr<XmlSchemaType>& xmlType, int32_t value);
217 MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(XmlAtomicValue, CODEPORTING_ARGS(SharedPtr<XmlSchemaType> xmlType, int32_t value));
218
219 XmlAtomicValue(const SharedPtr<XmlSchemaType>& xmlType, int64_t value);
220 MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(XmlAtomicValue, CODEPORTING_ARGS(SharedPtr<XmlSchemaType> xmlType, int64_t value));
221
222 XmlAtomicValue(const SharedPtr<XmlSchemaType>& xmlType, const String& value);
223 MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(XmlAtomicValue, CODEPORTING_ARGS(SharedPtr<XmlSchemaType> xmlType, String value));
224
225 XmlAtomicValue(const SharedPtr<XmlSchemaType>& xmlType, const String& value, const SharedPtr<IXmlNamespaceResolver>& nsResolver);
226 MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(XmlAtomicValue, CODEPORTING_ARGS(SharedPtr<XmlSchemaType> xmlType, String value, SharedPtr<IXmlNamespaceResolver> nsResolver));
227
228 XmlAtomicValue(const SharedPtr<XmlSchemaType>& xmlType, const SharedPtr<Object>& value);
229 MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(XmlAtomicValue, CODEPORTING_ARGS(SharedPtr<XmlSchemaType> xmlType, SharedPtr<Object> value));
230
231 XmlAtomicValue(const SharedPtr<XmlSchemaType>& xmlType, const SharedPtr<Object>& value, const SharedPtr<IXmlNamespaceResolver>& nsResolver);
232 MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(XmlAtomicValue, CODEPORTING_ARGS(SharedPtr<XmlSchemaType> xmlType, SharedPtr<Object> value, SharedPtr<IXmlNamespaceResolver> nsResolver));
234
235 virtual ASPOSECPP_SHARED_API ~XmlAtomicValue();
236
238 #ifdef ASPOSE_GET_SHARED_MEMBERS
239 ASPOSECPP_SHARED_API void GetSharedMembers(System::Object::shared_members_type& result) const override;
240 #endif
241
242 #ifdef __DBG_FOR_EACH_MEMBER
243public:
246 ASPOSECPP_SHARED_API void DBG_for_each_member(DBG::for_each_member_visitor& visitor) const override;
249 const char* DBG_class_name() const override { return "XmlAtomicValue"; }
250#endif
252
253private:
254
256 SharedPtr<Object> _objVal;
257 TypeCode _clrType;
258 XmlAtomicValue::Union _unionVal;
260
261 String ToString_NonConst();
262 String GetPrefixFromQName(const String& value);
263
264};
265
266} // namespace Schema
267} // namespace Xml
268} // namespace System
269
270
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