Asposecpplib
System::Collections::Specialized::StringCollection Class Reference

Indexed list of strings. 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...

Inherits System::Object, and System::Collections::Generic::IEnumerable< System::String >.

Classes

class  Enumerator
 Enumerator type to iterate through string collection. More...
 

Public Member Functions

ASPOSECPP_SHARED_API StringCollection ()
 Constructs empty string collection. More...
 
SharedPtr< Generic::IEnumerator< System::String > > GetEnumerator () override
 Gets enumerator iterating through current collection. More...
 
ASPOSECPP_SHARED_API int get_Count () const
 Gets number of elements in collection. More...
 
ASPOSECPP_SHARED_API System::Stringoperator[] (int index)
 Accessor function. More...
 
ASPOSECPP_SHARED_API System::String idx_get (int index) const
 Gets value at specified position. More...
 
ASPOSECPP_SHARED_API void idx_set (int index, const System::String &value)
 Sets value at specified position. More...
 
ASPOSECPP_SHARED_API int Add (const System::String &value)
 Adds value to the end of the list. More...
 
ASPOSECPP_SHARED_API void AddRange (const ArrayPtr< System::String > &range)
 Add elements into container. More...
 
ASPOSECPP_SHARED_API void CopyTo (const ArrayPtr< System::String > &arr, const int32_t index) const
 Copy elements to existing arra elements. More...
 
ASPOSECPP_SHARED_API void Clear ()
 Deletes all elements. More...
 
ASPOSECPP_SHARED_API bool Contains (const System::String &value) const
 Checks whether specific string is present in container. More...
 
ASPOSECPP_SHARED_API int IndexOf (const System::String &value) const
 Looks for specific string in container. More...
 
ASPOSECPP_SHARED_API void Insert (int index, const System::String &value)
 Inserts specific value into container. More...
 
ASPOSECPP_SHARED_API void Remove (const System::String &value)
 Removes first occurrence of specified string. More...
 
ASPOSECPP_SHARED_API void RemoveAt (int index)
 Removes element at specified position. More...
 
ASPOSECPP_SHARED_API std::vector< System::String > & data ()
 Internal data structure accessor. More...
 
ASPOSECPP_SHARED_API const std::vector< System::String > & data () const
 Internal data structure accessor. 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 refernce 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 int GetHashCode () const
 Analog of C# Object.GetHashCode() method. Enables hashing of custom objects. More...
 
virtual ASPOSECPP_SHARED_API String ToString () ASPOSE_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 (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)
 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...
 

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...
 
- Public Types inherited from System::Collections::Generic::IEnumerable< System::String >
typedef IEnumerator< System::StringIEnumeratorType
 Enumerator type. 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 ()
 Impleemnts C# typeof(System.Object) construct. More...
 

Detailed Description

Indexed list of strings. 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

◆ StringCollection()

ASPOSECPP_SHARED_API System::Collections::Specialized::StringCollection::StringCollection ( )

Constructs empty string collection.

Member Function Documentation

◆ Add()

ASPOSECPP_SHARED_API int System::Collections::Specialized::StringCollection::Add ( const System::String value)

Adds value to the end of the list.

Parameters
valueString to add.
Returns
Index of inserted element.

◆ AddRange()

ASPOSECPP_SHARED_API void System::Collections::Specialized::StringCollection::AddRange ( const ArrayPtr< System::String > &  range)

Add elements into container.

Parameters
rangeContainer of elements to insert.

◆ Clear()

ASPOSECPP_SHARED_API void System::Collections::Specialized::StringCollection::Clear ( )

Deletes all elements.

◆ Contains()

ASPOSECPP_SHARED_API bool System::Collections::Specialized::StringCollection::Contains ( const System::String value) const

Checks whether specific string is present in container.

Parameters
valueString to look for.
Returns
True if string is found, false otherwise.

◆ CopyTo()

ASPOSECPP_SHARED_API void System::Collections::Specialized::StringCollection::CopyTo ( const ArrayPtr< System::String > &  arr,
const int32_t  index 
) const

Copy elements to existing arra elements.

Parameters
arrArray to copy data to.
indexIndex in destination array to start data copying at.

◆ data() [1/2]

ASPOSECPP_SHARED_API std::vector<System::String>& System::Collections::Specialized::StringCollection::data ( )

Internal data structure accessor.

Returns
Reference to internal data structure.

◆ data() [2/2]

ASPOSECPP_SHARED_API const std::vector<System::String>& System::Collections::Specialized::StringCollection::data ( ) const

Internal data structure accessor.

Returns
Const reference to internal data structure.

◆ get_Count()

ASPOSECPP_SHARED_API int System::Collections::Specialized::StringCollection::get_Count ( ) const

Gets number of elements in collection.

Returns
Actual element count.

◆ GetEnumerator()

SharedPtr<Generic::IEnumerator<System::String> > System::Collections::Specialized::StringCollection::GetEnumerator ( )
inlineoverridevirtual

Gets enumerator iterating through current collection.

Returns
Newly created enumerator iterating through current collection.

Implements System::Collections::Generic::IEnumerable< System::String >.

◆ idx_get()

ASPOSECPP_SHARED_API System::String System::Collections::Specialized::StringCollection::idx_get ( int  index) const

Gets value at specified position.

Parameters
indexIndex to get string from.
Returns
String at specified position.

◆ idx_set()

ASPOSECPP_SHARED_API void System::Collections::Specialized::StringCollection::idx_set ( int  index,
const System::String value 
)

Sets value at specified position.

Parameters
indexIndex to set string at.
valueString value to set at specified index.

◆ IndexOf()

ASPOSECPP_SHARED_API int System::Collections::Specialized::StringCollection::IndexOf ( const System::String value) const

Looks for specific string in container.

Parameters
valueString to look for.
Returns
Index of first occurrence of specified string or -1 if not found.

◆ Insert()

ASPOSECPP_SHARED_API void System::Collections::Specialized::StringCollection::Insert ( int  index,
const System::String value 
)

Inserts specific value into container.

Parameters
indexIndex to insert string into.
valueValue to insert into specified position.

◆ operator[]()

ASPOSECPP_SHARED_API System::String& System::Collections::Specialized::StringCollection::operator[] ( int  index)

Accessor function.

Parameters
indexIndex to get element at.
Returns
Reference to string at specified position, either existing or newly created.

◆ Remove()

ASPOSECPP_SHARED_API void System::Collections::Specialized::StringCollection::Remove ( const System::String value)

Removes first occurrence of specified string.

Parameters
valueString to remove.

◆ RemoveAt()

ASPOSECPP_SHARED_API void System::Collections::Specialized::StringCollection::RemoveAt ( int  index)

Removes element at specified position.

Parameters
indexIndex to remove element at.