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 ASPOSECPP_SHARED_API String EncodeName (const String &name)
 Converts the name to a valid XML name. More...
 
static ASPOSECPP_SHARED_API String EncodeNmToken (const String &name)
 Verifies the name is valid according to the XML specification. More...
 
static ASPOSECPP_SHARED_API String EncodeLocalName (const String &name)
 Converts the name to a valid XML local name. More...
 
static ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API String VerifyName (const String &name)
 Verifies that the name is a valid name according to the W3C Extended Markup Language recommendation. More...
 
static ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API String VerifyTOKEN (const String &token)
 Verifies that the string is a valid token according to the W3C XML Schema Part2: Datatypes recommendation. More...
 
static ASPOSECPP_SHARED_API String VerifyNMTOKEN (const String &name)
 Verifies that the string is a valid NMTOKEN according to the W3C XML Schema Part2: Datatypes recommendation. More...
 
static ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API bool IsStartNCNameChar (char16_t ch)
 Checks if the passed-in character is a valid Start Name Character type. More...
 
static ASPOSECPP_SHARED_API bool IsNCNameChar (char16_t ch)
 Checks whether the passed-in character is a valid non-colon character type. More...
 
static ASPOSECPP_SHARED_API bool IsXmlChar (char16_t ch)
 Checks if the passed-in character is a valid XML character. More...
 
static ASPOSECPP_SHARED_API bool IsXmlSurrogatePair (char16_t lowChar, char16_t highChar)
 Checks if the passed-in surrogate pair of characters is a valid XML character. More...
 
static ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API bool IsWhitespaceChar (char16_t ch)
 Checks if the passed-in character is a valid XML whitespace character. More...
 
static ASPOSECPP_SHARED_API String ToString (bool value)
 Converts the Boolean to a String. More...
 
static ASPOSECPP_SHARED_API String ToString (char16_t value)
 Converts the Char to a String. More...
 
static ASPOSECPP_SHARED_API String ToString (Decimal value)
 Converts the Decimal to a String. More...
 
static ASPOSECPP_SHARED_API String ToString (int8_t value)
 Converts the SByte to a String. More...
 
static ASPOSECPP_SHARED_API String ToString (int16_t value)
 Converts the Int16 to a String. More...
 
static ASPOSECPP_SHARED_API String ToString (int32_t value)
 Converts the Int32 to a String. More...
 
static ASPOSECPP_SHARED_API String ToString (int64_t value)
 Converts the Int64 to a String. More...
 
static ASPOSECPP_SHARED_API String ToString (uint8_t value)
 Converts the Byte to a String. More...
 
static ASPOSECPP_SHARED_API String ToString (uint16_t value)
 Converts the UInt16 to a String. More...
 
static ASPOSECPP_SHARED_API String ToString (uint32_t value)
 Converts the UInt32 to a String. More...
 
static ASPOSECPP_SHARED_API String ToString (uint64_t value)
 Converts the UInt64 to a String. More...
 
static ASPOSECPP_SHARED_API String ToString (float value)
 Converts the Single to a String. More...
 
static ASPOSECPP_SHARED_API String ToString (double value)
 Converts the Double to a String. More...
 
static ASPOSECPP_SHARED_API String ToString (TimeSpan value)
 Converts the TimeSpan to a String. More...
 
static ASPOSECPP_SHARED_API String ToString (DateTime value)
 Converts the DateTime to a String. More...
 
static ASPOSECPP_SHARED_API String ToString (DateTime value, const String &format)
 Converts the DateTime to a String. More...
 
static ASPOSECPP_SHARED_API String ToString (DateTime value, XmlDateTimeSerializationMode dateTimeOption)
 Converts the DateTime to a String using the XmlDateTimeSerializationMode specified. More...
 
static ASPOSECPP_SHARED_API String ToString (DateTimeOffset value)
 Converts the supplied DateTimeOffset to a String. More...
 
static ASPOSECPP_SHARED_API String ToString (DateTimeOffset value, const String &format)
 Converts the supplied DateTimeOffset to a String in the specified format. More...
 
static ASPOSECPP_SHARED_API String ToString (Guid value)
 Converts the Guid to a String. More...
 
static ASPOSECPP_SHARED_API bool ToBoolean (String s)
 Converts the String to a Boolean equivalent. More...
 
static ASPOSECPP_SHARED_API char16_t ToChar (const String &s)
 Converts the String to a Char equivalent. More...
 
static ASPOSECPP_SHARED_API Decimal ToDecimal (const String &s)
 Converts the String to a Decimal equivalent. More...
 
static ASPOSECPP_SHARED_API int8_t ToSByte (const String &s)
 Converts the String to a SByte equivalent. More...
 
static ASPOSECPP_SHARED_API int16_t ToInt16 (const String &s)
 Converts the String to a Int16 equivalent. More...
 
static ASPOSECPP_SHARED_API int32_t ToInt32 (const String &s)
 Converts the String to a Int32 equivalent. More...
 
static ASPOSECPP_SHARED_API int64_t ToInt64 (const String &s)
 Converts the String to a Int64 equivalent. More...
 
static ASPOSECPP_SHARED_API uint8_t ToByte (const String &s)
 Converts the String to a Byte equivalent. More...
 
static ASPOSECPP_SHARED_API uint16_t ToUInt16 (const String &s)
 Converts the String to a UInt16 equivalent. More...
 
static ASPOSECPP_SHARED_API uint32_t ToUInt32 (const String &s)
 Converts the String to a UInt32 equivalent. More...
 
static ASPOSECPP_SHARED_API uint64_t ToUInt64 (const String &s)
 Converts the String to a UInt64 equivalent. More...
 
static ASPOSECPP_SHARED_API float ToSingle (String s)
 Converts the String to a Single equivalent. More...
 
static ASPOSECPP_SHARED_API double ToDouble (String s)
 Converts the String to a Double equivalent. More...
 
static ASPOSECPP_SHARED_API TimeSpan ToTimeSpan (const String &s)
 Converts the String to a TimeSpan equivalent. More...
 
static ASPOSECPP_SHARED_API DateTime ToDateTime (const String &s)
 Converts the String to a DateTime equivalent. More...
 
static ASPOSECPP_SHARED_API DateTime ToDateTime (const String &s, const String &format)
 Converts the String to a DateTime equivalent. More...
 
static ASPOSECPP_SHARED_API DateTime ToDateTime (const String &s, const ArrayPtr< String > &formats)
 Converts the String to a DateTime equivalent. More...
 
static ASPOSECPP_SHARED_API DateTime ToDateTime (const String &s, XmlDateTimeSerializationMode dateTimeOption)
 Converts the String to a DateTime using the XmlDateTimeSerializationMode specified. More...
 
static ASPOSECPP_SHARED_API DateTimeOffset ToDateTimeOffset (const String &s)
 Converts the supplied String to a DateTimeOffset equivalent. More...
 
static ASPOSECPP_SHARED_API DateTimeOffset ToDateTimeOffset (const String &s, const String &format)
 Converts the supplied String to a DateTimeOffset equivalent. More...
 
static ASPOSECPP_SHARED_API DateTimeOffset ToDateTimeOffset (const String &s, const ArrayPtr< String > &formats)
 Converts the supplied String to a DateTimeOffset equivalent. More...
 
static ASPOSECPP_SHARED_API 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...
 

Additional Inherited Members

- Public Member Functions inherited from System::Object
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...
 
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...
 
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 int32_t GetHashCode () const
 Analog of C# Object.GetHashCode() method. Enables hashing of custom objects. More...
 
virtual ASPOSECPP_SHARED_API String ToString () 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 TypeInfoGetType () 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 (uint32_t argument)
 Set n'th template argument a weak pointer (rather than shared). Allows switching pointers in containers to weak mode. More...
 
virtual ASPOSECPP_SHARED_API bool FastCast (const Details::FastRttiBase &helper, void **out_ptr) const
 For internal purposes only. 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...
 
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 ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API 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() [3/4]

static ASPOSECPP_SHARED_API 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() [4/4]

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

◆ ToDateTimeOffset() [3/3]

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

◆ ToDecimal()

static ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API 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() [4/20]

static ASPOSECPP_SHARED_API 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() [5/20]

static ASPOSECPP_SHARED_API 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() [6/20]

static ASPOSECPP_SHARED_API 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() [7/20]

static ASPOSECPP_SHARED_API 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() [8/20]

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

◆ ToString() [9/20]

static ASPOSECPP_SHARED_API 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() [10/20]

static ASPOSECPP_SHARED_API 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() [11/20]

static ASPOSECPP_SHARED_API 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() [12/20]

static ASPOSECPP_SHARED_API 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() [13/20]

static ASPOSECPP_SHARED_API 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() [14/20]

static ASPOSECPP_SHARED_API 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() [15/20]

static ASPOSECPP_SHARED_API 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() [16/20]

static ASPOSECPP_SHARED_API 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() [17/20]

static ASPOSECPP_SHARED_API 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() [18/20]

static ASPOSECPP_SHARED_API 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() [19/20]

static ASPOSECPP_SHARED_API 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() [20/20]

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

◆ ToTimeSpan()

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