System::Security::SecurityElement Class Referencefinal

Inherits System::Object.

Public Member Functions

 SecurityElement (const String &tag)
 
 SecurityElement (const String &tag, const String &text)
 
System::Collections::Generic::Dictionary< String, Stringget_Attributes ()
 
void set_Attributes (System::Collections::Generic::Dictionary< String, String > value)
 
System::Collections::Generic::ArrayList< SecurityElementget_Children ()
 
void set_Children (System::Collections::Generic::ArrayList< SecurityElement > value)
 
String get_Tag ()
 
void set_Tag (const String &value)
 
String get_Text ()
 
void set_Text (const String &value)
 
void AddAttribute (const String &name, const String &value)
 
void AddChild (SecurityElement child)
 
String Attribute (const String &name)
 
SecurityElement Copy ()
 
bool Equal (SecurityElement other)
 
SecurityElement SearchForChildByTag (const String &tag)
 
String SearchForTextOfTag (const String &tag)
 
String ToString () ASPOSE_CONST override
 
- 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 refernce 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 int GetHashCode () const
 Analog of C# Object.GetHashCode() method. Enables hashing of custom objects. 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 (unsigned int argument)
 Set n'th template argument a weak pointer (rather than shared). Allows switching pointers in containers to weak mode. 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)
 

Static Public Member Functions

static String Escape (const String &str)
 
static SecurityElement FromString (const String &xml)
 
static bool IsValidAttributeName (const String &name)
 
static bool IsValidAttributeValue (const String &value)
 
static bool IsValidTag (const String &tag)
 
static bool IsValidText (const String &text)
 
- 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 ()
 Impleemnts C# typeof(System.Object) construct. More...
 

Additional Inherited Members

- Public Types inherited from System::Object
typedef SmartPtr< Objectptr
 Alias for smart pointer type. More...
 
typedef System::Details::SharedMembersType shared_members_type
 structure to keep list of shared pointers contained in object. More...
 

Detailed Description

XML object model for encoding security object. Not implemented. Objects of this class should only be allocated using System::MakeObject() function. Never create instance 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.

Constructor & Destructor Documentation

◆ SecurityElement() [1/2]

System::Security::SecurityElement::SecurityElement ( const String tag)

Constructor.

Parameters
tagXML tag name.

◆ SecurityElement() [2/2]

System::Security::SecurityElement::SecurityElement ( const String tag,
const String text 
)

Constructor.

Parameters
tagXML tag name.
textXML text inside given tag.

Member Function Documentation

◆ AddAttribute()

void System::Security::SecurityElement::AddAttribute ( const String name,
const String value 
)

Adds attribute to tag.

Parameters
nameAttribute name.
valueAttribute value.

◆ AddChild()

void System::Security::SecurityElement::AddChild ( SecurityElement  child)

Adds child tag.

Parameters
childTag to add as a child.

◆ Attribute()

String System::Security::SecurityElement::Attribute ( const String name)

Gets attribute value.

Returns
Attribute value or null if not found.

◆ Copy()

SecurityElement System::Security::SecurityElement::Copy ( )

Clones tag.

Returns
Tag copy.

◆ Equal()

bool System::Security::SecurityElement::Equal ( SecurityElement  other)

Checks for parameters equality.

Parameters
otherTag to compare to.
Returns
True if tags match, false otherwise.

◆ Escape()

static String System::Security::SecurityElement::Escape ( const String str)
inlinestatic

Escapes characters in XML string.

Parameters
strString to escape.
Returns
Escaped string.

◆ FromString()

static SecurityElement System::Security::SecurityElement::FromString ( const String xml)
static

Creates element from XML code.

Parameters
xmlXML code.
Returns
Newly created element.

◆ get_Attributes()

System::Collections::Generic::Dictionary<String, String> System::Security::SecurityElement::get_Attributes ( )

Gets tag attributes.

Returns
Attributes keys and values collection.

◆ get_Children()

System::Collections::Generic::ArrayList<SecurityElement> System::Security::SecurityElement::get_Children ( )

Gets tag child objects.

Returns
List of child elements.

◆ get_Tag()

String System::Security::SecurityElement::get_Tag ( )

Gets tag name.

Returns
Tag name.

◆ get_Text()

String System::Security::SecurityElement::get_Text ( )

Gets tag inner text.

Returns
Tag inner text.

◆ IsValidAttributeName()

static bool System::Security::SecurityElement::IsValidAttributeName ( const String name)
static

Checks if attribute name is valid.

Parameters
nameName to check.
Returns
True if name is valid, false otherwise.

◆ IsValidAttributeValue()

static bool System::Security::SecurityElement::IsValidAttributeValue ( const String value)
static

Checks if attribute value is valid.

Parameters
valueValue to check.
Returns
True if value is valid, false otherwise.

◆ IsValidTag()

static bool System::Security::SecurityElement::IsValidTag ( const String tag)
static

Checks if tag is valid.

Parameters
tagTag to test.
Returns
True if tag is valid, false otherwise.

◆ IsValidText()

static bool System::Security::SecurityElement::IsValidText ( const String text)
static

Checks if text is valid.

Parameters
textText to test.
Returns
True if text is valid, false otherwise.

◆ SearchForChildByTag()

SecurityElement System::Security::SecurityElement::SearchForChildByTag ( const String tag)

Gets child tag by name.

Parameters
tagTag name to look for.
Returns
Child element or null if not found.

◆ SearchForTextOfTag()

String System::Security::SecurityElement::SearchForTextOfTag ( const String tag)

Gets child tag inner text by tag name.

Parameters
tagTag name to look for.
Returns
Text of the first tag with specified name or null if not found.

◆ set_Attributes()

void System::Security::SecurityElement::set_Attributes ( System::Collections::Generic::Dictionary< String, String value)

Sets tag attributes.

Parameters
valueAttributes keys and values collection.

◆ set_Children()

void System::Security::SecurityElement::set_Children ( System::Collections::Generic::ArrayList< SecurityElement value)

Sets tag child objects.

Parameters
valueList of child elements.

◆ set_Tag()

void System::Security::SecurityElement::set_Tag ( const String value)

Sets tag name.

Parameters
valueTag name.

◆ set_Text()

void System::Security::SecurityElement::set_Text ( const String value)

Sets tag inner text.

Parameters
valueTag inner text.

◆ ToString()

String System::Security::SecurityElement::ToString ( )
overridevirtual

Converts tag to string.

Returns
XML code.

Reimplemented from System::Object.