CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
xml_writer_settings.h
1
2
3#pragma once
4
5#include <xml/xml_output_method.h>
6#include <xml/new_line_handling.h>
7#include <xml/namespace_handling.h>
8#include <xml/conformance_level.h>
9#include <system/object_ext.h>
10#include <system/enum_helpers.h>
11#include <system/enum.h>
12
13
15namespace System
16{
17namespace Collections
18{
19namespace Generic
20{
21template <typename> class List;
22} // namespace Generic
23} // namespace Collections
24namespace IO
25{
26class Stream;
27class TextWriter;
28} // namespace IO
29namespace Text
30{
31class Encoding;
32} // namespace Text
33namespace Xml
34{
35class DocumentXmlWriter;
36class HtmlEncodedRawTextWriter;
37class HtmlUtf8RawTextWriter;
38class QueryOutputWriter;
39class QueryOutputWriterV1;
40class XmlAutoDetectWriter;
41class XmlCharCheckingWriter;
42class XmlEncodedRawTextWriter;
43class XmlEncodedRawTextWriterIndent;
44class XmlQualifiedName;
45class XmlUtf8RawTextWriter;
46class XmlUtf8RawTextWriterIndent;
47class XmlWellFormedWriter;
48class XmlWriter;
49namespace Xsl
50{
51namespace Runtime
52{
53class XmlQueryDataReader;
54class XmlQueryDataWriter;
55} // namespace Runtime
56class XslCompiledTransform;
57} // namespace Xsl
58} // namespace Xml
59} // namespace System
61
62namespace System {
63
64namespace Xml {
65
66enum class TriState
67{
68 Unknown = -1,
69 False = 0,
70 True = 1
71};
72
73enum class XmlStandalone
74{
75 Omit = 0,
76 Yes = 1,
77 No = 2
78};
79
84class ASPOSECPP_SHARED_CLASS XmlWriterSettings final : public System::Object
85{
88
89 typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
90 ASPOSECPP_SHARED_RTTI_INFO_DECL();
91
92public:
93
96
97private:
99 friend class HtmlEncodedRawTextWriter;
100 friend class XmlEncodedRawTextWriter;
101 friend class HtmlUtf8RawTextWriter;
102 friend class XmlUtf8RawTextWriter;
103 friend class QueryOutputWriter;
104 friend class QueryOutputWriterV1;
105 friend class XmlWriter;
106 friend class XmlAutoDetectWriter;
107 friend class XmlCharCheckingWriter;
108 friend class XmlEncodedRawTextWriterIndent;
109 friend class XmlUtf8RawTextWriterIndent;
110 friend class XmlWellFormedWriter;
111 friend class DocumentXmlWriter;
112 friend class Xsl::XslCompiledTransform;
114
115public:
116
122 ASPOSECPP_SHARED_API void set_Encoding(const SharedPtr<System::Text::Encoding>& value);
126 ASPOSECPP_SHARED_API bool get_OmitXmlDeclaration();
129 ASPOSECPP_SHARED_API void set_OmitXmlDeclaration(bool value);
135 ASPOSECPP_SHARED_API void set_NewLineHandling(System::Xml::NewLineHandling value);
141 ASPOSECPP_SHARED_API String get_NewLineChars();
145 ASPOSECPP_SHARED_API void set_NewLineChars(const String& value);
149 ASPOSECPP_SHARED_API bool get_Indent();
152 ASPOSECPP_SHARED_API void set_Indent(bool value);
159 ASPOSECPP_SHARED_API String get_IndentChars();
164 ASPOSECPP_SHARED_API void set_IndentChars(const String& value);
167 ASPOSECPP_SHARED_API bool get_NewLineOnAttributes();
170 ASPOSECPP_SHARED_API void set_NewLineOnAttributes(bool value);
174 ASPOSECPP_SHARED_API bool get_CloseOutput();
178 ASPOSECPP_SHARED_API void set_CloseOutput(bool value);
185 ASPOSECPP_SHARED_API void set_ConformanceLevel(System::Xml::ConformanceLevel value);
189 ASPOSECPP_SHARED_API bool get_CheckCharacters();
193 ASPOSECPP_SHARED_API void set_CheckCharacters(bool value);
206 ASPOSECPP_SHARED_API bool get_WriteEndDocumentOnClose();
210 ASPOSECPP_SHARED_API void set_WriteEndDocumentOnClose(bool value);
213 ASPOSECPP_SHARED_API XmlOutputMethod get_OutputMethod();
217 ASPOSECPP_SHARED_API bool get_DoNotEscapeUriAttributes();
220 ASPOSECPP_SHARED_API void set_DoNotEscapeUriAttributes(bool value);
221
223 ASPOSECPP_SHARED_API XmlWriterSettings();
224
226 ASPOSECPP_SHARED_API void Reset();
229 ASPOSECPP_SHARED_API SharedPtr<XmlWriterSettings> Clone();
230
231protected:
232
234 ASPOSECPP_SHARED_API void set_OutputMethod(XmlOutputMethod value);
236 bool get_MergeCDataSections();
237 void set_MergeCDataSections(bool value);
238 String get_MediaType();
239 void set_MediaType(const String& value);
240 String get_DocTypeSystem();
241 void set_DocTypeSystem(const String& value);
242 String get_DocTypePublic();
243 void set_DocTypePublic(const String& value);
244 XmlStandalone get_Standalone();
245 void set_Standalone(XmlStandalone value);
246 bool get_AutoXmlDeclaration();
247 void set_AutoXmlDeclaration(bool value);
248 TriState get_IndentInternal();
249 void set_IndentInternal(TriState value);
250 bool get_IsQuerySpecific();
251 bool get_ReadOnly();
252 void set_ReadOnly(bool value);
253
254 SharedPtr<XmlWriter> CreateWriter(const String& outputFileName);
255 SharedPtr<XmlWriter> CreateWriter(const SharedPtr<IO::Stream>& output);
256 SharedPtr<XmlWriter> CreateWriter(const SharedPtr<IO::TextWriter>& output);
257 SharedPtr<XmlWriter> CreateWriter(const SharedPtr<XmlWriter>& output);
258 void GetObjectData(const SharedPtr<Xsl::Runtime::XmlQueryDataWriter>& writer);
259
261 MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(XmlWriterSettings, CODEPORTING_ARGS(SharedPtr<Xsl::Runtime::XmlQueryDataReader> reader));
263
264 virtual ASPOSECPP_SHARED_API ~XmlWriterSettings();
265
267 #ifdef ASPOSE_GET_SHARED_MEMBERS
268 ASPOSECPP_SHARED_API void GetSharedMembers(System::Object::shared_members_type& result) const override;
269 #endif
271
272private:
273
275 bool _omitXmlDecl;
276 System::Xml::NewLineHandling _newLineHandling;
277 String _newLineChars;
278 TriState _indent;
279 String _indentChars;
280 bool _newLineOnAttributes;
281 bool _closeOutput;
282 System::Xml::NamespaceHandling _namespaceHandling;
283 System::Xml::ConformanceLevel _conformanceLevel;
284 bool _checkCharacters;
285 bool _writeEndDocumentOnClose;
286 XmlOutputMethod _outputMethod;
288 bool _doNotEscapeUriAttributes;
289 bool _mergeCDataSections;
290 String _mediaType;
291 String _docTypeSystem;
292 String _docTypePublic;
293 XmlStandalone _standalone;
294 bool _autoXmlDecl;
295 bool _isReadOnly;
296
297 void CheckReadOnly(const String& propertyName);
298 void Initialize();
299 SharedPtr<XmlWriter> AddConformanceWrapper(const SharedPtr<XmlWriter>& baseWriter);
300
301};
302
303} // namespace Xml
304} // namespace System
305
306template<>
307struct EnumMetaInfo<System::Xml::TriState>
308{
309 static const ASPOSECPP_SHARED_API std::array<std::pair<System::Xml::TriState, const char_t*>, 3>& values();
310};
311template<>
312struct EnumMetaInfo<System::Xml::XmlStandalone>
313{
314 static const ASPOSECPP_SHARED_API std::array<std::pair<System::Xml::XmlStandalone, const char_t*>, 3>& values();
315};
316
317
318
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 writer that provides a fast, non-cached, forward-only way to generate streams or files t...
Definition: xml_writer.h:45
Specifies a set of features to support on the XmlWriter object created by the XmlWriter::Create metho...
Definition: xml_writer_settings.h:85
XmlWriterSettings()
Initializes a new instance of the XmlWriterSettings class.
void set_IndentChars(const String &value)
Sets the character string to use when indenting. This setting is used when the XmlWriterSettings::set...
bool get_CloseOutput()
Returns a value indicating whether the XmlWriter should also close the underlying stream or TextWrite...
String get_NewLineChars()
Returns the character string to use for line breaks.
System::Xml::ConformanceLevel get_ConformanceLevel()
Returns the level of conformance that the XML writer checks the XML output for.
XmlOutputMethod get_OutputMethod()
Returns the method used to serialize the XmlWriter output.
void set_ConformanceLevel(System::Xml::ConformanceLevel value)
Sets the level of conformance that the XML writer checks the XML output for.
void Reset()
Resets the members of the settings class to their default values.
bool get_OmitXmlDeclaration()
Returns a value indicating whether to omit an XML declaration.
bool get_Indent()
Returns a value indicating whether to indent elements.
String get_IndentChars()
Returns the character string to use when indenting. This setting is used when the XmlWriterSettings::...
void set_DoNotEscapeUriAttributes(bool value)
Sets a value that indicates whether the XmlWriter does not escape URI attributes.
SharedPtr< XmlWriterSettings > Clone()
Creates a copy of the XmlWriterSettings instance.
void set_NewLineHandling(System::Xml::NewLineHandling value)
Sets a value indicating whether to normalize line breaks in the output.
void set_CheckCharacters(bool value)
Sets a value that indicates whether the XML writer should check to ensure that all characters in the ...
void set_Encoding(const SharedPtr< System::Text::Encoding > &value)
Sets the type of text encoding to use.
SharedPtr< System::Text::Encoding > get_Encoding()
Returns the type of text encoding to use.
void set_NamespaceHandling(System::Xml::NamespaceHandling value)
Sets a value that indicates whether the XmlWriter should remove duplicate namespace declarations when...
bool get_NewLineOnAttributes()
Returns a value indicating whether to write attributes on a new line.
void set_WriteEndDocumentOnClose(bool value)
Sets a value that indicates whether the XmlWriter will add closing tags to all unclosed element tags ...
System::Xml::NamespaceHandling get_NamespaceHandling()
Returns a value that indicates whether the XmlWriter should remove duplicate namespace declarations w...
bool get_WriteEndDocumentOnClose()
Returns a value that indicates whether the XmlWriter will add closing tags to all unclosed element ta...
System::Xml::NewLineHandling get_NewLineHandling()
Returns a value indicating whether to normalize line breaks in the output.
void set_CloseOutput(bool value)
Sets a value indicating whether the XmlWriter should also close the underlying stream or TextWriter w...
void set_Indent(bool value)
Sets a value indicating whether to indent elements.
void set_NewLineChars(const String &value)
Sets the character string to use for line breaks.
bool get_CheckCharacters()
Returns a value that indicates whether the XML writer should check to ensure that all characters in t...
bool get_DoNotEscapeUriAttributes()
Returns a value that indicates whether the XmlWriter does not escape URI attributes.
void set_NewLineOnAttributes(bool value)
Sets a value indicating whether to write attributes on a new line.
void set_OmitXmlDeclaration(bool value)
Sets a value indicating whether to omit an XML declaration.
Transforms XML data using an XSLT style sheet.
Definition: xsl_compiled_transform.h:49
class ASPOSECPP_SHARED_CLASS List
Definition: ienumerable.h:18
@ Text
Defines color adjustment information for text.
@ Stream
The type that supports reliable, two-way, connection-based byte streams without duplication of data a...
NewLineHandling
Specifies how to handle line breaks.
Definition: new_line_handling.h:15
NamespaceHandling
Specifies whether to remove duplicate namespace declarations in the XmlWriter.
Definition: namespace_handling.h:16
ConformanceLevel
Specifies the amount of input or output checking that XmlReader and XmlWriter objects perform.
Definition: conformance_level.h:15
XmlOutputMethod
Specifies the method used to serialize the XmlWriter output.
Definition: xml_output_method.h:15
@ Xml
Serialize according to the XML 1.0 rules.
TriState
Definition: xml_writer_settings.h:67
XmlStandalone
Definition: xml_writer_settings.h:74
Definition: db_command.h:9