CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
System::Security::SecurityElement Class Referencefinal

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

#include <security_element.h>

Inherits System::Object.

Public Member Functions

 SecurityElement (const String &tag)
 Constructor. More...
 
 SecurityElement (const String &tag, const String &text)
 Constructor. More...
 
System::Collections::Generic::Dictionary< String, Stringget_Attributes ()
 Gets tag attributes. More...
 
void set_Attributes (System::Collections::Generic::Dictionary< String, String > value)
 Sets tag attributes. More...
 
System::Collections::Generic::List< SecurityElementget_Children ()
 Gets tag child objects. More...
 
void set_Children (System::Collections::Generic::List< SecurityElement > value)
 Sets tag child objects. More...
 
String get_Tag ()
 Gets tag name. More...
 
void set_Tag (const String &value)
 Sets tag name. More...
 
String get_Text ()
 Gets tag inner text. More...
 
void set_Text (const String &value)
 Sets tag inner text. More...
 
void AddAttribute (const String &name, const String &value)
 Adds attribute to tag. More...
 
void AddChild (SecurityElement child)
 Adds child tag. More...
 
String Attribute (const String &name)
 Gets attribute value. More...
 
SecurityElement Copy ()
 Clones tag. More...
 
bool Equal (SecurityElement other)
 Checks for parameters equality. More...
 
SecurityElement SearchForChildByTag (const String &tag)
 Gets child tag by name. More...
 
String SearchForTextOfTag (const String &tag)
 Gets child tag inner text by tag name. More...
 
String ToString () const override
 Converts tag to string. 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 String Escape (const String &str)
 Escapes characters in XML string. More...
 
static SecurityElement FromString (const String &xml)
 Creates element from XML code. More...
 
static bool IsValidAttributeName (const String &name)
 Checks if attribute name is valid. More...
 
static bool IsValidAttributeValue (const String &value)
 Checks if attribute value is valid. More...
 
static bool IsValidTag (const String &tag)
 Checks if tag is valid. More...
 
static bool IsValidText (const String &text)
 Checks if text is valid. 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...
 

Additional Inherited Members

- Public Types inherited from System::Object
typedef SmartPtr< Objectptr
 Alias for smart pointer type. 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::List< 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::List< 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 ( ) const
overridevirtual

Converts tag to string.

Returns
XML code.

Reimplemented from System::Object.