System::Xml::Schema::XmlSchemaSet Class Reference

Inherits System::Object.

Public Types

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

ASPOSECPP_SHARED_API SharedPtr< XmlNameTableget_NameTable ()
 
ASPOSECPP_SHARED_API bool get_IsCompiled ()
 
ASPOSECPP_SHARED_API void set_XmlResolver (const SharedPtr< System::Xml::XmlResolver > &value)
 
ASPOSECPP_SHARED_API SharedPtr< XmlSchemaCompilationSettingsget_CompilationSettings ()
 
ASPOSECPP_SHARED_API void set_CompilationSettings (const SharedPtr< XmlSchemaCompilationSettings > &value)
 
ASPOSECPP_SHARED_API int32_t get_Count ()
 
ASPOSECPP_SHARED_API SharedPtr< XmlSchemaObjectTableget_GlobalElements ()
 
ASPOSECPP_SHARED_API SharedPtr< XmlSchemaObjectTableget_GlobalAttributes ()
 
ASPOSECPP_SHARED_API SharedPtr< XmlSchemaObjectTableget_GlobalTypes ()
 
ASPOSECPP_SHARED_API XmlSchemaSet ()
 Initializes a new instance of the XmlSchemaSet class. More...
 
ASPOSECPP_SHARED_API XmlSchemaSet (const SharedPtr< XmlNameTable > &nameTable)
 
template<class... Args>
void ValidationEventHandler_add (Args... value)
 
template<class... Args>
void ValidationEventHandler_remove (Args... value)
 
ASPOSECPP_SHARED_API SharedPtr< XmlSchemaAdd (String targetNamespace, const String &schemaUri)
 
ASPOSECPP_SHARED_API SharedPtr< XmlSchemaAdd (String targetNamespace, const SharedPtr< XmlReader > &schemaDocument)
 
ASPOSECPP_SHARED_API void Add (const SharedPtr< XmlSchemaSet > &schemas)
 
ASPOSECPP_SHARED_API SharedPtr< XmlSchemaAdd (const SharedPtr< XmlSchema > &schema)
 
ASPOSECPP_SHARED_API SharedPtr< XmlSchemaRemove (const SharedPtr< XmlSchema > &schema)
 
ASPOSECPP_SHARED_API bool RemoveRecursive (const SharedPtr< XmlSchema > &schemaToRemove)
 
ASPOSECPP_SHARED_API bool Contains (String targetNamespace)
 
ASPOSECPP_SHARED_API bool Contains (const SharedPtr< XmlSchema > &schema)
 
ASPOSECPP_SHARED_API void Compile ()
 
ASPOSECPP_SHARED_API SharedPtr< XmlSchemaReprocess (SharedPtr< XmlSchema > schema)
 
ASPOSECPP_SHARED_API void CopyTo (const ArrayPtr< SharedPtr< XmlSchema >> &schemas, int32_t index)
 
ASPOSECPP_SHARED_API SharedPtr< Collections::Generic::IList< SharedPtr< XmlSchema > > > Schemas ()
 
ASPOSECPP_SHARED_API SharedPtr< Collections::Generic::List< SharedPtr< XmlSchema > > > Schemas (String targetNamespace)
 
- 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)
 
template<>
bool Equals (double const &objA, double const &objB)
 
template<>
bool ReferenceEquals (String const &str, std::nullptr_t)
 
template<>
bool ReferenceEquals (String const &str1, String const &str2)
 

Protected Member Functions

virtual ASPOSECPP_SHARED_API ~XmlSchemaSet ()
 

Additional Inherited Members

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

Detailed Description

Contains a cache of XML Schema definition language (XSD) schemas.

Attention
Objects of this class should only be allocated using System::MakeObject() function. Never create instances of this type on stack or using operator new, as it will result in runtime errors and/or assertion faults. Always wrap this class into System::SmartPtr pointer and use this pointer to pass it to functions as argument.

Member Typedef Documentation

◆ Ptr

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

Constructor & Destructor Documentation

◆ XmlSchemaSet() [1/2]

ASPOSECPP_SHARED_API System::Xml::Schema::XmlSchemaSet::XmlSchemaSet ( )

Initializes a new instance of the XmlSchemaSet class.

◆ XmlSchemaSet() [2/2]

ASPOSECPP_SHARED_API System::Xml::Schema::XmlSchemaSet::XmlSchemaSet ( const SharedPtr< XmlNameTable > &  nameTable)

Initializes a new instance of the XmlSchemaSet class with the specified XmlNameTable.

Parameters
nameTableThe XmlNameTable object to use.
Exceptions
ArgumentNullExceptionThe XmlNameTable object passed as a parameter is nullptr.

◆ ~XmlSchemaSet()

virtual ASPOSECPP_SHARED_API System::Xml::Schema::XmlSchemaSet::~XmlSchemaSet ( )
protectedvirtual

Member Function Documentation

◆ Add() [1/4]

ASPOSECPP_SHARED_API SharedPtr<XmlSchema> System::Xml::Schema::XmlSchemaSet::Add ( String  targetNamespace,
const String schemaUri 
)

Adds the XML Schema definition language (XSD) schema at the URL specified to the XmlSchemaSet.

Parameters
targetNamespaceThe schema targetNamespace value, or nullptr to use the targetNamespace specified in the schema.
schemaUriThe URL that specifies the schema to load.
Returns
An XmlSchema object if the schema is valid. If the schema is not valid and a ValidationEventHandler is specified, then nullptr is returned and the appropriate validation event is raised. Otherwise, an XmlSchemaException is thrown.
Exceptions
XmlSchemaExceptionThe schema is not valid.
ArgumentNullExceptionThe URL passed as a parameter is nullptr or String::Empty.

◆ Add() [2/4]

ASPOSECPP_SHARED_API SharedPtr<XmlSchema> System::Xml::Schema::XmlSchemaSet::Add ( String  targetNamespace,
const SharedPtr< XmlReader > &  schemaDocument 
)

Adds the XML Schema definition language (XSD) schema contained in the XmlReader to the XmlSchemaSet.

Parameters
targetNamespaceThe schema targetNamespace value, or nullptr to use the targetNamespace specified in the schema.
schemaDocumentThe XmlReader object.
Returns
An XmlSchema object if the schema is valid. If the schema is not valid and a ValidationEventHandler is specified, then nullptr is returned and the appropriate validation event is raised. Otherwise, an XmlSchemaException is thrown.
Exceptions
XmlSchemaExceptionThe schema is not valid.
ArgumentNullExceptionThe XmlReader object passed as a parameter is nullptr.

◆ Add() [3/4]

ASPOSECPP_SHARED_API void System::Xml::Schema::XmlSchemaSet::Add ( const SharedPtr< XmlSchemaSet > &  schemas)

Adds all the XML Schema definition language (XSD) schemas in the given XmlSchemaSet to the XmlSchemaSet.

Parameters
schemasThe XmlSchemaSet object.
Exceptions
XmlSchemaExceptionA schema in the XmlSchemaSet is not valid.
ArgumentNullExceptionThe XmlSchemaSet object passed as a parameter is nullptr.

◆ Add() [4/4]

ASPOSECPP_SHARED_API SharedPtr<XmlSchema> System::Xml::Schema::XmlSchemaSet::Add ( const SharedPtr< XmlSchema > &  schema)

Adds the given XmlSchema to the XmlSchemaSet.

Parameters
schemaThe XmlSchema object to add to the XmlSchemaSet.
Returns
An XmlSchema object if the schema is valid. If the schema is not valid and a ValidationEventHandler is specified, then nullptr is returned and the appropriate validation event is raised. Otherwise, an XmlSchemaException is thrown.
Exceptions
XmlSchemaExceptionThe schema is not valid.
ArgumentNullExceptionThe XmlSchema object passed as a parameter is nullptr.

◆ Compile()

ASPOSECPP_SHARED_API void System::Xml::Schema::XmlSchemaSet::Compile ( )

Compiles the XML Schema definition language (XSD) schemas added to the XmlSchemaSet into one logical schema.

Exceptions
XmlSchemaExceptionAn error occurred when validating and compiling the schemas in the XmlSchemaSet.

◆ Contains() [1/2]

ASPOSECPP_SHARED_API bool System::Xml::Schema::XmlSchemaSet::Contains ( String  targetNamespace)

Indicates whether an XML Schema definition language (XSD) schema with the specified target namespace URI is in the XmlSchemaSet.

Parameters
targetNamespaceThe schema targetNamespace property.
Returns
true if a schema with the specified target namespace URI is in the XmlSchemaSet; otherwise, false.

◆ Contains() [2/2]

ASPOSECPP_SHARED_API bool System::Xml::Schema::XmlSchemaSet::Contains ( const SharedPtr< XmlSchema > &  schema)

Indicates whether the specified XML Schema definition language (XSD) XmlSchema object is in the XmlSchemaSet.

Parameters
schemaThe XmlSchema object.
Returns
true if the XmlSchema object is in the XmlSchemaSet; otherwise, false.
Exceptions
ArgumentNullExceptionThe XmlSchemaSet passed as a parameter is nullptr.

◆ CopyTo()

ASPOSECPP_SHARED_API void System::Xml::Schema::XmlSchemaSet::CopyTo ( const ArrayPtr< SharedPtr< XmlSchema >> &  schemas,
int32_t  index 
)

Copies all the XmlSchema objects from the XmlSchemaSet to the given array, starting at the given index.

Parameters
schemasThe array to copy the objects to.
indexThe index in the array where copying will begin.

◆ get_CompilationSettings()

ASPOSECPP_SHARED_API SharedPtr<XmlSchemaCompilationSettings> System::Xml::Schema::XmlSchemaSet::get_CompilationSettings ( )

◆ get_Count()

ASPOSECPP_SHARED_API int32_t System::Xml::Schema::XmlSchemaSet::get_Count ( )

Returns the number of logical XML Schema definition language (XSD) schemas in the XmlSchemaSet.

Returns
The number of logical schemas in the XmlSchemaSet.

◆ get_GlobalAttributes()

ASPOSECPP_SHARED_API SharedPtr<XmlSchemaObjectTable> System::Xml::Schema::XmlSchemaSet::get_GlobalAttributes ( )

Returns all the global attributes in all the XML Schema definition language (XSD) schemas in the XmlSchemaSet.

Returns
The collection of global attributes.

◆ get_GlobalElements()

ASPOSECPP_SHARED_API SharedPtr<XmlSchemaObjectTable> System::Xml::Schema::XmlSchemaSet::get_GlobalElements ( )

Returns all the global elements in all the XML Schema definition language (XSD) schemas in the XmlSchemaSet.

Returns
The collection of global elements.

◆ get_GlobalTypes()

ASPOSECPP_SHARED_API SharedPtr<XmlSchemaObjectTable> System::Xml::Schema::XmlSchemaSet::get_GlobalTypes ( )

Returns all of the global simple and complex types in all the XML Schema definition language (XSD) schemas in the XmlSchemaSet.

Returns
The collection of global simple and complex types.

◆ get_IsCompiled()

ASPOSECPP_SHARED_API bool System::Xml::Schema::XmlSchemaSet::get_IsCompiled ( )

Returns a value that indicates whether the XML Schema definition language (XSD) schemas in the XmlSchemaSet have been compiled.

Returns
true if the schemas in the XmlSchemaSet have been compiled since the last time a schema was added or removed from the XmlSchemaSet; otherwise, false.

◆ get_NameTable()

ASPOSECPP_SHARED_API SharedPtr<XmlNameTable> System::Xml::Schema::XmlSchemaSet::get_NameTable ( )

Returns the default XmlNameTable used by the XmlSchemaSet when loading new XML Schema definition language (XSD) schemas.

Returns
A table of atomized string objects.

◆ Remove()

ASPOSECPP_SHARED_API SharedPtr<XmlSchema> System::Xml::Schema::XmlSchemaSet::Remove ( const SharedPtr< XmlSchema > &  schema)

Removes the specified XML Schema definition language (XSD) schema from the XmlSchemaSet.

Parameters
schemaThe XmlSchema object to remove from the XmlSchemaSet.
Returns
The XmlSchema object removed from the XmlSchemaSet or nullptr if the schema was not found in the XmlSchemaSet.
Exceptions
XmlSchemaExceptionThe schema is not a valid schema.
ArgumentNullExceptionThe XmlSchema passed as a parameter is nullptr.

◆ RemoveRecursive()

ASPOSECPP_SHARED_API bool System::Xml::Schema::XmlSchemaSet::RemoveRecursive ( const SharedPtr< XmlSchema > &  schemaToRemove)

Removes the specified XML Schema definition language (XSD) schema and all the schemas it imports from the XmlSchemaSet.

Parameters
schemaToRemoveThe XmlSchema object to remove from the XmlSchemaSet.
Returns
true if the XmlSchema object and all its imports were successfully removed; otherwise, false.
Exceptions
ArgumentNullExceptionThe XmlSchema passed as a parameter is nullptr.

◆ Reprocess()

ASPOSECPP_SHARED_API SharedPtr<XmlSchema> System::Xml::Schema::XmlSchemaSet::Reprocess ( SharedPtr< XmlSchema schema)

Reprocesses an XML Schema definition language (XSD) schema that already exists in the XmlSchemaSet.

Parameters
schemaThe schema to reprocess.
Returns
An XmlSchema object if the schema is a valid schema. If the schema is not valid and a ValidationEventHandler is specified, nullptr is returned and the appropriate validation event is raised. Otherwise, an XmlSchemaException is thrown.
Exceptions
XmlSchemaExceptionThe schema is not valid.
ArgumentNullExceptionThe XmlSchema object passed as a parameter is nullptr.
ArgumentExceptionThe XmlSchema object passed as a parameter does not already exist in the XmlSchemaSet.

◆ Schemas() [1/2]

ASPOSECPP_SHARED_API SharedPtr<Collections::Generic::IList<SharedPtr<XmlSchema> > > System::Xml::Schema::XmlSchemaSet::Schemas ( )

Returns a collection of all the XML Schema definition language (XSD) schemas in the XmlSchemaSet.

Returns
An IList object containing all the schemas that have been added to the XmlSchemaSet. If no schemas have been added to the XmlSchemaSet, an empty collection is returned.

◆ Schemas() [2/2]

ASPOSECPP_SHARED_API SharedPtr<Collections::Generic::List<SharedPtr<XmlSchema> > > System::Xml::Schema::XmlSchemaSet::Schemas ( String  targetNamespace)

Returns a collection of all the XML Schema definition language (XSD) schemas in the XmlSchemaSet that belong to the given namespace.

Parameters
targetNamespaceThe schema targetNamespace property.
Returns
An IList object containing all the schemas that have been added to the XmlSchemaSet that belong to the given namespace. If no schemas have been added to the XmlSchemaSet, an empty collection is returned.

◆ set_CompilationSettings()

ASPOSECPP_SHARED_API void System::Xml::Schema::XmlSchemaSet::set_CompilationSettings ( const SharedPtr< XmlSchemaCompilationSettings > &  value)

Sets the XmlSchemaCompilationSettings for the XmlSchemaSet.

Parameters
valueThe value to set.

◆ set_XmlResolver()

ASPOSECPP_SHARED_API void System::Xml::Schema::XmlSchemaSet::set_XmlResolver ( const SharedPtr< System::Xml::XmlResolver > &  value)

Sets the XmlResolver used to resolve namespaces or locations referenced in include and import elements of a schema.

Parameters
valueThe value to set.

◆ ValidationEventHandler_add()

template<class... Args>
void System::Xml::Schema::XmlSchemaSet::ValidationEventHandler_add ( Args...  value)
inline

Adds an event handler for receiving information about XML Schema definition language (XSD) schema validation errors.

Parameters
valueA bound or static method or ValidationEventHandler instance.

◆ ValidationEventHandler_remove()

template<class... Args>
void System::Xml::Schema::XmlSchemaSet::ValidationEventHandler_remove ( Args...  value)
inline

Removes an event handler for receiving information about XML Schema definition language (XSD) schema validation errors.

Parameters
valueA bound or static method or ValidationEventHandler instance.