CodePorting.Translator.Cs2Cpp.Framework

Represents a writer that provides a fast, non-cached, forward-only way to generate streams or files that contain XML data. More...

#include <xml_writer.h>

Inherits System::IDisposable.

Inherited by System::Xml::XmlTextWriter.

Public Types

using Ptr = SharedPtr< XmlWriter >
 An alias for shared pointer to an instance of this class. More...
 
- Public Types inherited from System::Object
typedef SmartPtr< Objectptr
 Alias for smart pointer type. More...
 

Public Member Functions

virtual SharedPtr< XmlWriterSettingsget_Settings ()
 Returns the XmlWriterSettings object used to create this XmlWriter instance. More...
 
virtual System::Xml::WriteState get_WriteState ()=0
 When overridden in a derived class, gets the state of the writer. More...
 
virtual System::Xml::XmlSpace get_XmlSpace ()
 When overridden in a derived class, gets an XmlSpace representing the current xml:space scope. More...
 
virtual String get_XmlLang ()
 When overridden in a derived class, gets the current xml:lang scope. More...
 
virtual void WriteStartDocument ()=0
 When overridden in a derived class, writes the XML declaration with the version "1.0". More...
 
virtual void WriteStartDocument (bool standalone)=0
 When overridden in a derived class, writes the XML declaration with the version "1.0" and the standalone attribute. More...
 
virtual void WriteEndDocument ()=0
 When overridden in a derived class, closes any open elements or attributes and puts the writer back in the Start state. More...
 
virtual void WriteDocType (const String &name, const String &pubid, const String &sysid, const String &subset)=0
 When overridden in a derived class, writes the DOCTYPE declaration with the specified name and optional attributes. More...
 
void WriteStartElement (const String &localName, const String &ns)
 When overridden in a derived class, writes the specified start tag and associates it with the given namespace. More...
 
virtual void WriteStartElement (const String &prefix, const String &localName, const String &ns)=0
 When overridden in a derived class, writes the specified start tag and associates it with the given namespace and prefix. More...
 
void WriteStartElement (const String &localName)
 When overridden in a derived class, writes out a start tag with the specified local name. More...
 
virtual void WriteEndElement ()=0
 When overridden in a derived class, closes one element and pops the corresponding namespace scope. More...
 
virtual void WriteFullEndElement ()=0
 When overridden in a derived class, closes one element and pops the corresponding namespace scope. More...
 
void WriteAttributeString (const String &localName, const String &ns, const String &value)
 When overridden in a derived class, writes an attribute with the specified local name, namespace URI, and value. More...
 
void WriteAttributeString (const String &localName, const String &value)
 When overridden in a derived class, writes out the attribute with the specified local name and value. More...
 
void WriteAttributeString (const String &prefix, const String &localName, const String &ns, const String &value)
 When overridden in a derived class, writes out the attribute with the specified prefix, local name, namespace URI, and value. More...
 
void WriteStartAttribute (const String &localName, const String &ns)
 Writes the start of an attribute with the specified local name and namespace URI. More...
 
virtual void WriteStartAttribute (const String &prefix, const String &localName, const String &ns)=0
 When overridden in a derived class, writes the start of an attribute with the specified prefix, local name, and namespace URI. More...
 
void WriteStartAttribute (const String &localName)
 Writes the start of an attribute with the specified local name. More...
 
virtual void WriteEndAttribute ()=0
 When overridden in a derived class, closes the previous XmlWriter::WriteStartAttribute(String,String) call. More...
 
virtual void WriteCData (String text)=0
 When overridden in a derived class, writes out a ... block containing the specified text. More...
 
virtual void WriteComment (String text)=0
 When overridden in a derived class, writes out a comment containing the specified text. More...
 
virtual void WriteProcessingInstruction (String name, String text)=0
 When overridden in a derived class, writes out a processing instruction with a space between the name and text as follows: <?name text?>. More...
 
virtual void WriteEntityRef (const String &name)=0
 When overridden in a derived class, writes out an entity reference as &name;. More...
 
virtual void WriteCharEntity (char16_t ch)=0
 When overridden in a derived class, forces the generation of a character entity for the specified Unicode character value. More...
 
virtual void WriteWhitespace (String ws)=0
 When overridden in a derived class, writes out the given white space. More...
 
virtual void WriteString (const String &text)=0
 When overridden in a derived class, writes the given text content. More...
 
virtual void WriteSurrogateCharEntity (char16_t lowChar, char16_t highChar)=0
 When overridden in a derived class, generates and writes the surrogate character entity for the surrogate character pair. More...
 
virtual void WriteChars (ArrayPtr< char16_t > buffer, int32_t index, int32_t count)=0
 When overridden in a derived class, writes text one buffer at a time. More...
 
virtual void WriteRaw (ArrayPtr< char16_t > buffer, int32_t index, int32_t count)=0
 When overridden in a derived class, writes raw markup manually from a character buffer. More...
 
virtual void WriteRaw (const String &data)=0
 When overridden in a derived class, writes raw markup manually from a string. More...
 
virtual void WriteBase64 (ArrayPtr< uint8_t > buffer, int32_t index, int32_t count)=0
 When overridden in a derived class, encodes the specified binary bytes as Base64 and writes out the resulting text. More...
 
virtual void WriteBinHex (ArrayPtr< uint8_t > buffer, int32_t index, int32_t count)
 When overridden in a derived class, encodes the specified binary bytes as BinHex and writes out the resulting text. More...
 
virtual void Close ()
 When overridden in a derived class, closes this stream and the underlying stream. More...
 
virtual void Flush ()=0
 When overridden in a derived class, flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. More...
 
virtual String LookupPrefix (String ns)=0
 When overridden in a derived class, returns the closest prefix defined in the current namespace scope for the namespace URI. More...
 
virtual void WriteNmToken (const String &name)
 When overridden in a derived class, writes out the specified name, ensuring it is a valid NmToken according to the W3C XML 1.0 recommendation (https://www.w3.org/TR/1998/REC-xml-19980210#NT-Name). More...
 
virtual void WriteName (const String &name)
 When overridden in a derived class, writes out the specified name, ensuring it is a valid name according to the W3C XML 1.0 recommendation (https://www.w3.org/TR/1998/REC-xml-19980210#NT-Name). More...
 
virtual void WriteQualifiedName (const String &localName, const String &ns)
 When overridden in a derived class, writes out the namespace-qualified name. This method looks up the prefix that is in scope for the given namespace. More...
 
virtual void WriteValue (SharedPtr< Object > value)
 Writes the object value. More...
 
virtual void WriteValue (const String &value)
 Writes a String value. More...
 
virtual void WriteValue (bool value)
 Writes a Boolean value. More...
 
virtual void WriteValue (DateTime value)
 Writes a DateTime value. More...
 
virtual void WriteValue (DateTimeOffset value)
 Writes a DateTimeOffset value. More...
 
virtual void WriteValue (double value)
 Writes a Double value. More...
 
virtual void WriteValue (float value)
 Writes a single-precision floating-point number. More...
 
virtual void WriteValue (Decimal value)
 Writes a Decimal value. More...
 
virtual void WriteValue (int32_t value)
 Writes a Int32 value. More...
 
virtual void WriteValue (int64_t value)
 Writes a Int64 value. More...
 
virtual void WriteAttributes (SharedPtr< XmlReader > reader, bool defattr)
 When overridden in a derived class, writes out all the attributes found at the current position in the XmlReader. More...
 
virtual void WriteNode (SharedPtr< XmlReader > reader, bool defattr)
 When overridden in a derived class, copies everything from the reader to the writer and moves the reader to the start of the next sibling. More...
 
virtual void WriteNode (SharedPtr< XPath::XPathNavigator > navigator, bool defattr)
 Copies everything from the XPathNavigator object to the writer. The position of the XPathNavigator remains unchanged. More...
 
void WriteElementString (const String &localName, const String &value)
 Writes an element with the specified local name and value. More...
 
void WriteElementString (const String &localName, const String &ns, const String &value)
 Writes an element with the specified local name, namespace URI, and value. More...
 
void WriteElementString (const String &prefix, const String &localName, const String &ns, const String &value)
 Writes an element with the specified prefix, local name, namespace URI, and value. More...
 
void Dispose () override
 Releases all resources used by the current instance of the XmlWriter class. More...
 
virtual void Dispose ()
 Does nothing. More...
 
- Public Member Functions inherited from System::Object
 Object ()
 Creates object. Initializes all internal data structures. More...
 
virtual ~Object ()
 Destroys object. Frees all internal data structures. More...
 
 Object (Object const &x)
 Copy constructor. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses. More...
 
Objectoperator= (Object const &x)
 Assignment operator. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses. More...
 
ObjectSharedRefAdded ()
 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 reference counter. More...
 
void Lock ()
 Implements C# lock() statement locking. Call directly or use LockContext sentry object. More...
 
void Unlock ()
 Implements C# lock() statement unlocking. Call directly or use LockContext sentry object. More...
 
virtual bool Equals (ptr obj)
 Compares objects using C# Object.Equals semantics. More...
 
virtual int32_t GetHashCode () const
 Analog of C# Object.GetHashCode() method. Enables hashing of custom objects. More...
 
virtual String ToString () const
 Analog of C# Object.ToString() method. Enables converting custom objects to string. More...
 
virtual ptr MemberwiseClone () const
 Analog of C# Object.MemberwiseClone() method. Enables cloning custom types. More...
 
virtual const TypeInfoGetType () const
 Gets actual type of object. Analog of C# System.Object.GetType() call. More...
 
virtual bool Is (const TypeInfo &targetType) const
 Check if object represents an instance of type described by targetType. Analog of C# 'is' operator. More...
 
virtual void SetTemplateWeakPtr (uint32_t argument)
 Set n'th template argument a weak pointer (rather than shared). Allows switching pointers in containers to weak mode. More...
 
virtual bool FastCast (const Details::FastRttiBase &helper, void **out_ptr) const
 For internal purposes only. More...
 
template<>
bool ReferenceEquals (String const &str, std::nullptr_t)
 Specialization of Object::ReferenceEquals for case of string and nullptr. More...
 
template<>
bool ReferenceEquals (String const &str1, String const &str2)
 Specialization of Object::ReferenceEquals for case of strings. More...
 

Static Public Member Functions

static SharedPtr< XmlWriterCreate (const String &outputFileName)
 Creates a new XmlWriter instance using the specified filename. More...
 
static SharedPtr< XmlWriterCreate (const String &outputFileName, SharedPtr< XmlWriterSettings > settings)
 Creates a new XmlWriter instance using the filename and XmlWriterSettings object. More...
 
static SharedPtr< XmlWriterCreate (const SharedPtr< IO::Stream > &output)
 Creates a new XmlWriter instance using the specified stream. More...
 
static SharedPtr< XmlWriterCreate (const SharedPtr< IO::Stream > &output, SharedPtr< XmlWriterSettings > settings)
 Creates a new XmlWriter instance using the stream and XmlWriterSettings object. More...
 
static SharedPtr< XmlWriterCreate (const SharedPtr< IO::TextWriter > &output)
 Creates a new XmlWriter instance using the specified TextWriter. More...
 
static SharedPtr< XmlWriterCreate (const SharedPtr< IO::TextWriter > &output, SharedPtr< XmlWriterSettings > settings)
 Creates a new XmlWriter instance using the TextWriter and XmlWriterSettings objects. More...
 
static SharedPtr< XmlWriterCreate (const SharedPtr< Text::StringBuilder > &output)
 Creates a new XmlWriter instance using the specified Text::StringBuilder. More...
 
static SharedPtr< XmlWriterCreate (const SharedPtr< Text::StringBuilder > &output, SharedPtr< XmlWriterSettings > settings)
 Creates a new XmlWriter instance using the Text::StringBuilder and XmlWriterSettings objects. More...
 
static SharedPtr< XmlWriterCreate (const SharedPtr< XmlWriter > &output)
 Creates a new XmlWriter instance using the specified XmlWriter object. More...
 
static SharedPtr< XmlWriterCreate (const SharedPtr< XmlWriter > &output, SharedPtr< XmlWriterSettings > settings)
 Creates a new XmlWriter instance using the specified XmlWriter and XmlWriterSettings objects. More...
 
- Static Public Member Functions inherited from System::Object
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 TypeInfoType ()
 Implements C# typeof(System.Object) construct. More...
 
template<>
bool Equals (float const &objA, float const &objB)
 Emulates C#-style floating point comparison where two NaNs are considered equal even though according to IEC 60559:1989 NaN is not equal to any value, including NaN. More...
 
template<>
bool Equals (double const &objA, double const &objB)
 Emulates C#-style floating point comparison where two NaNs are considered equal even though according to IEC 60559:1989 NaN is not equal to any value, including NaN. More...
 

Protected Member Functions

virtual void Dispose (bool disposing)
 Optionally releases all resources used by the current instance of the XmlWriter class. More...
 
virtual ~XmlWriter ()
 

Detailed Description

Represents a writer that provides a fast, non-cached, forward-only way to generate streams or files that contain XML data.

Member Typedef Documentation

◆ Ptr

An alias for shared pointer to an instance of this class.

Constructor & Destructor Documentation

◆ ~XmlWriter()

virtual System::Xml::XmlWriter::~XmlWriter ( )
protectedvirtual

Member Function Documentation

◆ Close()

virtual void System::Xml::XmlWriter::Close ( )
virtual

When overridden in a derived class, closes this stream and the underlying stream.

Exceptions
InvalidOperationExceptionA call is made to write more output after Close has been called or the result of this call is an invalid XML document.

Reimplemented in System::Xml::XmlTextWriter.

◆ Create() [1/10]

static SharedPtr< XmlWriter > System::Xml::XmlWriter::Create ( const SharedPtr< IO::Stream > &  output)
static

Creates a new XmlWriter instance using the specified stream.

Parameters
outputThe stream to which you want to write. The XmlWriter writes XML 1.0 text syntax and appends it to the specified stream.
Returns
An XmlWriter object.
Exceptions
ArgumentNullExceptionThe stream value is nullptr.

◆ Create() [2/10]

static SharedPtr< XmlWriter > System::Xml::XmlWriter::Create ( const SharedPtr< IO::Stream > &  output,
SharedPtr< XmlWriterSettings settings 
)
static

Creates a new XmlWriter instance using the stream and XmlWriterSettings object.

Parameters
outputThe stream to which you want to write. The XmlWriter writes XML 1.0 text syntax and appends it to the specified stream.
settingsThe XmlWriterSettings object used to configure the new XmlWriter instance. If this is nullptr, a XmlWriterSettings with default settings is used. If the XmlWriter is being used with the XslCompiledTransform:Transform(String,SharedPtr<XmlWriter>) method, you should use the XslCompiledTransform::get_OutputSettings value to obtain an XmlWriterSettings object with the correct settings. This ensures that the created XmlWriter object has the correct output settings.
Returns
An XmlWriter object.
Exceptions
ArgumentNullExceptionThe stream value is nullptr.

◆ Create() [3/10]

static SharedPtr< XmlWriter > System::Xml::XmlWriter::Create ( const SharedPtr< IO::TextWriter > &  output)
static

Creates a new XmlWriter instance using the specified TextWriter.

Parameters
outputThe TextWriter to which you want to write. The XmlWriter writes XML 1.0 text syntax and appends it to the specified TextWriter.
Returns
An XmlWriter object.
Exceptions
ArgumentNullExceptionThe text value is nullptr.

◆ Create() [4/10]

static SharedPtr< XmlWriter > System::Xml::XmlWriter::Create ( const SharedPtr< IO::TextWriter > &  output,
SharedPtr< XmlWriterSettings settings 
)
static

Creates a new XmlWriter instance using the TextWriter and XmlWriterSettings objects.

Parameters
outputThe TextWriter to which you want to write. The XmlWriter writes XML 1.0 text syntax and appends it to the specified TextWriter.
settingsThe XmlWriterSettings object used to configure the new XmlWriter instance. If this is nullptr, a XmlWriterSettings with default settings is used. If the XmlWriter is being used with the XslCompiledTransform:Transform(String,SharedPtr<XmlWriter>) method, you should use the XslCompiledTransform::get_OutputSettings value to obtain an XmlWriterSettings object with the correct settings. This ensures that the created XmlWriter object has the correct output settings.
Returns
An XmlWriter object.
Exceptions
ArgumentNullExceptionThe text value is nullptr.

◆ Create() [5/10]

static SharedPtr< XmlWriter > System::Xml::XmlWriter::Create ( const SharedPtr< Text::StringBuilder > &  output)
static

Creates a new XmlWriter instance using the specified Text::StringBuilder.

Parameters
outputThe Text::StringBuilder to which to write to. Content written by the XmlWriter is appended to the Text::StringBuilder.
Returns
An XmlWriter object.
Exceptions
ArgumentNullExceptionThe builder value is nullptr.

◆ Create() [6/10]

static SharedPtr< XmlWriter > System::Xml::XmlWriter::Create ( const SharedPtr< Text::StringBuilder > &  output,
SharedPtr< XmlWriterSettings settings 
)
static

Creates a new XmlWriter instance using the Text::StringBuilder and XmlWriterSettings objects.

Parameters
outputThe Text::StringBuilder to which to write to. Content written by the XmlWriter is appended to the Text::StringBuilder.
settingsThe XmlWriterSettings object used to configure the new XmlWriter instance. If this is nullptr, a XmlWriterSettings with default settings is used. If the XmlWriter is being used with the XslCompiledTransform:Transform(String,SharedPtr<XmlWriter>) method, you should use the XslCompiledTransform::get_OutputSettings value to obtain an XmlWriterSettings object with the correct settings. This ensures that the created XmlWriter object has the correct output settings.
Returns
An XmlWriter object.
Exceptions
ArgumentNullExceptionThe builder value is nullptr.

◆ Create() [7/10]

static SharedPtr< XmlWriter > System::Xml::XmlWriter::Create ( const SharedPtr< XmlWriter > &  output)
static

Creates a new XmlWriter instance using the specified XmlWriter object.

Parameters
outputThe XmlWriter object that you want to use as the underlying writer.
Returns
An XmlWriter object that is wrapped around the specified XmlWriter object.
Exceptions
ArgumentNullExceptionThe writer value is nullptr.

◆ Create() [8/10]

static SharedPtr< XmlWriter > System::Xml::XmlWriter::Create ( const SharedPtr< XmlWriter > &  output,
SharedPtr< XmlWriterSettings settings 
)
static

Creates a new XmlWriter instance using the specified XmlWriter and XmlWriterSettings objects.

Parameters
outputThe XmlWriter object that you want to use as the underlying writer.
settingsThe XmlWriterSettings object used to configure the new XmlWriter instance. If this is nullptr, a XmlWriterSettings with default settings is used. If the XmlWriter is being used with the XslCompiledTransform:Transform(String,SharedPtr<XmlWriter>) method, you should use the XslCompiledTransform::get_OutputSettings value to obtain an XmlWriterSettings object with the correct settings. This ensures that the created XmlWriter object has the correct output settings.
Returns
An XmlWriter object that is wrapped around the specified XmlWriter object.
Exceptions
ArgumentNullExceptionThe writer value is nullptr.

◆ Create() [9/10]

static SharedPtr< XmlWriter > System::Xml::XmlWriter::Create ( const String outputFileName)
static

Creates a new XmlWriter instance using the specified filename.

Parameters
outputFileNameThe file to which you want to write. The XmlWriter creates a file at the specified path and writes to it in XML 1.0 text syntax. The outputFileName must be a file system path.
Returns
An XmlWriter object.
Exceptions
ArgumentNullExceptionThe url value is nullptr.

◆ Create() [10/10]

static SharedPtr< XmlWriter > System::Xml::XmlWriter::Create ( const String outputFileName,
SharedPtr< XmlWriterSettings settings 
)
static

Creates a new XmlWriter instance using the filename and XmlWriterSettings object.

Parameters
outputFileNameThe file to which you want to write. The XmlWriter creates a file at the specified path and writes to it in XML 1.0 text syntax. The outputFileName must be a file system path.
settingsThe XmlWriterSettings object used to configure the new XmlWriter instance. If this is nullptr, a XmlWriterSettings with default settings is used. If the XmlWriter is being used with the XslCompiledTransform:Transform(String,SharedPtr<XmlWriter>) method, you should use the XslCompiledTransform::get_OutputSettings value to obtain an XmlWriterSettings object with the correct settings. This ensures that the created XmlWriter object has the correct output settings.
Returns
An XmlWriter object.
Exceptions
ArgumentNullExceptionThe url value is nullptr.

◆ Dispose() [1/2]

void System::Xml::XmlWriter::Dispose ( )
overridevirtual

Releases all resources used by the current instance of the XmlWriter class.

Reimplemented from System::IDisposable.

◆ Dispose() [2/2]

virtual void System::Xml::XmlWriter::Dispose ( bool  disposing)
protectedvirtual

Optionally releases all resources used by the current instance of the XmlWriter class.

Parameters
disposingtrue to release the resources; false to do nothing.

◆ Flush()

virtual void System::Xml::XmlWriter::Flush ( )
pure virtual

When overridden in a derived class, flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream.

Implemented in System::Xml::XmlTextWriter.

◆ get_Settings()

virtual SharedPtr< XmlWriterSettings > System::Xml::XmlWriter::get_Settings ( )
virtual

Returns the XmlWriterSettings object used to create this XmlWriter instance.

Returns
The XmlWriterSettings object used to create this writer instance. If this writer was not created using the XmlWriter::Create method, this method returns nullptr.

◆ get_WriteState()

virtual System::Xml::WriteState System::Xml::XmlWriter::get_WriteState ( )
pure virtual

When overridden in a derived class, gets the state of the writer.

Returns
One of the WriteState values.

Implemented in System::Xml::XmlTextWriter.

◆ get_XmlLang()

virtual String System::Xml::XmlWriter::get_XmlLang ( )
virtual

When overridden in a derived class, gets the current xml:lang scope.

Returns
The current xml:lang scope.

Reimplemented in System::Xml::XmlTextWriter.

◆ get_XmlSpace()

virtual System::Xml::XmlSpace System::Xml::XmlWriter::get_XmlSpace ( )
virtual

When overridden in a derived class, gets an XmlSpace representing the current xml:space scope.

Returns
An XmlSpace representing the current xml:space scope.
Value Meaning
None This is the default if no xml:space scope exists.
Default The current scope is xml:space="default".
Preserve The current scope is xml:space="preserve".

Reimplemented in System::Xml::XmlTextWriter.

◆ LookupPrefix()

virtual String System::Xml::XmlWriter::LookupPrefix ( String  ns)
pure virtual

When overridden in a derived class, returns the closest prefix defined in the current namespace scope for the namespace URI.

Parameters
nsThe namespace URI whose prefix you want to find.
Returns
The matching prefix or nullptr if no matching namespace URI is found in the current scope.
Exceptions
ArgumentExceptionns is either nullptr or String::Empty.

Implemented in System::Xml::XmlTextWriter.

◆ WriteAttributes()

virtual void System::Xml::XmlWriter::WriteAttributes ( SharedPtr< XmlReader reader,
bool  defattr 
)
virtual

When overridden in a derived class, writes out all the attributes found at the current position in the XmlReader.

Parameters
readerThe XmlReader from which to copy the attributes.
defattrtrue to copy the default attributes from the XmlReader; otherwise, false.
Exceptions
ArgumentNullExceptionreader is nullptr.
XmlExceptionThe reader is not positioned on an element, attribute or XmlDeclaration node.

◆ WriteAttributeString() [1/3]

void System::Xml::XmlWriter::WriteAttributeString ( const String localName,
const String ns,
const String value 
)

When overridden in a derived class, writes an attribute with the specified local name, namespace URI, and value.

Parameters
localNameThe local name of the attribute.
nsThe namespace URI to associate with the attribute.
valueThe value of the attribute.
Exceptions
InvalidOperationExceptionThe state of writer is not WriteState::Element or writer is closed.
ArgumentExceptionThe xml:space or xml:lang attribute value is invalid.

◆ WriteAttributeString() [2/3]

void System::Xml::XmlWriter::WriteAttributeString ( const String localName,
const String value 
)

When overridden in a derived class, writes out the attribute with the specified local name and value.

Parameters
localNameThe local name of the attribute.
valueThe value of the attribute.
Exceptions
InvalidOperationExceptionThe state of writer is not WriteState::Element or writer is closed.
ArgumentExceptionThe xml:space or xml:lang attribute value is invalid.

◆ WriteAttributeString() [3/3]

void System::Xml::XmlWriter::WriteAttributeString ( const String prefix,
const String localName,
const String ns,
const String value 
)

When overridden in a derived class, writes out the attribute with the specified prefix, local name, namespace URI, and value.

Parameters
prefixThe namespace prefix of the attribute.
localNameThe local name of the attribute.
nsThe namespace URI of the attribute.
valueThe value of the attribute.
Exceptions
InvalidOperationExceptionThe state of writer is not WriteState::Element or writer is closed.
ArgumentExceptionThe xml:space or xml:lang attribute value is invalid.
XmlExceptionThe localName or ns is nullptr.

◆ WriteBase64()

virtual void System::Xml::XmlWriter::WriteBase64 ( ArrayPtr< uint8_t >  buffer,
int32_t  index,
int32_t  count 
)
pure virtual

When overridden in a derived class, encodes the specified binary bytes as Base64 and writes out the resulting text.

Parameters
bufferByte array to encode.
indexThe position in the buffer indicating the start of the bytes to write.
countThe number of bytes to write.
Exceptions
ArgumentNullExceptionbuffer is nullptr.
ArgumentOutOfRangeExceptionindex or count is less than zero. or The buffer length minus index is less than count.

Implemented in System::Xml::XmlTextWriter.

◆ WriteBinHex()

virtual void System::Xml::XmlWriter::WriteBinHex ( ArrayPtr< uint8_t >  buffer,
int32_t  index,
int32_t  count 
)
virtual

When overridden in a derived class, encodes the specified binary bytes as BinHex and writes out the resulting text.

Parameters
bufferByte array to encode.
indexThe position in the buffer indicating the start of the bytes to write.
countThe number of bytes to write.
Exceptions
ArgumentNullExceptionbuffer is nullptr.
InvalidOperationExceptionThe writer is closed or in error state.
ArgumentOutOfRangeExceptionindex or count is less than zero. or The buffer length minus index is less than count.

Reimplemented in System::Xml::XmlTextWriter.

◆ WriteCData()

virtual void System::Xml::XmlWriter::WriteCData ( String  text)
pure virtual

When overridden in a derived class, writes out a ... block containing the specified text.

Parameters
textThe text to place inside the CDATA block.
Exceptions
ArgumentExceptionThe text would result in a non-well formed XML document.

Implemented in System::Xml::XmlTextWriter.

◆ WriteCharEntity()

virtual void System::Xml::XmlWriter::WriteCharEntity ( char16_t  ch)
pure virtual

When overridden in a derived class, forces the generation of a character entity for the specified Unicode character value.

Parameters
chThe Unicode character for which to generate a character entity.
Exceptions
ArgumentExceptionThe character is in the surrogate pair character range, 0xd800 - 0xdfff.

Implemented in System::Xml::XmlTextWriter.

◆ WriteChars()

virtual void System::Xml::XmlWriter::WriteChars ( ArrayPtr< char16_t >  buffer,
int32_t  index,
int32_t  count 
)
pure virtual

When overridden in a derived class, writes text one buffer at a time.

Parameters
bufferCharacter array containing the text to write.
indexThe position in the buffer indicating the start of the text to write.
countThe number of characters to write.
Exceptions
ArgumentNullExceptionbuffer is nullptr.
ArgumentOutOfRangeExceptionindex or count is less than zero. or The buffer length minus index is less than count; the call results in surrogate pair characters being split or an invalid surrogate pair being written.
ArgumentExceptionThe buffer parameter value is not valid.

Implemented in System::Xml::XmlTextWriter.

◆ WriteComment()

virtual void System::Xml::XmlWriter::WriteComment ( String  text)
pure virtual

When overridden in a derived class, writes out a comment containing the specified text.

Parameters
textText to place inside the comment.
Exceptions
ArgumentExceptionThe text would result in a non-well-formed XML document.

Implemented in System::Xml::XmlTextWriter.

◆ WriteDocType()

virtual void System::Xml::XmlWriter::WriteDocType ( const String name,
const String pubid,
const String sysid,
const String subset 
)
pure virtual

When overridden in a derived class, writes the DOCTYPE declaration with the specified name and optional attributes.

Parameters
nameThe name of the DOCTYPE. This must be non-empty.
pubidIf non-null it also writes PUBLIC "pubid" "sysid" where pubid and sysid are replaced with the value of the given arguments.
sysidIf pubid is nullptr and sysid is non-null it writes SYSTEM "sysid" where sysid is replaced with the value of this argument.
subsetIf non-null it writes [subset] where subset is replaced with the value of this argument.
Exceptions
InvalidOperationExceptionThis method was called outside the prolog (after the root element).
ArgumentExceptionThe value for name would result in invalid XML.

Implemented in System::Xml::XmlTextWriter.

◆ WriteElementString() [1/3]

void System::Xml::XmlWriter::WriteElementString ( const String localName,
const String ns,
const String value 
)

Writes an element with the specified local name, namespace URI, and value.

Parameters
localNameThe local name of the element.
nsThe namespace URI to associate with the element.
valueThe value of the element.
Exceptions
ArgumentExceptionThe localName value is nullptr or an empty string. or The parameter values are not valid.
EncoderFallbackExceptionThere is a character in the buffer that is a valid XML character but is not valid for the output encoding. For example, if the output encoding is ASCII, you should only use characters from the range of 0 to 127 for element and attribute names. The invalid character might be in the argument of this method or in an argument of previous methods that were writing to the buffer. Such characters are escaped by character entity references when possible (for example, in text nodes or attribute values). However, the character entity reference is not allowed in element and attribute names, comments, processing instructions, or CDATA sections.

◆ WriteElementString() [2/3]

void System::Xml::XmlWriter::WriteElementString ( const String localName,
const String value 
)

Writes an element with the specified local name and value.

Parameters
localNameThe local name of the element.
valueThe value of the element.
Exceptions
ArgumentExceptionThe localName value is nullptr or an empty string. or The parameter values are not valid.
EncoderFallbackExceptionThere is a character in the buffer that is a valid XML character but is not valid for the output encoding. For example, if the output encoding is ASCII, you should only use characters from the range of 0 to 127 for element and attribute names. The invalid character might be in the argument of this method or in an argument of previous methods that were writing to the buffer. Such characters are escaped by character entity references when possible (for example, in text nodes or attribute values). However, the character entity reference is not allowed in element and attribute names, comments, processing instructions, or CDATA sections.

◆ WriteElementString() [3/3]

void System::Xml::XmlWriter::WriteElementString ( const String prefix,
const String localName,
const String ns,
const String value 
)

Writes an element with the specified prefix, local name, namespace URI, and value.

Parameters
prefixThe prefix of the element.
localNameThe local name of the element.
nsThe namespace URI of the element.
valueThe value of the element.
Exceptions
ArgumentExceptionThe localName value is nullptr or an empty string. or The parameter values are not valid.
EncoderFallbackExceptionThere is a character in the buffer that is a valid XML character but is not valid for the output encoding. For example, if the output encoding is ASCII, you should only use characters from the range of 0 to 127 for element and attribute names. The invalid character might be in the argument of this method or in an argument of previous methods that were writing to the buffer. Such characters are escaped by character entity references when possible (for example, in text nodes or attribute values). However, the character entity reference is not allowed in element and attribute names, comments, processing instructions, or CDATA sections.

◆ WriteEndAttribute()

virtual void System::Xml::XmlWriter::WriteEndAttribute ( )
pure virtual

When overridden in a derived class, closes the previous XmlWriter::WriteStartAttribute(String,String) call.

Implemented in System::Xml::XmlTextWriter.

◆ WriteEndDocument()

virtual void System::Xml::XmlWriter::WriteEndDocument ( )
pure virtual

When overridden in a derived class, closes any open elements or attributes and puts the writer back in the Start state.

Exceptions
ArgumentExceptionThe XML document is invalid.

Implemented in System::Xml::XmlTextWriter.

◆ WriteEndElement()

virtual void System::Xml::XmlWriter::WriteEndElement ( )
pure virtual

When overridden in a derived class, closes one element and pops the corresponding namespace scope.

Exceptions
InvalidOperationExceptionThis results in an invalid XML document.

Implemented in System::Xml::XmlTextWriter.

◆ WriteEntityRef()

virtual void System::Xml::XmlWriter::WriteEntityRef ( const String name)
pure virtual

When overridden in a derived class, writes out an entity reference as &name;.

Parameters
nameThe name of the entity reference.
Exceptions
ArgumentExceptionname is either nullptr or String::Empty.

Implemented in System::Xml::XmlTextWriter.

◆ WriteFullEndElement()

virtual void System::Xml::XmlWriter::WriteFullEndElement ( )
pure virtual

When overridden in a derived class, closes one element and pops the corresponding namespace scope.

Implemented in System::Xml::XmlTextWriter.

◆ WriteName()

virtual void System::Xml::XmlWriter::WriteName ( const String name)
virtual

When overridden in a derived class, writes out the specified name, ensuring it is a valid name according to the W3C XML 1.0 recommendation (https://www.w3.org/TR/1998/REC-xml-19980210#NT-Name).

Parameters
nameThe name to write.
Exceptions
ArgumentExceptionname is not a valid XML name; or name is either nullptr or String::Empty.

Reimplemented in System::Xml::XmlTextWriter.

◆ WriteNmToken()

virtual void System::Xml::XmlWriter::WriteNmToken ( const String name)
virtual

When overridden in a derived class, writes out the specified name, ensuring it is a valid NmToken according to the W3C XML 1.0 recommendation (https://www.w3.org/TR/1998/REC-xml-19980210#NT-Name).

Parameters
nameThe name to write.
Exceptions
ArgumentExceptionname is not a valid NmToken; or name is either nullptr or String::Empty.

Reimplemented in System::Xml::XmlTextWriter.

◆ WriteNode() [1/2]

virtual void System::Xml::XmlWriter::WriteNode ( SharedPtr< XmlReader reader,
bool  defattr 
)
virtual

When overridden in a derived class, copies everything from the reader to the writer and moves the reader to the start of the next sibling.

Parameters
readerThe XmlReader to read from.
defattrtrue to copy the default attributes from the XmlReader; otherwise, false.
Exceptions
ArgumentNullExceptionreader is nullptr.
ArgumentExceptionreader contains invalid characters.

◆ WriteNode() [2/2]

virtual void System::Xml::XmlWriter::WriteNode ( SharedPtr< XPath::XPathNavigator navigator,
bool  defattr 
)
virtual

Copies everything from the XPathNavigator object to the writer. The position of the XPathNavigator remains unchanged.

Parameters
navigatorThe XPathNavigator to copy from.
defattrtrue to copy the default attributes; otherwise, false.
Exceptions
ArgumentNullExceptionnavigator is nullptr.

◆ WriteProcessingInstruction()

virtual void System::Xml::XmlWriter::WriteProcessingInstruction ( String  name,
String  text 
)
pure virtual

When overridden in a derived class, writes out a processing instruction with a space between the name and text as follows: <?name text?>.

Parameters
nameThe name of the processing instruction.
textThe text to include in the processing instruction.
Exceptions
ArgumentExceptionThe text would result in a non-well formed XML document. name is either nullptr or String::Empty.

This method is being used to create an XML declaration after XmlWriter::WriteStartDocument has already been called.

Implemented in System::Xml::XmlTextWriter.

◆ WriteQualifiedName()

virtual void System::Xml::XmlWriter::WriteQualifiedName ( const String localName,
const String ns 
)
virtual

When overridden in a derived class, writes out the namespace-qualified name. This method looks up the prefix that is in scope for the given namespace.

Parameters
localNameThe local name to write.
nsThe namespace URI for the name.
Exceptions
ArgumentExceptionlocalName is either nullptr or String::Empty. localName is not a valid name.

Reimplemented in System::Xml::XmlTextWriter.

◆ WriteRaw() [1/2]

virtual void System::Xml::XmlWriter::WriteRaw ( ArrayPtr< char16_t >  buffer,
int32_t  index,
int32_t  count 
)
pure virtual

When overridden in a derived class, writes raw markup manually from a character buffer.

Parameters
bufferCharacter array containing the text to write.
indexThe position within the buffer indicating the start of the text to write.
countThe number of characters to write.
Exceptions
ArgumentNullExceptionbuffer is nullptr.
ArgumentOutOfRangeExceptionindex or count is less than zero. or The buffer length minus index is less than count.

Implemented in System::Xml::XmlTextWriter.

◆ WriteRaw() [2/2]

virtual void System::Xml::XmlWriter::WriteRaw ( const String data)
pure virtual

When overridden in a derived class, writes raw markup manually from a string.

Parameters
dataString containing the text to write.
Exceptions
ArgumentExceptiondata is either nullptr or String::Empty.

Implemented in System::Xml::XmlTextWriter.

◆ WriteStartAttribute() [1/3]

void System::Xml::XmlWriter::WriteStartAttribute ( const String localName)

Writes the start of an attribute with the specified local name.

Parameters
localNameThe local name of the attribute.
Exceptions
InvalidOperationExceptionThe writer is closed.
EncoderFallbackExceptionThere is a character in the buffer that is a valid XML character but is not valid for the output encoding. For example, if the output encoding is ASCII, you should only use characters from the range of 0 to 127 for element and attribute names. The invalid character might be in the argument of this method or in an argument of previous methods that were writing to the buffer. Such characters are escaped by character entity references when possible (for example, in text nodes or attribute values). However, the character entity reference is not allowed in element and attribute names, comments, processing instructions, or CDATA sections.

◆ WriteStartAttribute() [2/3]

void System::Xml::XmlWriter::WriteStartAttribute ( const String localName,
const String ns 
)

Writes the start of an attribute with the specified local name and namespace URI.

Parameters
localNameThe local name of the attribute.
nsThe namespace URI of the attribute.
Exceptions
EncoderFallbackExceptionThere is a character in the buffer that is a valid XML character but is not valid for the output encoding. For example, if the output encoding is ASCII, you should only use characters from the range of 0 to 127 for element and attribute names. The invalid character might be in the argument of this method or in an argument of previous methods that were writing to the buffer. Such characters are escaped by character entity references when possible (for example, in text nodes or attribute values). However, the character entity reference is not allowed in element and attribute names, comments, processing instructions, or CDATA sections.

◆ WriteStartAttribute() [3/3]

virtual void System::Xml::XmlWriter::WriteStartAttribute ( const String prefix,
const String localName,
const String ns 
)
pure virtual

When overridden in a derived class, writes the start of an attribute with the specified prefix, local name, and namespace URI.

Parameters
prefixThe namespace prefix of the attribute.
localNameThe local name of the attribute.
nsThe namespace URI for the attribute.
Exceptions
EncoderFallbackExceptionThere is a character in the buffer that is a valid XML character but is not valid for the output encoding. For example, if the output encoding is ASCII, you should only use characters from the range of 0 to 127 for element and attribute names. The invalid character might be in the argument of this method or in an argument of previous methods that were writing to the buffer. Such characters are escaped by character entity references when possible (for example, in text nodes or attribute values). However, the character entity reference is not allowed in element and attribute names, comments, processing instructions, or CDATA sections.

Implemented in System::Xml::XmlTextWriter.

◆ WriteStartDocument() [1/2]

virtual void System::Xml::XmlWriter::WriteStartDocument ( )
pure virtual

When overridden in a derived class, writes the XML declaration with the version "1.0".

Exceptions
InvalidOperationExceptionThis is not the first write method called after the constructor.

Implemented in System::Xml::XmlTextWriter.

◆ WriteStartDocument() [2/2]

virtual void System::Xml::XmlWriter::WriteStartDocument ( bool  standalone)
pure virtual

When overridden in a derived class, writes the XML declaration with the version "1.0" and the standalone attribute.

Parameters
standaloneIf true, it writes "standalone=yes"; if false, it writes "standalone=no".
Exceptions
InvalidOperationExceptionThis is not the first write method called after the constructor.

Implemented in System::Xml::XmlTextWriter.

◆ WriteStartElement() [1/3]

void System::Xml::XmlWriter::WriteStartElement ( const String localName)

When overridden in a derived class, writes out a start tag with the specified local name.

Parameters
localNameThe local name of the element.
Exceptions
InvalidOperationExceptionThe writer is closed.
EncoderFallbackExceptionThere is a character in the buffer that is a valid XML character but is not valid for the output encoding. For example, if the output encoding is ASCII, you should only use characters from the range of 0 to 127 for element and attribute names. The invalid character might be in the argument of this method or in an argument of previous methods that were writing to the buffer. Such characters are escaped by character entity references when possible (for example, in text nodes or attribute values). However, the character entity reference is not allowed in element and attribute names, comments, processing instructions, or CDATA sections.

◆ WriteStartElement() [2/3]

void System::Xml::XmlWriter::WriteStartElement ( const String localName,
const String ns 
)

When overridden in a derived class, writes the specified start tag and associates it with the given namespace.

Parameters
localNameThe local name of the element.
nsThe namespace URI to associate with the element. If this namespace is already in scope and has an associated prefix, the writer automatically writes that prefix also.
Exceptions
InvalidOperationExceptionThe writer is closed.
EncoderFallbackExceptionThere is a character in the buffer that is a valid XML character but is not valid for the output encoding. For example, if the output encoding is ASCII, you should only use characters from the range of 0 to 127 for element and attribute names. The invalid character might be in the argument of this method or in an argument of previous methods that were writing to the buffer. Such characters are escaped by character entity references when possible (for example, in text nodes or attribute values). However, the character entity reference is not allowed in element and attribute names, comments, processing instructions, or CDATA sections.

◆ WriteStartElement() [3/3]

virtual void System::Xml::XmlWriter::WriteStartElement ( const String prefix,
const String localName,
const String ns 
)
pure virtual

When overridden in a derived class, writes the specified start tag and associates it with the given namespace and prefix.

Parameters
prefixThe namespace prefix of the element.
localNameThe local name of the element.
nsThe namespace URI to associate with the element.
Exceptions
InvalidOperationExceptionThe writer is closed.
EncoderFallbackExceptionThere is a character in the buffer that is a valid XML character but is not valid for the output encoding. For example, if the output encoding is ASCII, you should only use characters from the range of 0 to 127 for element and attribute names. The invalid character might be in the argument of this method or in an argument of previous methods that were writing to the buffer. Such characters are escaped by character entity references when possible (for example, in text nodes or attribute values). However, the character entity reference is not allowed in element and attribute names, comments, processing instructions, or CDATA sections.

Implemented in System::Xml::XmlTextWriter.

◆ WriteString()

virtual void System::Xml::XmlWriter::WriteString ( const String text)
pure virtual

When overridden in a derived class, writes the given text content.

Parameters
textThe text to write.
Exceptions
ArgumentExceptionThe text string contains an invalid surrogate pair.

Implemented in System::Xml::XmlTextWriter.

◆ WriteSurrogateCharEntity()

virtual void System::Xml::XmlWriter::WriteSurrogateCharEntity ( char16_t  lowChar,
char16_t  highChar 
)
pure virtual

When overridden in a derived class, generates and writes the surrogate character entity for the surrogate character pair.

Parameters
lowCharThe low surrogate. This must be a value between 0xDC00 and 0xDFFF.
highCharThe high surrogate. This must be a value between 0xD800 and 0xDBFF.
Exceptions
ArgumentExceptionAn invalid surrogate character pair was passed.

Implemented in System::Xml::XmlTextWriter.

◆ WriteValue() [1/10]

virtual void System::Xml::XmlWriter::WriteValue ( bool  value)
virtual

Writes a Boolean value.

Parameters
valueThe Boolean value to write.
Exceptions
ArgumentExceptionAn invalid value was specified.

◆ WriteValue() [2/10]

virtual void System::Xml::XmlWriter::WriteValue ( const String value)
virtual

Writes a String value.

Parameters
valueThe String value to write.
Exceptions
ArgumentExceptionAn invalid value was specified.

◆ WriteValue() [3/10]

virtual void System::Xml::XmlWriter::WriteValue ( DateTime  value)
virtual

Writes a DateTime value.

Parameters
valueThe DateTime value to write.
Exceptions
ArgumentExceptionAn invalid value was specified.

◆ WriteValue() [4/10]

virtual void System::Xml::XmlWriter::WriteValue ( DateTimeOffset  value)
virtual

Writes a DateTimeOffset value.

Parameters
valueThe DateTimeOffset value to write.

◆ WriteValue() [5/10]

virtual void System::Xml::XmlWriter::WriteValue ( Decimal  value)
virtual

Writes a Decimal value.

Parameters
valueThe Decimal value to write.
Exceptions
ArgumentExceptionAn invalid value was specified.

◆ WriteValue() [6/10]

virtual void System::Xml::XmlWriter::WriteValue ( double  value)
virtual

Writes a Double value.

Parameters
valueThe Double value to write.
Exceptions
ArgumentExceptionAn invalid value was specified.

◆ WriteValue() [7/10]

virtual void System::Xml::XmlWriter::WriteValue ( float  value)
virtual

Writes a single-precision floating-point number.

Parameters
valueThe single-precision floating-point number to write.
Exceptions
ArgumentExceptionAn invalid value was specified.

◆ WriteValue() [8/10]

virtual void System::Xml::XmlWriter::WriteValue ( int32_t  value)
virtual

Writes a Int32 value.

Parameters
valueThe Int32 value to write.
Exceptions
ArgumentExceptionAn invalid value was specified.

◆ WriteValue() [9/10]

virtual void System::Xml::XmlWriter::WriteValue ( int64_t  value)
virtual

Writes a Int64 value.

Parameters
valueThe Int64 value to write.
Exceptions
ArgumentExceptionAn invalid value was specified.

◆ WriteValue() [10/10]

virtual void System::Xml::XmlWriter::WriteValue ( SharedPtr< Object value)
virtual

Writes the object value.

Parameters
valueThe object value to write.
Exceptions
ArgumentExceptionAn invalid value was specified.
ArgumentNullExceptionThe value is nullptr.
InvalidOperationExceptionThe writer is closed or in error state.

◆ WriteWhitespace()

virtual void System::Xml::XmlWriter::WriteWhitespace ( String  ws)
pure virtual

When overridden in a derived class, writes out the given white space.

Parameters
wsThe string of white space characters.
Exceptions
ArgumentExceptionThe string contains non-white space characters.

Implemented in System::Xml::XmlTextWriter.