Asposecpplib
System::Xml::XPath::XPathExpression Class Referenceabstract

Provides a typed class that represents a compiled XPath expression. More...

Inherits System::Object.

Public Types

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

Public Member Functions

virtual String get_Expression ()=0
 When overridden in a derived class, gets a string representation of the XPathExpression. More...
 
virtual XPathResultType get_ReturnType ()=0
 When overridden in a derived class, gets the result type of the XPath expression. More...
 
virtual void AddSort (SharedPtr< Object > expr, SharedPtr< Collections::Generic::IComparer< SharedPtr< Object >>> comparer)=0
 When overridden in a derived class, sorts the nodes selected by the XPath expression according to the specified IComparer object. More...
 
virtual void AddSort (SharedPtr< Object > expr, XmlSortOrder order, XmlCaseOrder caseOrder, String lang, XmlDataType dataType)=0
 When overridden in a derived class, sorts the nodes selected by the XPath expression according to the supplied parameters. More...
 
virtual SharedPtr< XPathExpressionClone ()=0
 When overridden in a derived class, returns a clone of this XPathExpression. More...
 
virtual void SetContext (SharedPtr< XmlNamespaceManager > nsManager)=0
 When overridden in a derived class, specifies the XmlNamespaceManager object to use for namespace resolution. More...
 
virtual void SetContext (SharedPtr< IXmlNamespaceResolver > nsResolver)=0
 When overridden in a derived class, specifies the IXmlNamespaceResolver object to use for namespace resolution. More...
 
- Public Member Functions inherited from System::Object
 Object ()
 Creates object. Initializes all internal data structures. More...
 
virtual ~Object ()
 Destroys object. Frees all internal data structures. More...
 
 Object (Object const &x)
 Copy constructor. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses. More...
 
Objectoperator= (Object const &x)
 Assignment operator. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses. More...
 
ObjectSharedRefAdded ()
 Increments shared reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
int SharedRefRemovedSafe ()
 Decrements and returns shared reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
int RemovedSharedRefs (int count)
 Decreases shared reference count by specified value. More...
 
Detail::SmartPtrCounter * WeakRefAdded ()
 Increments weak reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
void WeakRefRemoved ()
 Decrements weak reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
Detail::SmartPtrCounter * GetCounter ()
 Gets reference counter data structure associated with the object. More...
 
int SharedCount () const
 Gets current value of shared reference counter. More...
 
void Lock ()
 Implements C# lock() statement locking. Call directly or use LockContext sentry object. More...
 
void Unlock ()
 Implements C# lock() statement unlocking. Call directly or use LockContext sentry object. More...
 
virtual bool Equals (ptr obj)
 Compares objects using C# Object.Equals semantics. More...
 
virtual int32_t GetHashCode () const
 Analog of C# Object.GetHashCode() method. Enables hashing of custom objects. More...
 
virtual String ToString () const
 Analog of C# Object.ToString() method. Enables converting custom objects to string. More...
 
virtual ptr MemberwiseClone () const
 Analog of C# Object.MemberwiseClone() method. Enables cloning custom types. More...
 
virtual const TypeInfoGetType () const
 Gets actual type of object. Analog of C# System.Object.GetType() call. More...
 
virtual bool Is (const TypeInfo &targetType) const
 Check if object represents an instance of type described by targetType. Analog of C# 'is' operator. More...
 
virtual void SetTemplateWeakPtr (uint32_t argument)
 Set n'th template argument a weak pointer (rather than shared). Allows switching pointers in containers to weak mode. More...
 
virtual bool FastCast (const Details::FastRttiBase &helper, void **out_ptr) const
 For internal purposes only. More...
 
template<>
bool ReferenceEquals (String const &str, std::nullptr_t)
 Specialization of Object::ReferenceEquals for case of string and nullptr. More...
 
template<>
bool ReferenceEquals (String const &str1, String const &str2)
 Specialization of Object::ReferenceEquals for case of strings. More...
 

Static Public Member Functions

static SharedPtr< XPathExpressionCompile (const String &xpath)
 Compiles the XPath expression specified and returns an XPathExpression object representing the XPath expression. More...
 
static SharedPtr< XPathExpressionCompile (const String &xpath, const SharedPtr< IXmlNamespaceResolver > &nsResolver)
 Compiles the specified XPath expression, with the IXmlNamespaceResolver object specified for namespace resolution, and returns an XPathExpression object that represents the XPath expression. 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...
 

Detailed Description

Provides a typed class that represents a compiled XPath expression.

Member Typedef Documentation

◆ Ptr

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

Member Function Documentation

◆ AddSort() [1/2]

virtual void System::Xml::XPath::XPathExpression::AddSort ( SharedPtr< Object expr,
SharedPtr< Collections::Generic::IComparer< SharedPtr< Object >>>  comparer 
)
pure virtual

When overridden in a derived class, sorts the nodes selected by the XPath expression according to the specified IComparer object.

Parameters
exprAn object representing the sort key. This can be the string value of the node or an XPathExpression object with a compiled XPath expression.
comparerAn IComparer object that provides the specific data type comparisons for comparing two objects for equivalence.
Exceptions
XPathExceptionThe XPathExpression or sort key includes a prefix and either an XmlNamespaceManager is not provided, or the prefix cannot be found in the supplied XmlNamespaceManager.

◆ AddSort() [2/2]

virtual void System::Xml::XPath::XPathExpression::AddSort ( SharedPtr< Object expr,
XmlSortOrder  order,
XmlCaseOrder  caseOrder,
String  lang,
XmlDataType  dataType 
)
pure virtual

When overridden in a derived class, sorts the nodes selected by the XPath expression according to the supplied parameters.

Parameters
exprAn object representing the sort key. This can be the string value of the node or an XPathExpression object with a compiled XPath expression.
orderAn XmlSortOrder value indicating the sort order.
caseOrderAn XmlCaseOrder value indicating how to sort uppercase and lowercase letters.
langThe language to use for comparison. Uses the Globalization::CultureInfo class that can be passed to the String::Compare method for the language types, for example, "us-en" for U.S. English. If an empty string is specified, the system environment is used to determine the Globalization::CultureInfo.
dataTypeAn XmlDataType value indicating the sort order for the data type.
Exceptions
XPathExceptionThe XPathExpression or sort key includes a prefix and either an XmlNamespaceManager is not provided, or the prefix cannot be found in the supplied XmlNamespaceManager.

◆ Clone()

virtual SharedPtr<XPathExpression> System::Xml::XPath::XPathExpression::Clone ( )
pure virtual

When overridden in a derived class, returns a clone of this XPathExpression.

Returns
A new XPathExpression object.

◆ Compile() [1/2]

static SharedPtr<XPathExpression> System::Xml::XPath::XPathExpression::Compile ( const String xpath)
static

Compiles the XPath expression specified and returns an XPathExpression object representing the XPath expression.

Parameters
xpathAn XPath expression.
Returns
An XPathExpression object.
Exceptions
ArgumentExceptionThe XPath expression parameter is not a valid XPath expression.
XPathExceptionThe XPath expression is not valid.

◆ Compile() [2/2]

static SharedPtr<XPathExpression> System::Xml::XPath::XPathExpression::Compile ( const String xpath,
const SharedPtr< IXmlNamespaceResolver > &  nsResolver 
)
static

Compiles the specified XPath expression, with the IXmlNamespaceResolver object specified for namespace resolution, and returns an XPathExpression object that represents the XPath expression.

Parameters
xpathAn XPath expression.
nsResolverAn object that implements the IXmlNamespaceResolver interface for namespace resolution.
Returns
An XPathExpression object.
Exceptions
ArgumentExceptionThe XPath expression parameter is not a valid XPath expression.
XPathExceptionThe XPath expression is not valid.

◆ get_Expression()

virtual String System::Xml::XPath::XPathExpression::get_Expression ( )
pure virtual

When overridden in a derived class, gets a string representation of the XPathExpression.

Returns
A string representation of the XPathExpression.

◆ get_ReturnType()

virtual XPathResultType System::Xml::XPath::XPathExpression::get_ReturnType ( )
pure virtual

When overridden in a derived class, gets the result type of the XPath expression.

Returns
An XPathResultType value representing the result type of the XPath expression.

◆ SetContext() [1/2]

virtual void System::Xml::XPath::XPathExpression::SetContext ( SharedPtr< IXmlNamespaceResolver nsResolver)
pure virtual

When overridden in a derived class, specifies the IXmlNamespaceResolver object to use for namespace resolution.

Parameters
nsResolverAn object that implements the IXmlNamespaceResolver interface to use for namespace resolution.
Exceptions
XPathExceptionThe IXmlNamespaceResolver object parameter is not derived from IXmlNamespaceResolver.

◆ SetContext() [2/2]

virtual void System::Xml::XPath::XPathExpression::SetContext ( SharedPtr< XmlNamespaceManager nsManager)
pure virtual

When overridden in a derived class, specifies the XmlNamespaceManager object to use for namespace resolution.

Parameters
nsManagerAn XmlNamespaceManager object to use for namespace resolution.
Exceptions
XPathExceptionThe XmlNamespaceManager object parameter is not derived from the XmlNamespaceManager class.