Inherits System::Xml::XmlWriter.
Public Types | |
typedef SharedPtr< XmlTextWriter > | Ptr |
An alias for shared pointer to an instance of this class. More... | |
![]() | |
typedef SharedPtr< XmlWriter > | Ptr |
An alias for shared pointer to an instance of this class. More... | |
![]() | |
typedef SmartPtr< Object > | ptr |
Alias for smart pointer type. More... | |
typedef System::Details::SharedMembersType | shared_members_type |
structure to keep list of shared pointers contained in object. More... | |
Public Member Functions | |
ASPOSECPP_SHARED_API | XmlTextWriter (const String &outputFileName, const SharedPtr< System::Text::Encoding > &encoding=SharedPtr< System::Text::Encoding >()) |
ASPOSECPP_SHARED_API | XmlTextWriter (const SharedPtr< System::IO::Stream > &stream, const SharedPtr< System::Text::Encoding > &encoding=SharedPtr< System::Text::Encoding >()) |
ASPOSECPP_SHARED_API | XmlTextWriter (const SharedPtr< System::IO::TextWriter > &text_writer) |
ASPOSECPP_SHARED_API | XmlTextWriter (const SharedPtr< System::Text::StringBuilder > &string_builder) |
ASPOSECPP_SHARED_API | XmlTextWriter (xmlBuffer *buf) |
ASPOSECPP_SHARED_API | XmlTextWriter (xmlOutputBuffer *buf) |
virtual ASPOSECPP_SHARED_API | ~XmlTextWriter () |
Destructor. More... | |
ASPOSECPP_SHARED_API WriteState | get_WriteState () override |
Returns a value indicating the state of the current writer. More... | |
ASPOSECPP_SHARED_API void | Close () override |
Closes the write stream. More... | |
ASPOSECPP_SHARED_API void | Flush () override |
Flushes the content of the buffers to the underlying stream and also flushes the underlying stream. More... | |
ASPOSECPP_SHARED_API void | WriteStartDocument () override |
Writes an XML declaration with version "1.0". More... | |
ASPOSECPP_SHARED_API void | WriteStartDocument (bool standalone) override |
ASPOSECPP_SHARED_API void | WriteStartElement (String localName) override |
ASPOSECPP_SHARED_API void | WriteStartElement (String localName, String ns) override |
ASPOSECPP_SHARED_API void | WriteStartElement (String prefix, String localName, String ns) override |
ASPOSECPP_SHARED_API void | WriteStartAttribute (String localName) override |
ASPOSECPP_SHARED_API void | WriteStartAttribute (String localName, String ns) override |
ASPOSECPP_SHARED_API void | WriteAttributeString (String localName, String value) override |
ASPOSECPP_SHARED_API void | WriteAttributeString (String localName, String ns, String value) override |
ASPOSECPP_SHARED_API void | WriteAttributeString (String prefix, String localName, String ns, String value) override |
ASPOSECPP_SHARED_API void | WriteAttributes (SharedPtr< XmlReader > reader, bool defattr) override |
ASPOSECPP_SHARED_API void | WriteElementString (String localName, String value) override |
ASPOSECPP_SHARED_API void | WriteElementString (String localName, String ns, String value) override |
ASPOSECPP_SHARED_API void | WriteElementString (String prefix, String localName, String ns, String value) override |
ASPOSECPP_SHARED_API void | WriteDocType (String name, String pubid, String sysid, String subset) override |
ASPOSECPP_SHARED_API void | WriteCData (String text) override |
ASPOSECPP_SHARED_API void | WriteComment (String text) override |
ASPOSECPP_SHARED_API void | WriteProcessingInstruction (String name, String text) override |
ASPOSECPP_SHARED_API void | WriteEntityRef (String name) override |
ASPOSECPP_SHARED_API void | WriteString (String text) override |
ASPOSECPP_SHARED_API void | WriteWhitespace (String ws) override |
ASPOSECPP_SHARED_API void | WriteRaw (String text) override |
ASPOSECPP_SHARED_API void | WriteRaw (ArrayPtr< char_t > buffer, int index, int count) override |
ASPOSECPP_SHARED_API void | WriteBase64 (ArrayPtr< uint8_t > buffer, int index, int count) override |
ASPOSECPP_SHARED_API void | WriteBinHex (ArrayPtr< uint8_t > buffer, int index, int count) override |
ASPOSECPP_SHARED_API void | WriteEndAttribute () override |
Closes the previous WriteStartAttribute(System::String) call. More... | |
ASPOSECPP_SHARED_API void | WriteEndElement () override |
ASPOSECPP_SHARED_API void | WriteFullEndElement () override |
Closes an element and pops the corresponding namespace scope. The full form of closing tag is used. More... | |
ASPOSECPP_SHARED_API void | WriteEndDocument () override |
Closes all open elements and attributes and puts the writer in the Start state. More... | |
ASPOSECPP_SHARED_API String | LookupPrefix (String ns) override |
ASPOSECPP_SHARED_API Formatting | get_Formatting () const |
Returns a value that indicates how the output is formatted. More... | |
ASPOSECPP_SHARED_API void | set_Formatting (Formatting value) |
ASPOSECPP_SHARED_API void | set_Namespaces (bool value) |
ASPOSECPP_SHARED_API void | set_Indentation (int value) |
ASPOSECPP_SHARED_API int | get_Indentation () const |
ASPOSECPP_SHARED_API void | set_IndentChar (char_t value) |
ASPOSECPP_SHARED_API char_t | get_IndentChar () const |
Returns a character that should be used for indenting when Formatting is set to Formatting::Indented. More... | |
ASPOSECPP_SHARED_API void | set_QuoteChar (char_t value) |
ASPOSECPP_SHARED_API SharedPtr< System::IO::Stream > | get_BaseStream () const |
Returns the underlying stream object. More... | |
ASPOSECPP_SHARED_API xmlTextWriter * | native () const |
Returns a pointer to the underlying libxml2 xmlTextWriter object. More... | |
![]() | |
virtual void | Dispose () |
Does nothing. More... | |
![]() | |
ASPOSECPP_SHARED_API | Object () |
Creates object. Initializes all internal data structures. More... | |
virtual ASPOSECPP_SHARED_API | ~Object () |
Destroys object. Frees all internal data structures. More... | |
ASPOSECPP_SHARED_API | Object (Object const &x) |
Copy constructor. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses. More... | |
Object & | operator= (Object const &x) |
Assignment operator. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses. More... | |
Object * | SharedRefAdded () |
Increments shared reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More... | |
int | SharedRefRemovedSafe () |
Decrements and returns shared reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More... | |
int | RemovedSharedRefs (int count) |
Decreases shared reference count by specified value. More... | |
Detail::SmartPtrCounter * | WeakRefAdded () |
Increments weak reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More... | |
void | WeakRefRemoved () |
Decrements weak reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More... | |
Detail::SmartPtrCounter * | GetCounter () |
Gets reference counter data structure associated with the object. More... | |
int | SharedCount () const |
Gets current value of shared refernce counter. More... | |
ASPOSECPP_SHARED_API void | Lock () |
Implements C# lock() statement locking. Call directly or use LockContext sentry object. More... | |
ASPOSECPP_SHARED_API void | Unlock () |
Implements C# lock() statement unlocking. Call directly or use LockContext sentry object. More... | |
virtual ASPOSECPP_SHARED_API bool | Equals (ptr obj) |
Compares objects using C# Object.Equals semantics. More... | |
virtual ASPOSECPP_SHARED_API int | GetHashCode () const |
Analog of C# Object.GetHashCode() method. Enables hashing of custom objects. More... | |
virtual ASPOSECPP_SHARED_API String | ToString () ASPOSE_CONST |
Analog of C# Object.ToString() method. Enables converting custom objects to string. More... | |
virtual ASPOSECPP_SHARED_API ptr | MemberwiseClone () const |
Analog of C# Object.MemberwiseClone() method. Enables cloning custom types. More... | |
virtual ASPOSECPP_SHARED_API const TypeInfo & | GetType () const |
Gets actual type of object. Analog of C# System.Object.GetType() call. More... | |
virtual ASPOSECPP_SHARED_API bool | Is (const TypeInfo &targetType) const |
Check if object represents an instance of type described by targetType. Analog of C# 'is' operator. More... | |
virtual ASPOSECPP_SHARED_API void | SetTemplateWeakPtr (unsigned int argument) |
Set n'th template argument a weak pointer (rather than shared). Allows switching pointers in containers to weak mode. More... | |
template<> | |
bool | Equals (float const &objA, float const &objB) |
template<> | |
bool | Equals (double const &objA, double const &objB) |
template<> | |
bool | ReferenceEquals (String const &str, std::nullptr_t) |
template<> | |
bool | ReferenceEquals (String const &str1, String const &str2) |
Protected Attributes | |
xmlTextWriter * | m_writer |
The underlynig libxml2 XML text writer. More... | |
Formatting | m_formatting |
Indicates how the output is formatted. More... | |
int | m_indentation |
char_t | m_indent_char |
A character that should be used for indenting when Formatting is set to Formatting::Indented. More... | |
WriteState | m_state |
Indicates the state of the current writer. More... | |
SharedPtr< XmlWriterSettings > | m_settings |
The current XmlWriter object's settings. More... | |
Additional Inherited Members | |
![]() | |
static ASPOSECPP_SHARED_API XmlWriter::Ptr | Create (const String &outputFileName) |
static ASPOSECPP_SHARED_API XmlWriter::Ptr | Create (const String &outputFileName, const SharedPtr< XmlWriterSettings > &settings) |
static ASPOSECPP_SHARED_API XmlWriter::Ptr | Create (const SharedPtr< System::IO::Stream > &stream, const SharedPtr< XmlWriterSettings > &settings=nullptr) |
static ASPOSECPP_SHARED_API XmlWriter::Ptr | Create (const SharedPtr< System::Text::StringBuilder > &builder, const SharedPtr< XmlWriterSettings > &settings) |
static ASPOSECPP_SHARED_API XmlWriter::Ptr | Create (const SharedPtr< System::IO::TextWriter > &text_writer) |
static ASPOSECPP_SHARED_API XmlWriter::Ptr | Create (const SharedPtr< System::IO::TextWriter > &text_writer, const SharedPtr< XmlWriterSettings > &settings) |
![]() | |
static bool | ReferenceEquals (ptr const &objA, ptr const &objB) |
Compares objects by reference. More... | |
template<typename T > | |
static std::enable_if<!IsSmartPtr< T >::value, bool >::type | ReferenceEquals (T const &objA, T const &objB) |
Compares objects by reference. More... | |
template<typename T > | |
static std::enable_if<!IsSmartPtr< T >::value, bool >::type | ReferenceEquals (T const &objA, std::nullptr_t) |
Reference-compares value type object with nullptr. More... | |
template<typename T1 , typename T2 > | |
static std::enable_if< IsSmartPtr< T1 >::value &&IsSmartPtr< T2 >::value, bool >::type | Equals (T1 const &objA, T2 const &objB) |
Compares reference type objects in C# style. More... | |
template<typename T1 , typename T2 > | |
static std::enable_if<!IsSmartPtr< T1 >::value &&!IsSmartPtr< T2 >::value, bool >::type | Equals (T1 const &objA, T2 const &objB) |
Compares value type objects in C# style. More... | |
static const TypeInfo & | Type () |
Impleemnts C# typeof(System.Object) construct. More... | |
![]() | |
XmlWriter () | |
Constructs a new instance of XmlWriter class. More... | |
Represents a non-cached, forward-only writer way of generating streams or files containing XML data. Objects of this class should only be allocated using System::MakeObject() function. Never create instance of this type on stack or using operator new, as it will result in runtime errors and/or assertion faults. Always wrap this class into System::SmartPtr pointer and use this pointer to pass it to functions as argument.
An alias for shared pointer to an instance of this class.
ASPOSECPP_SHARED_API System::Xml::XmlTextWriter::XmlTextWriter | ( | const String & | outputFileName, |
const SharedPtr< System::Text::Encoding > & | encoding = SharedPtr< System::Text::Encoding >() |
||
) |
Constructs an instance of XmlWriter class and initializes it with the specified output file and encoding.
outputFileName | A filesystem path specifying a file to which the writer will write |
encoding | The encoding to use |
ASPOSECPP_SHARED_API System::Xml::XmlTextWriter::XmlTextWriter | ( | const SharedPtr< System::IO::Stream > & | stream, |
const SharedPtr< System::Text::Encoding > & | encoding = SharedPtr< System::Text::Encoding >() |
||
) |
Constructs an instance of XmlTextWriter class and initializes it with the specified stream.
stream | A stream to which the writer will write |
encoding | The encoding to use |
ASPOSECPP_SHARED_API System::Xml::XmlTextWriter::XmlTextWriter | ( | const SharedPtr< System::IO::TextWriter > & | text_writer | ) |
Constructs an instance of XmlTextWriter class and initializes it with the specified TextWriter.
text_writer | A TextWriter to which the writer will write |
ASPOSECPP_SHARED_API System::Xml::XmlTextWriter::XmlTextWriter | ( | const SharedPtr< System::Text::StringBuilder > & | string_builder | ) |
Constructs an instance of XmlTextWriter class and initializes it with the specified StringBuilder.
string_builder | A StringBuilder to which the writer will write |
ASPOSECPP_SHARED_API System::Xml::XmlTextWriter::XmlTextWriter | ( | xmlBuffer * | buf | ) |
Constructs a new instance of XmlTextWriter and forces it to use the specified xmlBuffer object.
buf | An xmlBuffer object to use |
ASPOSECPP_SHARED_API System::Xml::XmlTextWriter::XmlTextWriter | ( | xmlOutputBuffer * | buf | ) |
Constructs a new instance of XmlTextWriter and forces it to use the specified xmlOutputBuffer object.
buf | An xmlOutputBuffer object to use |
|
virtual |
Destructor.
|
overridevirtual |
Closes the write stream.
Implements System::Xml::XmlWriter.
|
overridevirtual |
Flushes the content of the buffers to the underlying stream and also flushes the underlying stream.
Implements System::Xml::XmlWriter.
ASPOSECPP_SHARED_API SharedPtr<System::IO::Stream> System::Xml::XmlTextWriter::get_BaseStream | ( | ) | const |
Returns the underlying stream object.
ASPOSECPP_SHARED_API Formatting System::Xml::XmlTextWriter::get_Formatting | ( | ) | const |
Returns a value that indicates how the output is formatted.
ASPOSECPP_SHARED_API int System::Xml::XmlTextWriter::get_Indentation | ( | ) | const |
Returns an integer value that indicates how many IndentChars should be writen for each level in the hierarchy when Formatting is set to Formatting::Indented.
ASPOSECPP_SHARED_API char_t System::Xml::XmlTextWriter::get_IndentChar | ( | ) | const |
Returns a character that should be used for indenting when Formatting is set to Formatting::Indented.
|
overridevirtual |
Returns a value indicating the state of the current writer.
Implements System::Xml::XmlWriter.
Gets the closest prefix defined in the current namespace scope for the specified namespace URI.
ns | The namespace URI |
ns
Implements System::Xml::XmlWriter.
ASPOSECPP_SHARED_API xmlTextWriter* System::Xml::XmlTextWriter::native | ( | ) | const |
Returns a pointer to the underlying libxml2 xmlTextWriter object.
ASPOSECPP_SHARED_API void System::Xml::XmlTextWriter::set_Formatting | ( | Formatting | value | ) |
Sets a value that indicates how the output is formatted.
value | The value to set |
ASPOSECPP_SHARED_API void System::Xml::XmlTextWriter::set_Indentation | ( | int | value | ) |
Sets an integer value that indicates how many IndentChars should be writen for each level in the hierarchy when Formatting is set to Formatting::Indented.
value | The value to set |
ASPOSECPP_SHARED_API void System::Xml::XmlTextWriter::set_IndentChar | ( | char_t | value | ) |
Sets a character that should be used for indenting when Formatting is set to Formatting::Indented.
value | The value to set |
ASPOSECPP_SHARED_API void System::Xml::XmlTextWriter::set_Namespaces | ( | bool | value | ) |
Sets a value that indicates whether to do namespace support.
value | The value to set |
ASPOSECPP_SHARED_API void System::Xml::XmlTextWriter::set_QuoteChar | ( | char_t | value | ) |
Sets a character that should be used to quote attribute values.
value | The value to set. |
|
overridevirtual |
Writes out all the attributes found at the current position in the XmlReader.
reader | The XmlReader from which to copy the attributes. |
defattr | true to copy the default attributes from the XmlReader; otherwise, false. |
Implements System::Xml::XmlWriter.
|
overridevirtual |
Writes out an attribute with the specified local name and value.
localName | The attribute's local name |
value | The attribute's value |
Implements System::Xml::XmlWriter.
|
overridevirtual |
Writes out an attribute with the specified local name and value and associates it with the specified namespace.
localName | The attribute's local name |
ns | The namespace to associate the attribute with |
value | The attribute's value |
Implements System::Xml::XmlWriter.
|
overridevirtual |
Writes out an attribute with the specified prefix, local name and value and associates it with the specified namespace.
prefix | The attribute's prefix |
localName | The attribute's local name |
ns | The namespace to associate the attribute with |
value | The attribute's value |
Implements System::Xml::XmlWriter.
|
overridevirtual |
Base64-encodes the specified range of bytes in the specified byte array and writes out the resulting text.
buffer | A byte array |
index | A 0-based index of the element in the array at which the range to encode begins |
count | The number of elements in the range |
Implements System::Xml::XmlWriter.
|
overridevirtual |
Encodes the specified range of bytes in the specifie array as BinHex and writes out the resulting text.
buffer | A byte array |
index | A 0-based index of the element in the array at which the range to encode begins |
count | The number of elements in the range |
Implements System::Xml::XmlWriter.
|
overridevirtual |
|
overridevirtual |
Writes out a comment node.
text | The content of the node |
Implements System::Xml::XmlWriter.
|
overridevirtual |
Writes out a DOCTYPE declaration with the specified name and attributes.
name | The name of DOCTYPE declaration |
pubid | The public identifier of DOCTYPE declaration |
sysid | The system identifier of DOCTYPE declaration |
subset | The subset parameter of DOCTYPE declaration |
Implements System::Xml::XmlWriter.
|
overridevirtual |
Writes out an element with the specified local name and value.
localName | The element's local name |
value | The element's value |
Implements System::Xml::XmlWriter.
|
overridevirtual |
Writes out an element with the specified local name and value and associates it with the specified namespace.
localName | The element's local name |
ns | The namespace to associate the element with |
value | The element's value |
Implements System::Xml::XmlWriter.
|
overridevirtual |
Writes out an element with the specified prefix, local name and value and associates it with the specified namespace.
prefix | The attribute's prefix |
localName | The element's local name |
ns | The namespace to associate the element with |
value | The element's value |
Implements System::Xml::XmlWriter.
|
overridevirtual |
Closes the previous WriteStartAttribute(System::String) call.
Implements System::Xml::XmlWriter.
|
overridevirtual |
Closes all open elements and attributes and puts the writer in the Start state.
Implements System::Xml::XmlWriter.
|
overridevirtual |
Closes an element and pops the corresponding namespace scope. If the element is empty, the short form of the closing tag is used.
Implements System::Xml::XmlWriter.
|
overridevirtual |
Writes out an entity reference as {ampersand}name;.
name | The name of the entity reference. |
Implements System::Xml::XmlWriter.
|
overridevirtual |
Closes an element and pops the corresponding namespace scope. The full form of closing tag is used.
Implements System::Xml::XmlWriter.
|
overridevirtual |
Writes out a processing instruction with the specified name and text.
name | The name of the processing instruction |
text | The text to be added to the processing instruction |
Implements System::Xml::XmlWriter.
|
overridevirtual |
Writes the specified string content without escaping the special characters.
text | The text to write |
Implements System::Xml::XmlWriter.
|
overridevirtual |
Writes the specified range of characters without escaping the special characters.
buffer | The character array |
index | A 0-based index at which the range to write begins |
count | The number of characters in the range |
Implements System::Xml::XmlWriter.
|
overridevirtual |
Writes the start of an attribute with the specified local name.
localName | The attribute's local name |
Implements System::Xml::XmlWriter.
|
overridevirtual |
Writes the start of an attribute with the specified local name and namespace.
localName | The attribute's local name |
ns | The attribute's namespace |
Implements System::Xml::XmlWriter.
|
overridevirtual |
Writes an XML declaration with version "1.0".
Implements System::Xml::XmlWriter.
|
overridevirtual |
Writes an XML declaration with version "1.0" and the 'standalone' attribute with the specified value.
standalone | The value of the 'standalone' attribute in the XML declaration |
Implements System::Xml::XmlWriter.
|
overridevirtual |
Writes out a start tag of an element with the specified local name.
localName | The element's local name |
Implements System::Xml::XmlWriter.
|
overridevirtual |
Writes out a start tag of an element with the specified local name and associates it with the specified namespace.
localName | The element's local name |
ns | The namespace to associate the element with |
Implements System::Xml::XmlWriter.
|
overridevirtual |
Writes out a start tag of an element with the specified local name and prefix and associates it with the specified namespace.
prefix | The element's prefix |
localName | The element's local name |
ns | The namespace to associate the element with |
Implements System::Xml::XmlWriter.
|
overridevirtual |
Writes the specified text content.
text | The text to write |
Implements System::Xml::XmlWriter.
|
overridevirtual |
Writes the specified white spaces.
ws | The string with white space characters to write |
Implements System::Xml::XmlWriter.
|
protected |
Indicates how the output is formatted.
|
protected |
A character that should be used for indenting when Formatting is set to Formatting::Indented.
|
protected |
Indicates how many IndentChars should be writen for each level in the hierarchy when Formatting is set to Formatting::Indented.
|
protected |
The current XmlWriter object's settings.
|
protected |
Indicates the state of the current writer.
|
protected |
The underlynig libxml2 XML text writer.