System::Net::CookieCollection Class Reference

Inherits System::Collections::Generic::ICollection< System::SharedPtr< System::Net::Cookie > >.

Public Types

enum  Stamp { Stamp::Check = 0, Stamp::Set = 1, Stamp::SetToUnused = 2, Stamp::SetToMaxUsed = 3 }
 Enumerates the timestamp set operations. More...
 
- Public Types inherited from System::Collections::Generic::ICollection< System::SharedPtr< System::Net::Cookie > >
typedef System::SharedPtr< System::Net::CookieValueType
 Value type name. More...
 
typedef ICollection< System::SharedPtr< System::Net::Cookie > > ThisType
 Collection type name. More...
 
- Public Types inherited from System::Collections::Generic::IEnumerable< System::SharedPtr< System::Net::Cookie > >
typedef IEnumerator< System::SharedPtr< System::Net::Cookie > > IEnumeratorType
 Enumerator type. More...
 
using ValueType = System::SharedPtr< System::Net::Cookie >
 
using iterator = System::Details::VirtualizedIterator< System::SharedPtr< System::Net::Cookie > >
 Iterator type. More...
 
using const_iterator = System::Details::VirtualizedConstIterator< System::SharedPtr< System::Net::Cookie > >
 Const iterator type. More...
 
using virtualized_iterator = System::Details::VirtualizedIteratorBase< System::SharedPtr< System::Net::Cookie > >
 Inner iterator base type. More...
 
using virtualized_iterator_element = System::SharedPtr< System::Net::Cookie >
 Inner iterator element type. More...
 
- Public Types inherited from System::Object
typedef SmartPtr< Objectptr
 Alias for smart pointer type. More...
 

Public Member Functions

ASPOSECPP_SHARED_API int32_t get_Count () const override
 
ASPOSECPP_SHARED_API bool get_IsOtherVersionSeen ()
 
ASPOSECPP_SHARED_API CookieCollection ()
 Constructs a new instance. More...
 
ASPOSECPP_SHARED_API System::SharedPtr< Cookieidx_get (int32_t index)
 
ASPOSECPP_SHARED_API System::SharedPtr< Cookieidx_get (String name)
 
ASPOSECPP_SHARED_API void Add (const System::SharedPtr< Cookie > &cookie) override
 
ASPOSECPP_SHARED_API bool Remove (const System::SharedPtr< Cookie > &cookie) override
 
ASPOSECPP_SHARED_API bool Contains (const System::SharedPtr< Cookie > &cookie) const override
 
ASPOSECPP_SHARED_API void Clear () override
 Removes all cookies from the collection. More...
 
ASPOSECPP_SHARED_API void Add (System::SharedPtr< CookieCollection > cookies)
 
ASPOSECPP_SHARED_API DateTime TimeStamp (CookieCollection::Stamp how)
 
ASPOSECPP_SHARED_API int32_t InternalAdd (System::SharedPtr< Cookie > cookie, bool isStrict)
 
ASPOSECPP_SHARED_API int32_t IndexOf (System::SharedPtr< Cookie > cookie)
 
ASPOSECPP_SHARED_API void RemoveAt (int32_t idx)
 
ASPOSECPP_SHARED_API System::SharedPtr< Collections::Generic::IEnumerator< System::SharedPtr< Cookie > > > GetEnumerator () override
 
ASPOSECPP_SHARED_API System::Details::VirtualizedIteratorBase< System::SharedPtr< Cookie > > * virtualizeBeginIterator () override
 
ASPOSECPP_SHARED_API System::Details::VirtualizedIteratorBase< System::SharedPtr< Cookie > > * virtualizeEndIterator () override
 
ASPOSECPP_SHARED_API System::Details::VirtualizedIteratorBase< System::SharedPtr< Cookie > > * virtualizeBeginConstIterator () const override
 
ASPOSECPP_SHARED_API System::Details::VirtualizedIteratorBase< System::SharedPtr< Cookie > > * virtualizeEndConstIterator () const override
 
- Public Member Functions inherited from System::Collections::Generic::ICollection< System::SharedPtr< System::Net::Cookie > >
virtual bool get_IsReadOnly () const
 
virtual void CopyTo (System::ArrayPtr< System::SharedPtr< System::Net::Cookie > > array, int arrayIndex)=0
 
ICollectionoperator= (ICollection &&) noexcept
 
ICollectionoperator= (const ICollection &)
 
 ICollection ()
 Default constructor. More...
 
 ICollection (const ICollection &)
 Copy constructor. More...
 
 ICollection (ICollection &&) noexcept
 Move constructor. More...
 
virtual ~ICollection ()
 Destructor. More...
 
SharedPtr< Objectget_SyncRoot () const
 Gets the object the collection is being synchronized through. More...
 
- Public Member Functions inherited from System::Collections::Generic::IEnumerable< System::SharedPtr< System::Net::Cookie > >
System::SharedPtr< System::Net::CookieLINQ_ElementAt (int index)
 
System::SharedPtr< System::Net::CookieLINQ_First ()
 
System::SharedPtr< System::Net::CookieLINQ_First (const Func< System::SharedPtr< System::Net::Cookie >, bool > &predicate)
 
System::SharedPtr< System::Net::CookieLINQ_FirstOrDefault ()
 
System::SharedPtr< System::Net::CookieLINQ_FirstOrDefault (std::function< bool(System::SharedPtr< System::Net::Cookie >)> predicate)
 
System::SharedPtr< System::Net::CookieLINQ_Last ()
 
System::SharedPtr< System::Net::CookieLINQ_LastOrDefault ()
 
SharedPtr< List< System::SharedPtr< System::Net::Cookie > > > LINQ_ToList ()
 
int LINQ_Count ()
 
int LINQ_Count (const Func< System::SharedPtr< System::Net::Cookie >, bool > &predicate)
 
System::ArrayPtr< System::SharedPtr< System::Net::Cookie > > LINQ_ToArray ()
 
bool LINQ_All (std::function< bool(System::SharedPtr< System::Net::Cookie >)> predicate)
 
bool LINQ_Any ()
 
bool LINQ_Any (std::function< bool(System::SharedPtr< System::Net::Cookie >)> predicate)
 
SharedPtr< IEnumerable< System::SharedPtr< System::Net::Cookie > > > LINQ_Where (std::function< bool(System::SharedPtr< System::Net::Cookie >)> predicate)
 
bool LINQ_Contains (System::SharedPtr< System::Net::Cookie > value)
 
SharedPtr< IEnumerable< ResultType > > LINQ_Cast ()
 
SharedPtr< IEnumerable< Result > > LINQ_Cast ()
 
SharedPtr< IEnumerable< System::SharedPtr< System::Net::Cookie > > > LINQ_OrderBy (const Func< System::SharedPtr< System::Net::Cookie >, Key > &keySelector)
 
SharedPtr< IEnumerable< Source > > LINQ_OrderBy (const Func< Source, Key > &keySelector)
 
SharedPtr< IEnumerable< System::SharedPtr< System::Net::Cookie > > > LINQ_OrderByDescending (const Func< System::SharedPtr< System::Net::Cookie >, Key > &keySelector)
 
SharedPtr< IEnumerable< Source > > LINQ_OrderByDescending (const Func< Source, Key > &keySelector)
 
SharedPtr< IEnumerable< ResultType > > LINQ_OfType ()
 
SharedPtr< IEnumerable< Result > > LINQ_OfType ()
 
SharedPtr< IEnumerable< ResultType > > LINQ_Select (const Func< System::SharedPtr< System::Net::Cookie >, ResultType > &selector)
 
SharedPtr< IEnumerable< ResultType > > LINQ_Select (const Func< System::SharedPtr< System::Net::Cookie >, int32_t, ResultType > &selector)
 
SharedPtr< IEnumerable< Result > > LINQ_Select (const Func< Source, Result > &selector)
 
SharedPtr< IEnumerable< Result > > LINQ_Select (const Func< Source, int32_t, Result > &selector)
 
SharedPtr< IEnumerable< System::SharedPtr< System::Net::Cookie > > > LINQ_Concat (SharedPtr< IEnumerable< System::SharedPtr< System::Net::Cookie > >> sequence)
 
System::SharedPtr< IEnumerable< System::SharedPtr< System::Linq::IGrouping< Key, System::SharedPtr< System::Net::Cookie > > > > > LINQ_GroupBy (System::Func< System::SharedPtr< System::Net::Cookie >, Key > keyPredicate)
 
SharedPtr< IEnumerable< SharedPtr< System::Linq::IGrouping< Key, Source > > > > LINQ_GroupBy (System::Func< Source, Key > keyPredicate)
 
SharedPtr< IEnumerable< ResultType > > LINQ_SelectMany (const Func< System::SharedPtr< System::Net::Cookie >, SharedPtr< IEnumerable< ResultType >>> &selector)
 
SharedPtr< IEnumerable< Result > > LINQ_SelectMany (const Func< Source, SharedPtr< IEnumerable< Result >>> &selector)
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
const_iterator cbegin () const
 
const_iterator cend () const
 
- 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)
 
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)
 

Additional Inherited Members

- 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

Represents a list of sorted cookies. 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.

Member Enumeration Documentation

◆ Stamp

Enumerates the timestamp set operations.

Enumerator
Check 

Do nothing.

Set 

Set the current datetime.

SetToUnused 

Set the minimal value.

SetToMaxUsed 

Set the maximum value.

Constructor & Destructor Documentation

◆ CookieCollection()

ASPOSECPP_SHARED_API System::Net::CookieCollection::CookieCollection ( )

Constructs a new instance.

Member Function Documentation

◆ Add() [1/2]

ASPOSECPP_SHARED_API void System::Net::CookieCollection::Add ( const System::SharedPtr< Cookie > &  cookie)
overridevirtual

Adds a cookie to the collection.

Parameters
cookieThe cookie to add.

Implements System::Collections::Generic::ICollection< System::SharedPtr< System::Net::Cookie > >.

◆ Add() [2/2]

ASPOSECPP_SHARED_API void System::Net::CookieCollection::Add ( System::SharedPtr< CookieCollection cookies)

Adds cookies from the specified collection to the current one.

Parameters
cookiesThe collection from which cookies will be copied to the current one.

◆ Clear()

ASPOSECPP_SHARED_API void System::Net::CookieCollection::Clear ( )
overridevirtual

◆ Contains()

ASPOSECPP_SHARED_API bool System::Net::CookieCollection::Contains ( const System::SharedPtr< Cookie > &  cookie) const
overridevirtual

Checks if the collection contains the specified cookie.

Parameters
cookieThe cookie to check.
Returns
True when the collection contains the specified cookie, otherwise false.

Implements System::Collections::Generic::ICollection< System::SharedPtr< System::Net::Cookie > >.

◆ get_Count()

ASPOSECPP_SHARED_API int32_t System::Net::CookieCollection::get_Count ( ) const
overridevirtual

Gets number of elements in collection.

Returns
Number of elements.

Implements System::Collections::Generic::ICollection< System::SharedPtr< System::Net::Cookie > >.

◆ get_IsOtherVersionSeen()

ASPOSECPP_SHARED_API bool System::Net::CookieCollection::get_IsOtherVersionSeen ( )

Returns a value that indicates if the collection contains a cookie with a version that is not equal to Cookie::MaxSupportedVersion.

Returns
True when the collection contains a cookie with a version that is not equal to Cookie::MaxSupportedVersion, otherwise false.

◆ GetEnumerator()

ASPOSECPP_SHARED_API System::SharedPtr<Collections::Generic::IEnumerator<System::SharedPtr<Cookie> > > System::Net::CookieCollection::GetEnumerator ( )
overridevirtual

Gets enumerator.

Returns
Pointer to newly created enumerator object which can be used to iterate through interfaced object.

Implements System::Collections::Generic::IEnumerable< System::SharedPtr< System::Net::Cookie > >.

◆ idx_get() [1/2]

ASPOSECPP_SHARED_API System::SharedPtr<Cookie> System::Net::CookieCollection::idx_get ( int32_t  index)

Returns a cookie from the cookie collection at the specified index.

Parameters
indexThe index of a cookie that must be returned.
Returns
A cookie at the specified index.

◆ idx_get() [2/2]

ASPOSECPP_SHARED_API System::SharedPtr<Cookie> System::Net::CookieCollection::idx_get ( String  name)

Returns a cookie from the cookie collection by specified name.

Parameters
nameThe name of a cookie that must be returned.
Returns
A cookie from the cookie collection by specified name when it is found, otherwise nullptr.

◆ IndexOf()

ASPOSECPP_SHARED_API int32_t System::Net::CookieCollection::IndexOf ( System::SharedPtr< Cookie cookie)

Returns an index of the specified cookie.

Parameters
cookieThe cookie to search for.
Returns
An index of the specified cookie if it's found, otherwise -1.

◆ InternalAdd()

ASPOSECPP_SHARED_API int32_t System::Net::CookieCollection::InternalAdd ( System::SharedPtr< Cookie cookie,
bool  isStrict 
)

Adds the specified cookie to the collection.

Parameters
cookieThe cookie to add.
isStrictTrue when the specified cookie must replace the old one, otherwise false.
Returns
0 when the specified cookie replaced the old one, otherwise 1.

◆ Remove()

ASPOSECPP_SHARED_API bool System::Net::CookieCollection::Remove ( const System::SharedPtr< Cookie > &  cookie)
overridevirtual

Removes the specified cookie from the collection.

Parameters
cookieThe cookie to remove.
Returns
True when the specified cookie is removed successfully, otherwise false.
Exceptions
System::NotImplementedException

Implements System::Collections::Generic::ICollection< System::SharedPtr< System::Net::Cookie > >.

◆ RemoveAt()

ASPOSECPP_SHARED_API void System::Net::CookieCollection::RemoveAt ( int32_t  idx)

Removes a cookie at the specified index.

Parameters
idxAn index of a cookie that must be removed.

◆ TimeStamp()

ASPOSECPP_SHARED_API DateTime System::Net::CookieCollection::TimeStamp ( CookieCollection::Stamp  how)

Updates the timestamp by specified scenario and returns a new value.

Parameters
howThe update scenario.
Returns
A new timestamp value.

◆ virtualizeBeginConstIterator()

ASPOSECPP_SHARED_API System::Details::VirtualizedIteratorBase<System::SharedPtr<Cookie> >* System::Net::CookieCollection::virtualizeBeginConstIterator ( ) const
overridevirtual

Gets the implementation of begin const iterator for the current container.

Returns
Pointer to the newly created iterator kernel object.

Reimplemented from System::Collections::Generic::IEnumerable< System::SharedPtr< System::Net::Cookie > >.

◆ virtualizeBeginIterator()

ASPOSECPP_SHARED_API System::Details::VirtualizedIteratorBase<System::SharedPtr<Cookie> >* System::Net::CookieCollection::virtualizeBeginIterator ( )
overridevirtual

Gets the implementation of begin iterator for the current container.

Returns
Pointer to the newly created iterator kernel object.

Reimplemented from System::Collections::Generic::IEnumerable< System::SharedPtr< System::Net::Cookie > >.

◆ virtualizeEndConstIterator()

ASPOSECPP_SHARED_API System::Details::VirtualizedIteratorBase<System::SharedPtr<Cookie> >* System::Net::CookieCollection::virtualizeEndConstIterator ( ) const
overridevirtual

Gets the implementation of end const iterator for the current container.

Returns
Pointer to the newly created iterator kernel object.

Reimplemented from System::Collections::Generic::IEnumerable< System::SharedPtr< System::Net::Cookie > >.

◆ virtualizeEndIterator()

ASPOSECPP_SHARED_API System::Details::VirtualizedIteratorBase<System::SharedPtr<Cookie> >* System::Net::CookieCollection::virtualizeEndIterator ( )
overridevirtual

Gets the implementation of end iterator for the current container.

Returns
Pointer to the newly created iterator kernel object.

Reimplemented from System::Collections::Generic::IEnumerable< System::SharedPtr< System::Net::Cookie > >.