XmlConvert

XmlConvert class

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.

class XmlConvert : public System::Object

Methods

MethodDescription
static String DecodeName(const String&)Decodes a name. This method does the reverse of the XmlConvert::EncodeName(String) and XmlConvert::EncodeLocalName(String) methods.
static String EncodeLocalName(const String&)Converts the name to a valid XML local name.
static String EncodeName(const String&)Converts the name to a valid XML name.
static String EncodeNmToken(const String&)Verifies the name is valid according to the XML specification.
virtual bool Equals(ptr)Compares objects using C# Object.Equals semantics.
static std::enable_if<IsSmartPtr<T1>::value&&IsSmartPtr<T2>::value, bool>::type Equals(T1 const&, T2 const&)Compares reference type objects in C# style.
static std::enable_if<!IsSmartPtr<T1>::value&&!IsSmartPtr<T2>::value, bool>::type Equals(T1 const&, T2 const&)Compares value type objects in C# style.
static bool Equals(float const&, float const&)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.
static bool Equals(double const&, double const&)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.
virtual bool FastCast(const Details::FastRttiBase&, void **) constFor internal purposes only.
Detail::SmartPtrCounter * GetCounter()Gets reference counter data structure associated with the object.
virtual int32_t GetHashCode() constAnalog of C# Object.GetHashCode() method. Enables hashing of custom objects.
virtual const TypeInfo& GetType() constGets actual type of object. Analog of C# System.Object.GetType() call.
virtual bool Is(const TypeInfo&) constCheck if object represents an instance of type described by targetType. Analog of C# ‘is’ operator.
static bool IsNCNameChar(char16_t)Checks whether the passed-in character is a valid non-colon character type.
static bool IsPublicIdChar(char16_t)Returns the passed-in character instance if the character in the argument is a valid public id character, otherwise nullptr.
static bool IsStartNCNameChar(char16_t)Checks if the passed-in character is a valid Start Name Character type.
static bool IsWhitespaceChar(char16_t)Checks if the passed-in character is a valid XML whitespace character.
static bool IsXmlChar(char16_t)Checks if the passed-in character is a valid XML character.
static bool IsXmlSurrogatePair(char16_t, char16_t)Checks if the passed-in surrogate pair of characters is a valid XML character.
void Lock()Implements C# lock() statement locking. Call directly or use LockContext sentry object.
virtual ptr MemberwiseClone() constAnalog of C# Object.MemberwiseClone() method. Enables cloning custom types.
Object()Creates object. Initializes all internal data structures.
Object(Object const&)Copy constructor. Doesn’t copy anything, really, just initializes new object and enables copy constructing subclasses.
Object& operator=(Object const&)Assignment operator. Doesn’t copy anything, really, just initializes new object and enables copy constructing subclasses.
static bool ReferenceEquals(ptr const&, ptr const&)Compares objects by reference.
static std::enable_if<!IsSmartPtr<T>::value, bool>::type ReferenceEquals(T const&, T const&)Compares objects by reference.
static std::enable_if<!IsSmartPtr<T>::value, bool>::type ReferenceEquals(T const&, std::nullptr_t)Reference-compares value type object with nullptr.
bool ReferenceEquals(String const&, std::nullptr_t)Specialization of Object::ReferenceEquals for case of string and nullptr.
bool ReferenceEquals(String const&, String const&)Specialization of Object::ReferenceEquals for case of strings.
int RemovedSharedRefs(int)Decreases shared reference count by specified value.
virtual void SetTemplateWeakPtr(uint32_t)Set n’th template argument a weak pointer (rather than shared). Allows switching pointers in containers to weak mode.
int SharedCount() constGets current value of shared reference counter.
Object * SharedRefAdded()Increments shared reference count. Shouldn’t be called directly; instead, use smart pointers or ThisProtector.
int SharedRefRemovedSafe()Decrements and returns shared reference count. Shouldn’t be called directly; instead, use smart pointers or ThisProtector.
static bool ToBoolean(String)Converts the String to a Boolean equivalent.
static uint8_t ToByte(const String&)Converts the String to a Byte equivalent.
static char16_t ToChar(const String&)Converts the String to a Char equivalent.
static DateTime ToDateTime(const String&)Converts the String to a DateTime equivalent.
static DateTime ToDateTime(const String&, const String&)Converts the String to a DateTime equivalent.
static DateTime ToDateTime(const String&, const ArrayPtr<String>&)Converts the String to a DateTime equivalent.
static DateTime ToDateTime(const String&, XmlDateTimeSerializationMode)Converts the String to a DateTime using the XmlDateTimeSerializationMode specified.
static DateTimeOffset ToDateTimeOffset(const String&)Converts the supplied String to a DateTimeOffset equivalent.
static DateTimeOffset ToDateTimeOffset(const String&, const String&)Converts the supplied String to a DateTimeOffset equivalent.
static DateTimeOffset ToDateTimeOffset(const String&, const ArrayPtr<String>&)Converts the supplied String to a DateTimeOffset equivalent.
static Decimal ToDecimal(const String&)Converts the String to a Decimal equivalent.
static double ToDouble(String)Converts the String to a Double equivalent.
static Guid ToGuid(const String&)Converts the String to a Guid equivalent.
static int16_t ToInt16(const String&)Converts the String to a Int16 equivalent.
static int32_t ToInt32(const String&)Converts the String to a Int32 equivalent.
static int64_t ToInt64(const String&)Converts the String to a Int64 equivalent.
static int8_t ToSByte(const String&)Converts the String to a SByte equivalent.
static float ToSingle(String)Converts the String to a Single equivalent.
static String ToString(bool)Converts the Boolean to a String.
static String ToString(char16_t)Converts the Char to a String.
static String ToString(Decimal)Converts the Decimal to a String.
static String ToString(int8_t)Converts the SByte to a String.
static String ToString(int16_t)Converts the Int16 to a String.
static String ToString(int32_t)Converts the Int32 to a String.
static String ToString(int64_t)Converts the Int64 to a String.
static String ToString(uint8_t)Converts the Byte to a String.
static String ToString(uint16_t)Converts the UInt16 to a String.
static String ToString(uint32_t)Converts the UInt32 to a String.
static String ToString(uint64_t)Converts the UInt64 to a String.
static String ToString(float)Converts the Single to a String.
static String ToString(double)Converts the Double to a String.
static String ToString(TimeSpan)Converts the TimeSpan to a String.
static String ToString(DateTime)Converts the DateTime to a String.
static String ToString(DateTime, const String&)Converts the DateTime to a String.
static String ToString(DateTime, XmlDateTimeSerializationMode)Converts the DateTime to a String using the XmlDateTimeSerializationMode specified.
static String ToString(DateTimeOffset)Converts the supplied DateTimeOffset to a String.
static String ToString(DateTimeOffset, const String&)Converts the supplied DateTimeOffset to a String in the specified format.
static String ToString(Guid)Converts the Guid to a String.
virtual String ToString() constAnalog of C# Object.ToString() method. Enables converting custom objects to string.
static TimeSpan ToTimeSpan(const String&)Converts the String to a TimeSpan equivalent.
static uint16_t ToUInt16(const String&)Converts the String to a UInt16 equivalent.
static uint32_t ToUInt32(const String&)Converts the String to a UInt32 equivalent.
static uint64_t ToUInt64(const String&)Converts the String to a UInt64 equivalent.
static const TypeInfo& Type()Implements C# typeof(System.Object) construct.
void Unlock()Implements C# lock() statement unlocking. Call directly or use LockContext sentry object.
static String VerifyName(const String&)Verifies that the name is a valid name according to the W3C Extended Markup Language recommendation.
static String VerifyNCName(const String&)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.
static String VerifyNMTOKEN(const String&)Verifies that the string is a valid NMTOKEN according to the W3C XML Schema Part2: Datatypes recommendation.
static String VerifyPublicId(const String&)Returns the passed in string instance if all the characters in the string argument are valid public id characters.
static String VerifyTOKEN(const String&)Verifies that the string is a valid token according to the W3C XML Schema Part2: Datatypes recommendation.
static String VerifyWhitespace(const String&)Returns the passed-in string instance if all the characters in the string argument are valid whitespace characters.
static String VerifyXmlChars(const String&)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.
Detail::SmartPtrCounter * WeakRefAdded()Increments weak reference count. Shouldn’t be called directly; instead, use smart pointers or ThisProtector.
void WeakRefRemoved()Decrements weak reference count. Shouldn’t be called directly; instead, use smart pointers or ThisProtector.
virtual ~Object()Destroys object. Frees all internal data structures.

Typedefs

TypedefDescription
PtrAn alias for shared pointer to an instance of this class.

See Also