CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
xml_serializer.h
1
2#pragma once
3#include <xml/xml_writer.h>
4#include <xml/serialization/xml_serializer_namespaces.h>
5#include <xml/xml_serialization_writer.h>
6#include <xml/xml_serialization_reader.h>
7#include <xml/xml_root_attribute.h>
8#include <xml/xml_attribute_overrides.h>
9#include <system/type_info.h>
10#include <system/text/encoding.h>
11#include <system/string.h>
12#include <system/shared_ptr.h>
13#include <system/object.h>
14#include <system/io/text_writer.h>
15#include <system/io/text_reader.h>
16#include <system/io/stream.h>
17#include <system/array.h>
18#include <cstdint>
19#include <xml/xml_reader.h>
20
21namespace System { namespace Xml { namespace Serialization {
22
23class XmlSerializationReader;
24class XmlSerializationWriter;
25
30class ASPOSECPP_SHARED_CLASS XmlSerializer : public System::Object
31{
33 typedef XmlSerializer ThisType;
36
38 typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
40 ASPOSECPP_SHARED_RTTI_INFO_DECL();
41
42public:
44 ASPOSECPP_SHARED_API static const String WsdlNamespace;
46 ASPOSECPP_SHARED_API static const String EncodingNamespace;
48 ASPOSECPP_SHARED_API static const String WsdlTypesNamespace;
49
53 ASPOSECPP_SHARED_API virtual bool CanDeserialize(System::SharedPtr<XmlReader> xmlReader);
77 ASPOSECPP_SHARED_API void Serialize(System::SharedPtr<XmlWriter> xmlWriter, System::SharedPtr<Object> o);
101 String encodingStyle);
108 System::SharedPtr<XmlSerializerNamespaces> namespaces, String encodingStyle);
116 System::SharedPtr<XmlSerializerNamespaces> namespaces, String encodingStyle,
117 String id);
118
119protected:
121 ASPOSECPP_SHARED_API XmlSerializer();
122
131
134
135private:
137 static System::SharedPtr<Text::Encoding> defaultEncoding;
139 bool customSerializer = false;
140};
141
142}}} // namespace System::Xml::Serialization
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
Performs serialization and deserialization of objects into and from XML documents....
Definition: xml_serializer.h:31
System::SharedPtr< Object > Deserialize(System::SharedPtr< IO::TextReader > textReader)
Deserializes XML document into object.
System::SharedPtr< Object > Deserialize(System::SharedPtr< IO::Stream > stream)
Deserializes XML document into object.
void Serialize(System::SharedPtr< IO::Stream > stream, System::SharedPtr< Object > o, System::SharedPtr< XmlSerializerNamespaces > namespaces)
Serializes document into XML.
virtual System::SharedPtr< Object > Deserialize(System::SharedPtr< XmlSerializationReader > reader)
Deeserializes document read from specific reader.
void Serialize(System::SharedPtr< XmlWriter > xmlWriter, System::SharedPtr< Object > o, System::SharedPtr< XmlSerializerNamespaces > namespaces, String encodingStyle, String id)
Serializes document into XML.
System::SharedPtr< Object > Deserialize(System::SharedPtr< XmlReader > xmlReader, String encodingStyle)
Deserializes XML document into object.
static const String WsdlTypesNamespace
WSDL types namespace name.
Definition: xml_serializer.h:48
void Serialize(System::SharedPtr< XmlWriter > xmlWriter, System::SharedPtr< Object > o, System::SharedPtr< XmlSerializerNamespaces > namespaces, String encodingStyle)
Serializes document into XML.
static const String WsdlNamespace
WSDL namespace name.
Definition: xml_serializer.h:44
void Serialize(System::SharedPtr< XmlWriter > xmlWriter, System::SharedPtr< Object > o, System::SharedPtr< XmlSerializerNamespaces > namespaces)
Serializes document into XML.
void Serialize(System::SharedPtr< IO::TextWriter > textWriter, System::SharedPtr< Object > o, System::SharedPtr< XmlSerializerNamespaces > namespaces)
Serializes document into XML.
virtual System::SharedPtr< XmlSerializationReader > CreateReader()
Creates reader object.
static System::SharedPtr< Text::Encoding > get_DefaultEncoding()
Gets encoding used by default.
System::SharedPtr< Object > Deserialize(System::SharedPtr< XmlReader > xmlReader)
Deserializes XML document into object.
static const String EncodingNamespace
Encoding namespace name.
Definition: xml_serializer.h:46
virtual bool CanDeserialize(System::SharedPtr< XmlReader > xmlReader)
Checks if specific reader is in deserializable state.
virtual System::SharedPtr< XmlSerializationWriter > CreateWriter()
Creates writer object.
void Serialize(System::SharedPtr< XmlWriter > xmlWriter, System::SharedPtr< Object > o)
Serializes document into XML.
void Serialize(System::SharedPtr< IO::TextWriter > textWriter, System::SharedPtr< Object > o)
Serializes document into XML.
virtual void Serialize(System::SharedPtr< Object > o, System::SharedPtr< XmlSerializationWriter > writer)
Serializes object.
void Serialize(System::SharedPtr< IO::Stream > stream, System::SharedPtr< Object > o)
Serializes document into XML.
@ Xml
Serialize according to the XML 1.0 rules.
Definition: db_command.h:9