CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
System::Net::Cookie Class Referencefinal

Represents an HTTP cookie. 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 <cookie.h>

Inherits System::Object.

Public Member Functions

String get_Comment () const
 Gets the 'Comment' attribute's value. More...
 
void set_Comment (String value)
 Sets the 'Comment' attribute's value. More...
 
System::SharedPtr< Uriget_CommentUri () const
 Gets the 'CommentURL' attribute's value. More...
 
void set_CommentUri (System::SharedPtr< Uri > value)
 Sets the 'CommentURL' attribute's value. More...
 
bool get_HttpOnly () const
 Gets the 'HttpOnly' attribute's value. More...
 
void set_HttpOnly (bool value)
 Sets the 'HttpOnly' attribute's value. More...
 
bool get_Discard () const
 Gets the 'Discard' attribute's value. More...
 
void set_Discard (bool value)
 Sets the 'Discard' attribute's value. More...
 
String get_Domain () const
 Gets the 'Domain' attribute's value. More...
 
void set_Domain (String value)
 Sets the 'Domain' attribute's value. More...
 
bool get_DomainImplicit ()
 Gets a value that indicates if the domain is implicit. More...
 
void set_DomainImplicit (bool value)
 Sets a value that indicates if the domain is implicit. More...
 
bool get_Expired ()
 Gets a value that indicates if the cookie expired. More...
 
void set_Expired (bool value)
 Sets a value that indicates if the cookie expired. More...
 
DateTime get_Expires ()
 Gets the 'Expires' attribute's value. More...
 
void set_Expires (DateTime value)
 Sets the 'Expires' attribute's value. More...
 
String get_Name () const
 Gets the cookie's name. More...
 
void set_Name (String value)
 Sets the cookie's name. More...
 
String get_Path () const
 Gets the 'Path' attribute's value. More...
 
void set_Path (String value)
 Sets the 'Path' attribute's value. More...
 
bool get_Plain () const
 Returns a value that indicates if the cookie specification is 'Plain'. More...
 
String get_Port () const
 Gets the 'Port' attribute's value. More...
 
void set_Port (String value)
 Sets the 'Port' attribute's value. More...
 
System::ArrayPtr< int32_t > get_PortList () const
 Returns the collection of the 'Port' attribute's values. More...
 
bool get_Secure () const
 Gets the 'Secure' attribute's value. More...
 
void set_Secure (bool value)
 Sets the 'Secure' attribute's value. More...
 
DateTime get_TimeStamp () const
 Returns the time when the cookie was created. More...
 
String get_Value () const
 Gets the cookie's'value. More...
 
void set_Value (String value)
 Sets the cookie's value. More...
 
CookieVariant get_Variant () const
 Gets the cookie's specification. More...
 
void set_Variant (CookieVariant value)
 Sets the cookie's specification. More...
 
String get_DomainKey () const
 Returns the domain key. More...
 
int32_t get_Version () const
 Gets the 'Version' attribute's value. More...
 
void set_Version (int32_t value)
 Sets the 'Version' attribute's value. More...
 
 Cookie ()
 Constructs a new instance. More...
 
 Cookie (String name, String value)
 Constructs a new instance. More...
 
 Cookie (String name, String value, String path)
 Constructs a new instance. More...
 
 Cookie (String name, String value, String path, String domain)
 Constructs a new instance. More...
 
bool InternalSetName (String value)
 This method is called by other methods to set a method name. More...
 
System::SharedPtr< CookieClone ()
 Creates a copy of the current instance. More...
 
bool VerifySetDefaults (CookieVariant variant, System::SharedPtr< Uri > uri, bool isLocalDomain, String localDomain, bool setDefault, bool shouldThrow)
 Verifies and sets the default attribute's values. More...
 
bool Equals (System::SharedPtr< Object > comparand) override
 Compares objects using C# Object.Equals semantics. More...
 
int32_t GetHashCode () const override
 Analog of C# Object.GetHashCode() method. Enables hashing of custom objects. More...
 
String ToString () const override
 Analog of C# Object.ToString() method. Enables converting custom objects to string. More...
 
String ToServerString ()
 Serializes the current instance to the string representation. 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...
 

Public Attributes

bool IsQuotedVersion
 A value that indicates if the version is wrapped in the quotes. More...
 
bool IsQuotedDomain
 A value that indicates if the domain is wrapped in the quotes. More...
 

Static Public Attributes

static const int32_t MaxSupportedVersion
 The maximum supported version. More...
 
static const String MaxSupportedVersionString
 The string representation of the maximum supported version. More...
 
static const String CommentAttributeName
 The 'Comment' attribute's name. More...
 
static const String CommentUrlAttributeName
 The 'CommentURL' attribute's name. More...
 
static const String DiscardAttributeName
 The 'Discard' attribute's name. More...
 
static const String DomainAttributeName
 The 'Domain' attribute's name. More...
 
static const String ExpiresAttributeName
 The 'Expires' attribute's name. More...
 
static const String MaxAgeAttributeName
 The 'Max-Age' attribute's name. More...
 
static const String PathAttributeName
 The 'Path' attribute's name. More...
 
static const String PortAttributeName
 The 'Port' attribute's name. More...
 
static const String SecureAttributeName
 The 'Secure' attribute's name. More...
 
static const String VersionAttributeName
 The 'Version' attribute's name. More...
 
static const String HttpOnlyAttributeName
 The 'HttpOnly' attribute's name. More...
 
static const String SeparatorLiteral
 The attribute separator. More...
 
static const String EqualsLiteral
 The separator that is used to separates the name and value of an attribute. More...
 
static const String QuotesLiteral
 The symbol used to wrap the attribute's parts. More...
 
static const String SpecialAttributeLiteral
 The prefix of the special attributes' names. More...
 
static System::ArrayPtr< char16_t > PortSplitDelimiters
 The array that contains delimiters for the 'Port' attribute's values. More...
 
static System::ArrayPtr< char16_t > ReservedToName
 A value that is reserved for the cookie name. More...
 
static System::ArrayPtr< char16_t > ReservedToValue
 A value that is reserved for the cookie value. More...
 

Additional Inherited Members

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

Detailed Description

Represents an HTTP cookie. 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

◆ Cookie() [1/4]

System::Net::Cookie::Cookie ( )

Constructs a new instance.

◆ Cookie() [2/4]

System::Net::Cookie::Cookie ( String  name,
String  value 
)

Constructs a new instance.

Parameters
nameThe cookie's name.
valueThe cookie's value.

◆ Cookie() [3/4]

System::Net::Cookie::Cookie ( String  name,
String  value,
String  path 
)

Constructs a new instance.

Parameters
nameThe cookie name.
valueThe cookie value.
pathThe 'Path' attribute's value.

◆ Cookie() [4/4]

System::Net::Cookie::Cookie ( String  name,
String  value,
String  path,
String  domain 
)

Constructs a new instance.

Parameters
nameThe cookie's name.
valueThe cookie's value.
pathThe 'Path' attribute's value.
domainThe 'Domain' attribute's value.

Member Function Documentation

◆ Clone()

System::SharedPtr< Cookie > System::Net::Cookie::Clone ( )

Creates a copy of the current instance.

Returns
A copy of the current instance.

◆ Equals()

bool System::Net::Cookie::Equals ( System::SharedPtr< Object comparand)
override

Compares objects using C# Object.Equals semantics.

Parameters
comparandObject to compare current one to.
Returns
True if objects are considered equal and false otherwise.

◆ get_Comment()

String System::Net::Cookie::get_Comment ( ) const

Gets the 'Comment' attribute's value.

Returns
The 'Comment' attribute's value.

◆ get_CommentUri()

System::SharedPtr< Uri > System::Net::Cookie::get_CommentUri ( ) const

Gets the 'CommentURL' attribute's value.

Returns
The 'CommentURL' attribute's value.

◆ get_Discard()

bool System::Net::Cookie::get_Discard ( ) const

Gets the 'Discard' attribute's value.

Returns
The 'Discard' attribute's value.

◆ get_Domain()

String System::Net::Cookie::get_Domain ( ) const

Gets the 'Domain' attribute's value.

Returns
The 'Domain' attribute's value.

◆ get_DomainImplicit()

bool System::Net::Cookie::get_DomainImplicit ( )

Gets a value that indicates if the domain is implicit.

Returns
A value that indicates if the domain is implicit.

◆ get_DomainKey()

String System::Net::Cookie::get_DomainKey ( ) const

Returns the domain key.

Returns
The domain key.

◆ get_Expired()

bool System::Net::Cookie::get_Expired ( )

Gets a value that indicates if the cookie expired.

Returns
A value that indicates if the cookie expired.

◆ get_Expires()

DateTime System::Net::Cookie::get_Expires ( )

Gets the 'Expires' attribute's value.

Returns
The 'Expires' attribute's value.

◆ get_HttpOnly()

bool System::Net::Cookie::get_HttpOnly ( ) const

Gets the 'HttpOnly' attribute's value.

Returns
The 'HttpOnly' attribute's value.

◆ get_Name()

String System::Net::Cookie::get_Name ( ) const

Gets the cookie's name.

Returns
The cookie's name.

◆ get_Path()

String System::Net::Cookie::get_Path ( ) const

Gets the 'Path' attribute's value.

Returns
The 'Path' attribute's value.

◆ get_Plain()

bool System::Net::Cookie::get_Plain ( ) const

Returns a value that indicates if the cookie specification is 'Plain'.

Returns
A value that indicates if the cookie specification is 'Plain'.

◆ get_Port()

String System::Net::Cookie::get_Port ( ) const

Gets the 'Port' attribute's value.

Returns
The 'Port' attribute's value.

◆ get_PortList()

System::ArrayPtr< int32_t > System::Net::Cookie::get_PortList ( ) const

Returns the collection of the 'Port' attribute's values.

Returns
The collection of the 'Port' attribute's values.

◆ get_Secure()

bool System::Net::Cookie::get_Secure ( ) const

Gets the 'Secure' attribute's value.

Returns
The 'Secure' attribute's value.

◆ get_TimeStamp()

DateTime System::Net::Cookie::get_TimeStamp ( ) const

Returns the time when the cookie was created.

Returns
The time when the cookie was created.

◆ get_Value()

String System::Net::Cookie::get_Value ( ) const

Gets the cookie's'value.

Returns
The cookie's value.

◆ get_Variant()

CookieVariant System::Net::Cookie::get_Variant ( ) const

Gets the cookie's specification.

Returns
The cookie's specification.

◆ get_Version()

int32_t System::Net::Cookie::get_Version ( ) const

Gets the 'Version' attribute's value.

Returns
The 'Version' attribute's value.

◆ GetHashCode()

int32_t System::Net::Cookie::GetHashCode ( ) const
overridevirtual

Analog of C# Object.GetHashCode() method. Enables hashing of custom objects.

Returns
Hash code value as calculated by corresponding class.

Reimplemented from System::Object.

◆ InternalSetName()

bool System::Net::Cookie::InternalSetName ( String  value)

This method is called by other methods to set a method name.

Parameters
valueThe value that must be set.
Returns
True when the specified value is empty or special, otherwise false.

◆ set_Comment()

void System::Net::Cookie::set_Comment ( String  value)

Sets the 'Comment' attribute's value.

Parameters
valueThe value that must be set.

◆ set_CommentUri()

void System::Net::Cookie::set_CommentUri ( System::SharedPtr< Uri value)

Sets the 'CommentURL' attribute's value.

Parameters
valueThe value that must be set.

◆ set_Discard()

void System::Net::Cookie::set_Discard ( bool  value)

Sets the 'Discard' attribute's value.

Parameters
valueThe value that must be set.

◆ set_Domain()

void System::Net::Cookie::set_Domain ( String  value)

Sets the 'Domain' attribute's value.

Parameters
valueThe value that must be set.

◆ set_DomainImplicit()

void System::Net::Cookie::set_DomainImplicit ( bool  value)

Sets a value that indicates if the domain is implicit.

Parameters
valueThe value that must be set.

◆ set_Expired()

void System::Net::Cookie::set_Expired ( bool  value)

Sets a value that indicates if the cookie expired.

Parameters
valueThe value that must be set.

◆ set_Expires()

void System::Net::Cookie::set_Expires ( DateTime  value)

Sets the 'Expires' attribute's value.

Parameters
valueThe value that must be set.

◆ set_HttpOnly()

void System::Net::Cookie::set_HttpOnly ( bool  value)

Sets the 'HttpOnly' attribute's value.

Parameters
valueThe value that must be set.

◆ set_Name()

void System::Net::Cookie::set_Name ( String  value)

Sets the cookie's name.

Parameters
valueThe value that must be set.

◆ set_Path()

void System::Net::Cookie::set_Path ( String  value)

Sets the 'Path' attribute's value.

Parameters
valueThe value that must be set.

◆ set_Port()

void System::Net::Cookie::set_Port ( String  value)

Sets the 'Port' attribute's value.

Parameters
valueThe value that must be set.

◆ set_Secure()

void System::Net::Cookie::set_Secure ( bool  value)

Sets the 'Secure' attribute's value.

Parameters
valueThe value that must be set.

◆ set_Value()

void System::Net::Cookie::set_Value ( String  value)

Sets the cookie's value.

Parameters
valueThe value that must be set.

◆ set_Variant()

void System::Net::Cookie::set_Variant ( CookieVariant  value)

Sets the cookie's specification.

Parameters
valueThe value that must be set.

◆ set_Version()

void System::Net::Cookie::set_Version ( int32_t  value)

Sets the 'Version' attribute's value.

Parameters
valueThe value that must be set.

◆ ToServerString()

String System::Net::Cookie::ToServerString ( )

Serializes the current instance to the string representation.

Returns
A string representation of the current instance.

◆ ToString()

String System::Net::Cookie::ToString ( ) const
overridevirtual

Analog of C# Object.ToString() method. Enables converting custom objects to string.

Returns
String representation as provided by final class.

Reimplemented from System::Object.

◆ VerifySetDefaults()

bool System::Net::Cookie::VerifySetDefaults ( CookieVariant  variant,
System::SharedPtr< Uri uri,
bool  isLocalDomain,
String  localDomain,
bool  setDefault,
bool  shouldThrow 
)

Verifies and sets the default attribute's values.

Parameters
variantThe cookie's specification.
uriThe Uri-class instance that is used to initialize the internal fields.
isLocalDomainA value that indicates if the cookie is pushed into the the local domain.
localDomainA local domain name.
setDefaultA value that indicates if the cookie's attributes must be initialized using their default values.
shouldThrowA value that indicates if an exception should be thrown when the specified values are invalid.
Returns
True when all values are valid, otherwise false.

Member Data Documentation

◆ CommentAttributeName

const String System::Net::Cookie::CommentAttributeName
static

The 'Comment' attribute's name.

◆ CommentUrlAttributeName

const String System::Net::Cookie::CommentUrlAttributeName
static

The 'CommentURL' attribute's name.

◆ DiscardAttributeName

const String System::Net::Cookie::DiscardAttributeName
static

The 'Discard' attribute's name.

◆ DomainAttributeName

const String System::Net::Cookie::DomainAttributeName
static

The 'Domain' attribute's name.

◆ EqualsLiteral

const String System::Net::Cookie::EqualsLiteral
static

The separator that is used to separates the name and value of an attribute.

◆ ExpiresAttributeName

const String System::Net::Cookie::ExpiresAttributeName
static

The 'Expires' attribute's name.

◆ HttpOnlyAttributeName

const String System::Net::Cookie::HttpOnlyAttributeName
static

The 'HttpOnly' attribute's name.

◆ IsQuotedDomain

bool System::Net::Cookie::IsQuotedDomain

A value that indicates if the domain is wrapped in the quotes.

◆ IsQuotedVersion

bool System::Net::Cookie::IsQuotedVersion

A value that indicates if the version is wrapped in the quotes.

◆ MaxAgeAttributeName

const String System::Net::Cookie::MaxAgeAttributeName
static

The 'Max-Age' attribute's name.

◆ MaxSupportedVersion

const int32_t System::Net::Cookie::MaxSupportedVersion
static

The maximum supported version.

◆ MaxSupportedVersionString

const String System::Net::Cookie::MaxSupportedVersionString
static

The string representation of the maximum supported version.

◆ PathAttributeName

const String System::Net::Cookie::PathAttributeName
static

The 'Path' attribute's name.

◆ PortAttributeName

const String System::Net::Cookie::PortAttributeName
static

The 'Port' attribute's name.

◆ PortSplitDelimiters

System::ArrayPtr<char16_t> System::Net::Cookie::PortSplitDelimiters
static

The array that contains delimiters for the 'Port' attribute's values.

◆ QuotesLiteral

const String System::Net::Cookie::QuotesLiteral
static

The symbol used to wrap the attribute's parts.

◆ ReservedToName

System::ArrayPtr<char16_t> System::Net::Cookie::ReservedToName
static

A value that is reserved for the cookie name.

◆ ReservedToValue

System::ArrayPtr<char16_t> System::Net::Cookie::ReservedToValue
static

A value that is reserved for the cookie value.

◆ SecureAttributeName

const String System::Net::Cookie::SecureAttributeName
static

The 'Secure' attribute's name.

◆ SeparatorLiteral

const String System::Net::Cookie::SeparatorLiteral
static

The attribute separator.

◆ SpecialAttributeLiteral

const String System::Net::Cookie::SpecialAttributeLiteral
static

The prefix of the special attributes' names.

◆ VersionAttributeName

const String System::Net::Cookie::VersionAttributeName
static

The 'Version' attribute's name.