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

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

#include "xpath_expression.h"

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 ASPOSECPP_SHARED_API String get_Expression ()=0
 When overridden in a derived class, gets a string representation of the XPathExpression. More...
 
virtual ASPOSECPP_SHARED_API XPathResultType get_ReturnType ()=0
 When overridden in a derived class, gets the result type of the XPath expression. More...
 
virtual ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API 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 ASPOSECPP_SHARED_API SharedPtr< XPathExpressionClone ()=0
 When overridden in a derived class, returns a clone of this XPathExpression. More...
 
virtual ASPOSECPP_SHARED_API void SetContext (SharedPtr< XmlNamespaceManager > nsManager)=0
 When overridden in a derived class, specifies the XmlNamespaceManager object to use for namespace resolution. More...
 
virtual ASPOSECPP_SHARED_API 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
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...
 

Static Public Member Functions

static ASPOSECPP_SHARED_API SharedPtr< XPathExpressionCompile (const String &xpath)
 Compiles the XPath expression specified and returns an XPathExpression object representing the XPath expression. More...
 
static ASPOSECPP_SHARED_API 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...
 

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

◆ SetContext() [2/2]

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