Asposecpplib
System::Xml::XmlConvert Class Reference

Encodes and decodes XML names, and provides methods for converting between runtime types and XML Schema definition language (XSD) types. When converting data types, the values returned are locale-independent. More...

Inherits System::Object.

Public Types

using Ptr = SharedPtr< XmlConvert >
 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...
 

Static Public Member Functions

static String EncodeName (const String &name)
 Converts the name to a valid XML name. More...
 
static String EncodeNmToken (const String &name)
 Verifies the name is valid according to the XML specification. More...
 
static String EncodeLocalName (const String &name)
 Converts the name to a valid XML local name. More...
 
static String DecodeName (const String &name)
 Decodes a name. This method does the reverse of the XmlConvert::EncodeName(String) and XmlConvert::EncodeLocalName(String) methods. More...
 
static String VerifyName (const String &name)
 Verifies that the name is a valid name according to the W3C Extended Markup Language recommendation. More...
 
static String VerifyNCName (const String &name)
 Verifies that the name is a valid NCName according to the W3C Extended Markup Language recommendation. An NCName is a name that cannot contain a colon. More...
 
static String VerifyTOKEN (const String &token)
 Verifies that the string is a valid token according to the W3C XML Schema Part2: Datatypes recommendation. More...
 
static String VerifyNMTOKEN (const String &name)
 Verifies that the string is a valid NMTOKEN according to the W3C XML Schema Part2: Datatypes recommendation. More...
 
static String VerifyXmlChars (const String &content)
 Returns the passed-in string if all the characters and surrogate pair characters in the string argument are valid XML characters, otherwise an XmlException is thrown with information on the first invalid character encountered. More...
 
static String VerifyPublicId (const String &publicId)
 Returns the passed in string instance if all the characters in the string argument are valid public id characters. More...
 
static String VerifyWhitespace (const String &content)
 Returns the passed-in string instance if all the characters in the string argument are valid whitespace characters. More...
 
static bool IsStartNCNameChar (char16_t ch)
 Checks if the passed-in character is a valid Start Name Character type. More...
 
static bool IsNCNameChar (char16_t ch)
 Checks whether the passed-in character is a valid non-colon character type. More...
 
static bool IsXmlChar (char16_t ch)
 Checks if the passed-in character is a valid XML character. More...
 
static bool IsXmlSurrogatePair (char16_t lowChar, char16_t highChar)
 Checks if the passed-in surrogate pair of characters is a valid XML character. More...
 
static bool IsPublicIdChar (char16_t ch)
 Returns the passed-in character instance if the character in the argument is a valid public id character, otherwise nullptr. More...
 
static bool IsWhitespaceChar (char16_t ch)
 Checks if the passed-in character is a valid XML whitespace character. More...
 
static String ToString (bool value)
 Converts the Boolean to a String. More...
 
static String ToString (char16_t value)
 Converts the Char to a String. More...
 
static String ToString (Decimal value)
 Converts the Decimal to a String. More...
 
static String ToString (int8_t value)
 Converts the SByte to a String. More...
 
static String ToString (int16_t value)
 Converts the Int16 to a String. More...
 
static String ToString (int32_t value)
 Converts the Int32 to a String. More...
 
static String ToString (int64_t value)
 Converts the Int64 to a String. More...
 
static String ToString (uint8_t value)
 Converts the Byte to a String. More...
 
static String ToString (uint16_t value)
 Converts the UInt16 to a String. More...
 
static String ToString (uint32_t value)
 Converts the UInt32 to a String. More...
 
static String ToString (uint64_t value)
 Converts the UInt64 to a String. More...
 
static String ToString (float value)
 Converts the Single to a String. More...
 
static String ToString (double value)
 Converts the Double to a String. More...
 
static String ToString (TimeSpan value)
 Converts the TimeSpan to a String. More...
 
static String ToString (DateTime value)
 Converts the DateTime to a String. More...
 
static String ToString (DateTime value, const String &format)
 Converts the DateTime to a String. More...
 
static String ToString (DateTime value, XmlDateTimeSerializationMode dateTimeOption)
 Converts the DateTime to a String using the XmlDateTimeSerializationMode specified. More...
 
static String ToString (DateTimeOffset value)
 Converts the supplied DateTimeOffset to a String. More...
 
static String ToString (DateTimeOffset value, const String &format)
 Converts the supplied DateTimeOffset to a String in the specified format. More...
 
static String ToString (Guid value)
 Converts the Guid to a String. More...
 
static bool ToBoolean (String s)
 Converts the String to a Boolean equivalent. More...
 
static char16_t ToChar (const String &s)
 Converts the String to a Char equivalent. More...
 
static Decimal ToDecimal (const String &s)
 Converts the String to a Decimal equivalent. More...
 
static int8_t ToSByte (const String &s)
 Converts the String to a SByte equivalent. More...
 
static int16_t ToInt16 (const String &s)
 Converts the String to a Int16 equivalent. More...
 
static int32_t ToInt32 (const String &s)
 Converts the String to a Int32 equivalent. More...
 
static int64_t ToInt64 (const String &s)
 Converts the String to a Int64 equivalent. More...
 
static uint8_t ToByte (const String &s)
 Converts the String to a Byte equivalent. More...
 
static uint16_t ToUInt16 (const String &s)
 Converts the String to a UInt16 equivalent. More...
 
static uint32_t ToUInt32 (const String &s)
 Converts the String to a UInt32 equivalent. More...
 
static uint64_t ToUInt64 (const String &s)
 Converts the String to a UInt64 equivalent. More...
 
static float ToSingle (String s)
 Converts the String to a Single equivalent. More...
 
static double ToDouble (String s)
 Converts the String to a Double equivalent. More...
 
static TimeSpan ToTimeSpan (const String &s)
 Converts the String to a TimeSpan equivalent. More...
 
static DateTime ToDateTime (const String &s)
 Converts the String to a DateTime equivalent. More...
 
static DateTime ToDateTime (const String &s, const String &format)
 Converts the String to a DateTime equivalent. More...
 
static DateTime ToDateTime (const String &s, const ArrayPtr< String > &formats)
 Converts the String to a DateTime equivalent. More...
 
static DateTime ToDateTime (const String &s, XmlDateTimeSerializationMode dateTimeOption)
 Converts the String to a DateTime using the XmlDateTimeSerializationMode specified. More...
 
static DateTimeOffset ToDateTimeOffset (const String &s)
 Converts the supplied String to a DateTimeOffset equivalent. More...
 
static DateTimeOffset ToDateTimeOffset (const String &s, const String &format)
 Converts the supplied String to a DateTimeOffset equivalent. More...
 
static DateTimeOffset ToDateTimeOffset (const String &s, const ArrayPtr< String > &formats)
 Converts the supplied String to a DateTimeOffset equivalent. More...
 
static Guid ToGuid (const String &s)
 Converts the String to a Guid equivalent. 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...
 

Additional Inherited Members

- 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...
 

Detailed Description

Encodes and decodes XML names, and provides methods for converting between runtime types and XML Schema definition language (XSD) types. When converting data types, the values returned are locale-independent.

Member Typedef Documentation

◆ Ptr

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

Member Function Documentation

◆ DecodeName()

static String System::Xml::XmlConvert::DecodeName ( const String name)
static

Decodes a name. This method does the reverse of the XmlConvert::EncodeName(String) and XmlConvert::EncodeLocalName(String) methods.

Parameters
nameThe name to be transformed.
Returns
The decoded name.

◆ EncodeLocalName()

static String System::Xml::XmlConvert::EncodeLocalName ( const String name)
static

Converts the name to a valid XML local name.

Parameters
nameThe name to be encoded.
Returns
The encoded name.

◆ EncodeName()

static String System::Xml::XmlConvert::EncodeName ( const String name)
static

Converts the name to a valid XML name.

Parameters
nameA name to be translated.
Returns
The name with any invalid characters replaced by an escape string.

◆ EncodeNmToken()

static String System::Xml::XmlConvert::EncodeNmToken ( const String name)
static

Verifies the name is valid according to the XML specification.

Parameters
nameThe name to be encoded.
Returns
The encoded name.

◆ IsNCNameChar()

static bool System::Xml::XmlConvert::IsNCNameChar ( char16_t  ch)
static

Checks whether the passed-in character is a valid non-colon character type.

Parameters
chThe character to verify as a non-colon character.
Returns
true if the character is a valid non-colon character type; otherwise, false.

◆ IsPublicIdChar()

static bool System::Xml::XmlConvert::IsPublicIdChar ( char16_t  ch)
static

Returns the passed-in character instance if the character in the argument is a valid public id character, otherwise nullptr.

Parameters
chChar object to validate.
Returns
The passed-in character if the character is a valid public id character, otherwise nullptr.

◆ IsStartNCNameChar()

static bool System::Xml::XmlConvert::IsStartNCNameChar ( char16_t  ch)
static

Checks if the passed-in character is a valid Start Name Character type.

Parameters
chThe character to validate.
Returns
true if the character is a valid Start Name Character type; otherwise, false.

◆ IsWhitespaceChar()

static bool System::Xml::XmlConvert::IsWhitespaceChar ( char16_t  ch)
static

Checks if the passed-in character is a valid XML whitespace character.

Parameters
chThe character to validate.
Returns
true if the passed in character is a valid XML whitespace character; otherwise, false.

◆ IsXmlChar()

static bool System::Xml::XmlConvert::IsXmlChar ( char16_t  ch)
static

Checks if the passed-in character is a valid XML character.

Parameters
chThe character to validate.
Returns
true if the passed in character is a valid XML character; otherwise, false.

◆ IsXmlSurrogatePair()

static bool System::Xml::XmlConvert::IsXmlSurrogatePair ( char16_t  lowChar,
char16_t  highChar 
)
static

Checks if the passed-in surrogate pair of characters is a valid XML character.

Parameters
lowCharThe surrogate character to validate.
highCharThe surrogate character to validate.
Returns
true if the passed in surrogate pair of characters is a valid XML character; otherwise, false.

◆ ToBoolean()

static bool System::Xml::XmlConvert::ToBoolean ( String  s)
static

Converts the String to a Boolean equivalent.

Parameters
sThe string to convert.
Returns
A Boolean value, that is, true or false.
Exceptions
ArgumentNullExceptions is nullptr.
FormatExceptions does not represent a Boolean value.

◆ ToByte()

static uint8_t System::Xml::XmlConvert::ToByte ( const String s)
static

Converts the String to a Byte equivalent.

Parameters
sThe string to convert.
Returns
A Byte equivalent of the string.
Exceptions
ArgumentNullExceptions is nullptr.
FormatExceptions is not in the correct format.
OverflowExceptions represents a number less than Byte::MinValue or greater than Byte::MaxValue.

◆ ToChar()

static char16_t System::Xml::XmlConvert::ToChar ( const String s)
static

Converts the String to a Char equivalent.

Parameters
sThe string containing a single character to convert.
Returns
A Char representing the single character.
Exceptions
ArgumentNullExceptionThe value of the s parameter is nullptr.
FormatExceptionThe s parameter contains more than one character.

◆ ToDateTime() [1/4]

static DateTime System::Xml::XmlConvert::ToDateTime ( const String s)
static

Converts the String to a DateTime equivalent.

Parameters
sThe string to convert.
Returns
A DateTime equivalent of the string.
Exceptions
ArgumentNullExceptions is nullptr.
FormatExceptions is an empty string or is not in the correct format.

◆ ToDateTime() [2/4]

static DateTime System::Xml::XmlConvert::ToDateTime ( const String s,
const ArrayPtr< String > &  formats 
)
static

Converts the String to a DateTime equivalent.

Parameters
sThe string to convert.
formatsAn array containing the format structures to apply to the converted DateTime. Valid formats include "yyyy-MM-ddTHH:mm:sszzzzzz" and its subsets.
Returns
A DateTime equivalent of the string.
Exceptions
ArgumentNullExceptions is nullptr.
FormatExceptions or an element of formats is String::Empty or s does not contain a date and time that corresponds to any of the elements of formats.

◆ ToDateTime() [3/4]

static DateTime System::Xml::XmlConvert::ToDateTime ( const String s,
const String format 
)
static

Converts the String to a DateTime equivalent.

Parameters
sThe string to convert.
formatThe format structure to apply to the converted DateTime. Valid formats include "yyyy-MM-ddTHH:mm:sszzzzzz" and its subsets. The string is validated against this format.
Returns
A DateTime equivalent of the string.
Exceptions
ArgumentNullExceptions is nullptr.
FormatExceptions or format is String::Empty or s does not contain a date and time that corresponds to format.

◆ ToDateTime() [4/4]

static DateTime System::Xml::XmlConvert::ToDateTime ( const String s,
XmlDateTimeSerializationMode  dateTimeOption 
)
static

Converts the String to a DateTime using the XmlDateTimeSerializationMode specified.

Parameters
sThe String value to convert.
dateTimeOptionOne of the enumeration values that specify whether the date should be converted to local time or preserved as Coordinated Universal Time (UTC), if it is a UTC date.
Returns
A DateTime equivalent of the String.
Exceptions
NullReferenceExceptions is nullptr.
ArgumentNullExceptiondateTimeOption is nullptr.
FormatExceptions is an empty string or is not in a valid format.

◆ ToDateTimeOffset() [1/3]

static DateTimeOffset System::Xml::XmlConvert::ToDateTimeOffset ( const String s)
static

Converts the supplied String to a DateTimeOffset equivalent.

Parameters
sThe string to convert. The string must conform to a subset of the W3C Recommendation for the XML dateTime type. For more information, see the dateTime section of the XML Schema specification.
Returns
The DateTimeOffset equivalent of the supplied string.
Exceptions
ArgumentNullExceptions is nullptr.
ArgumentOutOfRangeExceptionThe argument passed to this method is outside the range of allowable values. For information about allowable values, see DateTimeOffset.
FormatExceptionThe argument passed to this method does not conform to a subset of the W3C Recommendations for the XML dateTime type. For more information, see the dateTime section of the XML Schema specification.

◆ ToDateTimeOffset() [2/3]

static DateTimeOffset System::Xml::XmlConvert::ToDateTimeOffset ( const String s,
const ArrayPtr< String > &  formats 
)
static

Converts the supplied String to a DateTimeOffset equivalent.

Parameters
sThe string to convert.
formatsAn array of formats from which s can be converted. Each format in formats can be any subset of the W3C Recommendation for the XML dateTime type. For more information, see the dateTime section of the XML Schema specification. The string s is validated against one of these formats.
Returns
The DateTimeOffset equivalent of the supplied string.

◆ ToDateTimeOffset() [3/3]

static DateTimeOffset System::Xml::XmlConvert::ToDateTimeOffset ( const String s,
const String format 
)
static

Converts the supplied String to a DateTimeOffset equivalent.

Parameters
sThe string to convert.
formatThe format from which s is converted. The format parameter can be any subset of the W3C Recommendation for the XML dateTime type. For more information, see the dateTime section of the XML Schema specification. The string s is validated against this format.
Returns
The DateTimeOffset equivalent of the supplied string.
Exceptions
ArgumentNullExceptions is nullptr.
FormatExceptions or format is an empty string or is not in the specified format.

◆ ToDecimal()

static Decimal System::Xml::XmlConvert::ToDecimal ( const String s)
static

Converts the String to a Decimal equivalent.

Parameters
sThe string to convert.
Returns
A Decimal equivalent of the string.
Exceptions
ArgumentNullExceptions is nullptr.
FormatExceptions is not in the correct format.
OverflowExceptions represents a number less than Decimal::MinValue or greater than Decimal::MaxValue.

◆ ToDouble()

static double System::Xml::XmlConvert::ToDouble ( String  s)
static

Converts the String to a Double equivalent.

Parameters
sThe string to convert.
Returns
A Double equivalent of the string.
Exceptions
ArgumentNullExceptions is nullptr.
FormatExceptions is not in the correct format.
OverflowExceptions represents a number less than Double::MinValue or greater than Double::MaxValue.

◆ ToGuid()

static Guid System::Xml::XmlConvert::ToGuid ( const String s)
static

Converts the String to a Guid equivalent.

Parameters
sThe string to convert.
Returns
A Guid equivalent of the string.

◆ ToInt16()

static int16_t System::Xml::XmlConvert::ToInt16 ( const String s)
static

Converts the String to a Int16 equivalent.

Parameters
sThe string to convert.
Returns
An Int16 equivalent of the string.
Exceptions
ArgumentNullExceptions is nullptr.
FormatExceptions is not in the correct format.
OverflowExceptions represents a number less than Int16::MinValue or greater than Int16::MaxValue.

◆ ToInt32()

static int32_t System::Xml::XmlConvert::ToInt32 ( const String s)
static

Converts the String to a Int32 equivalent.

Parameters
sThe string to convert.
Returns
An Int32 equivalent of the string.
Exceptions
ArgumentNullExceptions is nullptr.
FormatExceptions is not in the correct format.
OverflowExceptions represents a number less than Int32::MinValue or greater than Int32::MaxValue.

◆ ToInt64()

static int64_t System::Xml::XmlConvert::ToInt64 ( const String s)
static

Converts the String to a Int64 equivalent.

Parameters
sThe string to convert.
Returns
An Int64 equivalent of the string.
Exceptions
ArgumentNullExceptions is nullptr.
FormatExceptions is not in the correct format.
OverflowExceptions represents a number less than Int64::MinValue or greater than Int64::MaxValue.

◆ ToSByte()

static int8_t System::Xml::XmlConvert::ToSByte ( const String s)
static

Converts the String to a SByte equivalent.

Parameters
sThe string to convert.
Returns
An SByte equivalent of the string.
Exceptions
ArgumentNullExceptions is nullptr.
FormatExceptions is not in the correct format.
OverflowExceptions represents a number less than SByte::MinValue or greater than SByte::MaxValue.

◆ ToSingle()

static float System::Xml::XmlConvert::ToSingle ( String  s)
static

Converts the String to a Single equivalent.

Parameters
sThe string to convert.
Returns
A Single equivalent of the string.
Exceptions
ArgumentNullExceptions is nullptr.
FormatExceptions is not in the correct format.
OverflowExceptions represents a number less than Single::MinValue or greater than Single::MaxValue.

◆ ToString() [1/20]

static String System::Xml::XmlConvert::ToString ( bool  value)
static

Converts the Boolean to a String.

Parameters
valueThe value to convert.
Returns
A string representation of the Boolean, that is, "true" or "false".

◆ ToString() [2/20]

static String System::Xml::XmlConvert::ToString ( char16_t  value)
static

Converts the Char to a String.

Parameters
valueThe value to convert.
Returns
A string representation of the Char.

◆ ToString() [3/20]

static String System::Xml::XmlConvert::ToString ( DateTime  value)
static

Converts the DateTime to a String.

Parameters
valueThe value to convert.
Returns
A string representation of the DateTime in the format yyyy-MM-ddTHH:mm:ss where 'T' is a constant literal.

◆ ToString() [4/20]

static String System::Xml::XmlConvert::ToString ( DateTime  value,
const String format 
)
static

Converts the DateTime to a String.

Parameters
valueThe value to convert.
formatThe format structure that defines how to display the converted string. Valid formats include "yyyy-MM-ddTHH:mm:sszzzzzz" and its subsets.
Returns
A string representation of the DateTime in the specified format.

◆ ToString() [5/20]

static String System::Xml::XmlConvert::ToString ( DateTime  value,
XmlDateTimeSerializationMode  dateTimeOption 
)
static

Converts the DateTime to a String using the XmlDateTimeSerializationMode specified.

Parameters
valueThe DateTime value to convert.
dateTimeOptionOne of the XmlDateTimeSerializationMode values that specify how to treat the DateTime value.
Returns
A String equivalent of the DateTime.
Exceptions
ArgumentExceptionThe dateTimeOption value is not valid.
ArgumentNullExceptionThe value or dateTimeOption value is nullptr.

◆ ToString() [6/20]

static String System::Xml::XmlConvert::ToString ( DateTimeOffset  value)
static

Converts the supplied DateTimeOffset to a String.

Parameters
valueThe DateTimeOffset to be converted.
Returns
A String representation of the supplied DateTimeOffset.

◆ ToString() [7/20]

static String System::Xml::XmlConvert::ToString ( DateTimeOffset  value,
const String format 
)
static

Converts the supplied DateTimeOffset to a String in the specified format.

Parameters
valueThe DateTimeOffset to be converted.
formatThe format to which s is converted. The format parameter can be any subset of the W3C Recommendation for the XML dateTime type. For more information, see the dateTime section of the XML Schema specification.
Returns
A String representation in the specified format of the supplied DateTimeOffset.

◆ ToString() [8/20]

static String System::Xml::XmlConvert::ToString ( Decimal  value)
static

Converts the Decimal to a String.

Parameters
valueThe value to convert.
Returns
A string representation of the Decimal.

◆ ToString() [9/20]

static String System::Xml::XmlConvert::ToString ( double  value)
static

Converts the Double to a String.

Parameters
valueThe value to convert.
Returns
A string representation of the Double.

◆ ToString() [10/20]

static String System::Xml::XmlConvert::ToString ( float  value)
static

Converts the Single to a String.

Parameters
valueThe value to convert.
Returns
A string representation of the Single.

◆ ToString() [11/20]

static String System::Xml::XmlConvert::ToString ( Guid  value)
static

Converts the Guid to a String.

Parameters
valueThe value to convert.
Returns
A string representation of the Guid.

◆ ToString() [12/20]

static String System::Xml::XmlConvert::ToString ( int16_t  value)
static

Converts the Int16 to a String.

Parameters
valueThe value to convert.
Returns
A string representation of the Int16.

◆ ToString() [13/20]

static String System::Xml::XmlConvert::ToString ( int32_t  value)
static

Converts the Int32 to a String.

Parameters
valueThe value to convert.
Returns
A string representation of the Int32.

◆ ToString() [14/20]

static String System::Xml::XmlConvert::ToString ( int64_t  value)
static

Converts the Int64 to a String.

Parameters
valueThe value to convert.
Returns
A string representation of the Int64.

◆ ToString() [15/20]

static String System::Xml::XmlConvert::ToString ( int8_t  value)
static

Converts the SByte to a String.

Parameters
valueThe value to convert.
Returns
A string representation of the SByte.

◆ ToString() [16/20]

static String System::Xml::XmlConvert::ToString ( TimeSpan  value)
static

Converts the TimeSpan to a String.

Parameters
valueThe value to convert.
Returns
A string representation of the TimeSpan.

◆ ToString() [17/20]

static String System::Xml::XmlConvert::ToString ( uint16_t  value)
static

Converts the UInt16 to a String.

Parameters
valueThe value to convert.
Returns
A string representation of the UInt16.

◆ ToString() [18/20]

static String System::Xml::XmlConvert::ToString ( uint32_t  value)
static

Converts the UInt32 to a String.

Parameters
valueThe value to convert.
Returns
A string representation of the UInt32.

◆ ToString() [19/20]

static String System::Xml::XmlConvert::ToString ( uint64_t  value)
static

Converts the UInt64 to a String.

Parameters
valueThe value to convert.
Returns
A string representation of the UInt64.

◆ ToString() [20/20]

static String System::Xml::XmlConvert::ToString ( uint8_t  value)
static

Converts the Byte to a String.

Parameters
valueThe value to convert.
Returns
A string representation of the Byte.

◆ ToTimeSpan()

static TimeSpan System::Xml::XmlConvert::ToTimeSpan ( const String s)
static

Converts the String to a TimeSpan equivalent.

Parameters
sThe string to convert. The string format must conform to the W3C XML Schema Part 2: Datatypes recommendation for duration.
Returns
A TimeSpan equivalent of the string.
Exceptions
FormatExceptions is not in correct format to represent a TimeSpan value.

◆ ToUInt16()

static uint16_t System::Xml::XmlConvert::ToUInt16 ( const String s)
static

Converts the String to a UInt16 equivalent.

Parameters
sThe string to convert.
Returns
A UInt16 equivalent of the string.
Exceptions
ArgumentNullExceptions is nullptr.
FormatExceptions is not in the correct format.
OverflowExceptions represents a number less than UInt16::MinValue or greater than UInt16::MaxValue.

◆ ToUInt32()

static uint32_t System::Xml::XmlConvert::ToUInt32 ( const String s)
static

Converts the String to a UInt32 equivalent.

Parameters
sThe string to convert.
Returns
A UInt32 equivalent of the string.
Exceptions
ArgumentNullExceptions is nullptr.
FormatExceptions is not in the correct format.
OverflowExceptions represents a number less than UInt32::MinValue or greater than UInt32::MaxValue.

◆ ToUInt64()

static uint64_t System::Xml::XmlConvert::ToUInt64 ( const String s)
static

Converts the String to a UInt64 equivalent.

Parameters
sThe string to convert.
Returns
A UInt64 equivalent of the string.
Exceptions
ArgumentNullExceptions is nullptr.
FormatExceptions is not in the correct format.
OverflowExceptions represents a number less than UInt64::MinValue or greater than UInt64::MaxValue.

◆ VerifyName()

static String System::Xml::XmlConvert::VerifyName ( const String name)
static

Verifies that the name is a valid name according to the W3C Extended Markup Language recommendation.

Parameters
nameThe name to verify.
Returns
The name, if it is a valid XML name.
Exceptions
XmlExceptionname is not a valid XML name.
ArgumentNullExceptionname is nullptr or String::Empty.

◆ VerifyNCName()

static String System::Xml::XmlConvert::VerifyNCName ( const String name)
static

Verifies that the name is a valid NCName according to the W3C Extended Markup Language recommendation. An NCName is a name that cannot contain a colon.

Parameters
nameThe name to verify.
Returns
The name, if it is a valid NCName.
Exceptions
ArgumentNullExceptionname is nullptr or String::Empty.
XmlExceptionname is not a valid non-colon name.

◆ VerifyNMTOKEN()

static String System::Xml::XmlConvert::VerifyNMTOKEN ( const String name)
static

Verifies that the string is a valid NMTOKEN according to the W3C XML Schema Part2: Datatypes recommendation.

Parameters
nameThe string you wish to verify.
Returns
The name token, if it is a valid NMTOKEN.
Exceptions
XmlExceptionThe string is not a valid name token.
ArgumentNullExceptionname is nullptr.

◆ VerifyPublicId()

static String System::Xml::XmlConvert::VerifyPublicId ( const String publicId)
static

Returns the passed in string instance if all the characters in the string argument are valid public id characters.

Parameters
publicIdString that contains the id to validate.
Returns
The passed-in string if all the characters in the argument are valid public id characters.

◆ VerifyTOKEN()

static String System::Xml::XmlConvert::VerifyTOKEN ( const String token)
static

Verifies that the string is a valid token according to the W3C XML Schema Part2: Datatypes recommendation.

Parameters
tokenThe string value you wish to verify.
Returns
The token, if it is a valid token.
Exceptions
XmlExceptionThe string value is not a valid token.

◆ VerifyWhitespace()

static String System::Xml::XmlConvert::VerifyWhitespace ( const String content)
static

Returns the passed-in string instance if all the characters in the string argument are valid whitespace characters.

Parameters
contentString to verify.
Returns
The passed-in string instance if all the characters in the string argument are valid whitespace characters, otherwise nullptr.

◆ VerifyXmlChars()

static String System::Xml::XmlConvert::VerifyXmlChars ( const String content)
static

Returns the passed-in string if all the characters and surrogate pair characters in the string argument are valid XML characters, otherwise an XmlException is thrown with information on the first invalid character encountered.

Parameters
contentString that contains characters to verify.
Returns
The passed-in string if all the characters and surrogate-pair characters in the string argument are valid XML characters, otherwise an XmlException is thrown with information on the first invalid character encountered.