5#include <xml/xml_writer.h>
6#include <xml/xml_space.h>
7#include <xml/xml_char_type.h>
8#include <xml/write_state.h>
9#include <xml/formatting.h>
10#include <system/array.h>
21template <
typename,
typename>
class Dictionary;
36class XmlTextWriterBase64Encoder;
56 typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
57 ASPOSECPP_SHARED_RTTI_INFO_DECL();
65 using XmlWriter::XmlWriter::WriteStartElement;
68 using XmlWriter::XmlWriter::WriteStartAttribute;
72 enum class NamespaceState
75 NotDeclaredButInScope,
76 DeclaredButNotWrittenOut,
80 enum class SpecialAttr
125 typedef TagInfo ThisType;
128 typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
137 XmlTextWriter::NamespaceState defaultNsState;
144 void Init(int32_t nsTop);
151 #ifdef ASPOSE_GET_SHARED_MEMBERS
152 void GetSharedMembers(System::Object::shared_members_type& result)
const override;
163 typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
174 void Set(
const String& prefix,
const String& ns,
bool declared);
390 ASPOSECPP_SHARED_API
void Close()
override;
392 ASPOSECPP_SHARED_API
void Flush()
override;
419 MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(
XmlTextWriter, CODEPORTING_ARGS());
425 #ifdef ASPOSE_GET_SHARED_MEMBERS
426 ASPOSECPP_SHARED_API
void GetSharedMembers(System::Object::shared_members_type& result)
const override;
437 int32_t _indentation;
438 char16_t _indentChar;
442 XmlTextWriter::State _currentState;
443 XmlTextWriter::Token _lastToken;
446 char16_t _curQuoteChar;
448 XmlTextWriter::SpecialAttr _specialAttr;
454 bool _useNsHashtable;
456 static const int32_t NamespaceStackInitialSize;
457 static const int32_t MaxNamespacesWalkCount;
465 void StartDocument(int32_t standalone);
466 void AutoComplete(XmlTextWriter::Token token);
467 void AutoCompleteAll();
468 void InternalWriteEndElement(
bool longFormat);
469 void WriteEndStartTag(
bool empty);
470 void WriteEndAttributeQuote();
471 void Indent(
bool beforeEndElement);
472 void PushNamespace(
const String& prefix,
const String& ns,
bool declared);
473 void AddNamespace(
const String& prefix,
const String& ns,
bool declared);
474 void AddToNamespaceHashtable(int32_t namespaceIndex);
475 void PopNamespaces(int32_t indexFrom, int32_t indexTo);
477 void InternalWriteProcessingInstruction(
const String& name,
const String& text);
478 int32_t LookupNamespace(
const String& prefix);
479 int32_t LookupNamespaceInCurrentScope(
const String& prefix);
481 void InternalWriteName(
const String& name,
bool isNCName);
482 void ValidateName(
const String& name,
bool isNCName);
483 void HandleSpecialAttribute();
484 void VerifyPrefixXml(
const String& prefix,
const String& ns);
486 void FlushEncoders();
488 static struct __StaticConstructor__ { __StaticConstructor__(); } s_constructor__;
A base class for custom attributes. Objects of this class should only be allocated using System::Make...
Definition: attribute.h:16
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
For internal purposes. Do not use this class directly.
Definition: xml_char_type.h:61
Represents a writer that provides a fast, non-cached, forward-only way of generating streams or files...
Definition: xml_text_writer.h:52
void WriteName(const String &name) override
Writes out the specified name, ensuring it is a valid name according to the W3C XML 1....
System::Xml::WriteState get_WriteState() override
Returns the state of the writer.
void WriteStartDocument() override
Writes the XML declaration with the version "1.0".
void WriteWhitespace(String ws) override
Writes out the given white space.
void Close() override
Closes this stream and the underlying stream.
bool get_Namespaces()
Returns a value indicating whether to do namespace support.
System::Xml::Formatting get_Formatting()
Indicates how the output is formatted.
void WriteComment(String text) override
Writes out a comment containing the specified text.
void WriteQualifiedName(const String &localName, const String &ns) override
Writes out the namespace-qualified name. This method looks up the prefix that is in scope for the giv...
void WriteChars(ArrayPtr< char16_t > buffer, int32_t index, int32_t count) override
Writes text one buffer at a time.
void set_Indentation(int32_t value)
Sets how many IndentChars to write for each level in the hierarchy when XmlTextWriter::set_Formatting...
void WriteCData(String text) override
Writes out a ... block containing the specified text.
void WriteStartElement(const String &prefix, const String &localName, const String &ns) override
Writes the specified start tag and associates it with the given namespace and prefix.
void WriteString(const String &text) override
Writes the given text content.
void WriteRaw(const String &data) override
Writes raw markup manually from a string.
void WriteSurrogateCharEntity(char16_t lowChar, char16_t highChar) override
Generates and writes the surrogate character entity for the surrogate character pair.
void WriteNmToken(const String &name) override
Writes out the specified name, ensuring it is a valid NmToken according to the W3C XML 1....
String LookupPrefix(String ns) override
Returns the closest prefix defined in the current namespace scope for the namespace URI.
void WriteBinHex(ArrayPtr< uint8_t > buffer, int32_t index, int32_t count) override
Encodes the specified binary bytes as binhex and writes out the resulting text.
void WriteFullEndElement() override
Closes one element and pops the corresponding namespace scope.
void set_QuoteChar(char16_t value)
Sets which character to use to quote attribute values.
void WriteDocType(const String &name, const String &pubid, const String &sysid, const String &subset) override
Writes the DOCTYPE declaration with the specified name and optional attributes.
String get_XmlLang() override
Returns the current xml:lang scope.
System::Xml::XmlSpace get_XmlSpace() override
Returns an XmlSpace representing the current xml:space scope.
void WriteStartDocument(bool standalone) override
Writes the XML declaration with the version "1.0" and the standalone attribute.
void WriteProcessingInstruction(String name, String text) override
Writes out a processing instruction with a space between the name and text as follows: <?...
void set_Formatting(System::Xml::Formatting value)
Indicates how the output is formatted.
void WriteEndElement() override
Closes one element and pops the corresponding namespace scope.
XmlTextWriter(const String &filename, const SharedPtr< Text::Encoding > &encoding)
Creates an instance of the XmlTextWriter class using the specified file.
int32_t get_Indentation()
Returns how many IndentChars to write for each level in the hierarchy when XmlTextWriter::set_Formatt...
void WriteCharEntity(char16_t ch) override
Forces the generation of a character entity for the specified Unicode character value.
char16_t get_QuoteChar()
Returns which character to use to quote attribute values.
void WriteEndDocument() override
Closes any open elements or attributes and puts the writer back in the Start state.
char16_t get_IndentChar()
Returns which character to use for indenting when XmlTextWriter::set_Formatting is set to Formatting:...
void WriteRaw(ArrayPtr< char16_t > buffer, int32_t index, int32_t count) override
Writes raw markup manually from a character buffer.
XmlTextWriter(const SharedPtr< IO::Stream > &w, const SharedPtr< Text::Encoding > &encoding)
Creates an instance of the XmlTextWriter class using the specified stream and encoding.
void WriteEntityRef(const String &name) override
Writes out an entity reference as &name;.
SharedPtr< IO::Stream > get_BaseStream()
Returns the underlying stream object.
void WriteStartAttribute(const String &prefix, const String &localName, const String &ns) override
Writes the start of an attribute.
void WriteBase64(ArrayPtr< uint8_t > buffer, int32_t index, int32_t count) override
Encodes the specified binary bytes as base64 and writes out the resulting text.
void set_Namespaces(bool value)
Sets a value indicating whether to do namespace support.
void set_IndentChar(char16_t value)
Sets which character to use for indenting when XmlTextWriter::set_Formatting is set to Formatting::In...
void WriteEndAttribute() override
Closes the previous XmlTextWriter::WriteStartAttribute call.
void Flush() override
Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream.
XmlTextWriter(const SharedPtr< IO::TextWriter > &w)
Creates an instance of the XmlTextWriter class using the specified TextWriter.
Represents a writer that provides a fast, non-cached, forward-only way to generate streams or files t...
Definition: xml_writer.h:45
@ Text
Defines color adjustment information for text.
@ Stream
The type that supports reliable, two-way, connection-based byte streams without duplication of data a...
@ Namespace
This value is used for internal purposes and is not intended to be used directly from your code.
XmlSpace
Specifies the current xml:space scope.
Definition: xml_space.h:15
@ Xml
Serialize according to the XML 1.0 rules.
WriteState
Specifies the state of the XmlWriter.
Definition: write_state.h:15
Formatting
Specifies formatting options for the XmlTextWriter.
Definition: formatting.h:15
Definition: db_command.h:9