Aspose::Email::Mime::HeaderCollection Class Reference

Defines the collection of header fields More...

Inherits System::Collections::Generic::ICollection< System::String >.

Public Member Functions

virtual System::ArrayPtr< System::String > get_AllKeys ()
 Gets an array of strings containing all header keys in collections More...
 
virtual System::SharedPtr< System::Collections::ObjectModel::ReadOnlyCollection< System::String > > get_Keys ()
 Gets a T:System::Collections::ObjectModel::ReadOnlyCollection<string> containing all header keys in collections More...
 
int32_t get_Count () const override
 Gets a count of headers More...
 
bool get_IsReadOnly () const override
 Is collection readonly More...
 
 HeaderCollection (System::SharedPtr< HeaderCollection > col)
 Initializes a new instance of the HeaderCollection class. More...
 
 HeaderCollection ()
 Initializes a new instance of the HeaderCollection class. More...
 
 HeaderCollection (System::SharedPtr< System::Collections::Generic::IEqualityComparer< System::String >> equalityComparer)
 
 HeaderCollection (int32_t capacity, System::SharedPtr< System::Collections::Generic::IEqualityComparer< System::String >> equalityComparer)
 
System::String idx_get (System::String name)
 Gets a value from collection by the name. More...
 
void idx_set (System::String name, System::String value)
 Gets a value from collection by the name. More...
 
System::String idx_get (int32_t index)
 Gets a value from collection by the index. More...
 
virtual System::String GetKey (int32_t index)
 Gets the key at the specified index of the collection. More...
 
virtual System::String Get (int32_t index)
 Gets the value at the specified index. More...
 
System::String Get (System::String name)
 Gets the header value by a given header name. More...
 
System::String GetString ()
 Returns a System::String that represents this instance. More...
 
System::String GetDecodedValue (System::String name)
 Gets the header value. More...
 
System::ArrayPtr< System::String > GetValues (System::String name)
 Gets the header values. More...
 
virtual void Add_ (System::String name, System::String value)
 Adds the header. More...
 
void Add (const System::SharedPtr< HeaderCollection > &c)
 Adds a header to collection. More...
 
void Add (System::String name, System::String value)
 Adds the header. More...
 
void Insert (System::String name, System::String value)
 Inserts the header in collection. If collection contains headers with the same name this header will be inserted before other headers with the same name. More...
 
void Set (System::String name, System::String value)
 Sets the header. More...
 
bool HasKeys ()
 Gets a value indicating whether the collection contains keys. More...
 
void Add (System::SharedPtr< RawMimeHeader > header, System::SharedPtr< System::Text::Encoding > preferredEncoding)
 Adds a header to collection More...
 
void InternalRemove (System::String name)
 
void InternalSet (System::String name, System::String value)
 
System::SharedPtr< System::Object > GetHeaderObject (System::String headerName)
 Gets the object representing the specified header value Note: it gets the first value for multi-valued headers More...
 
System::SharedPtr< System::Collections::Generic::ListExt< System::SharedPtr< System::Object > > > GetHeaderObjects (System::String headerName)
 Gets the objects array representing the specified header value Note: it gets the first value for multi-valued headers More...
 
void SetHeaderObject (System::String headerName, System::SharedPtr< System::Object > headerValue)
 Sets the specified header value More...
 
void AddHeaderObject (System::String headerName, System::SharedPtr< System::Object > headerValue)
 Adds the specified header value More...
 
void Add (const System::String &item) override
 Adds the header without value More...
 
void Clear () override
 Clears all headers. More...
 
bool Contains (const System::String &item) const override
 Gets a value indicating whether the specified header is contained in the collection More...
 
void CopyTo (System::ArrayPtr< System::String > array, int32_t arrayIndex) override
 Copies all the elements of the current collection to the specified string array starting at the specified destination index. More...
 
bool Remove (const System::String &item) override
 Removes the header from collection by a given header name. More...
 
System::SharedPtr< System::Collections::Generic::IEnumerator< System::String > > GetEnumerator () override
 Returns an enumerator that iterates through a collection. More...
 

Protected Member Functions

virtual ~HeaderCollection ()
 

Friends

class Aspose::Email::MailMessage
 
class Aspose::Email::Bounce::BounceDetector
 
class Aspose::Email::Clients::Exchange::WebService::EwsConverterUtils
 
class Aspose::Email::Clients::Exchange::WebService::EWSClient2007
 
class Aspose::Email::Clients::Exchange::WebService::Extensions::MailMessageExtensions
 
class Aspose::Email::Mapi::MailMessageInterpretor
 
class Aspose::Email::Mapi::ClearSignedMailMessageInterpretor
 
class Aspose::Email::Mapi::NDRReportMailMessageInterpretor
 
class Aspose::Email::Mapi::OpaqueSignedMailMessageInterpretor
 
class Aspose::Email::Mapi::MapiMessage
 
class Aspose::Email::Mapi::OutlookUtil
 
class Aspose::Email::Message
 
class Aspose::Email::Mime::ContentDisposition
 
class Aspose::Email::Mime::ContentType
 
class Aspose::Email::Mime::MimeBasePart
 
class Aspose::Email::Mime::MimeMessageReader
 
class Aspose::Email::Mime::MimePart
 
class Aspose::Email::Storage::Nsf::Note
 

Detailed Description

Defines the collection of header fields

Constructor & Destructor Documentation

◆ HeaderCollection() [1/4]

Aspose::Email::Mime::HeaderCollection::HeaderCollection ( System::SharedPtr< HeaderCollection col)

Initializes a new instance of the HeaderCollection class.

Parameters
colThe collection.

◆ HeaderCollection() [2/4]

Aspose::Email::Mime::HeaderCollection::HeaderCollection ( )

Initializes a new instance of the HeaderCollection class.

◆ HeaderCollection() [3/4]

Aspose::Email::Mime::HeaderCollection::HeaderCollection ( System::SharedPtr< System::Collections::Generic::IEqualityComparer< System::String >>  equalityComparer)

◆ HeaderCollection() [4/4]

Aspose::Email::Mime::HeaderCollection::HeaderCollection ( int32_t  capacity,
System::SharedPtr< System::Collections::Generic::IEqualityComparer< System::String >>  equalityComparer 
)

◆ ~HeaderCollection()

virtual Aspose::Email::Mime::HeaderCollection::~HeaderCollection ( )
protectedvirtual

Member Function Documentation

◆ Add() [1/4]

void Aspose::Email::Mime::HeaderCollection::Add ( const System::SharedPtr< HeaderCollection > &  c)

Adds a header to collection.

Parameters
cHeaderCollection for adding.

◆ Add() [2/4]

void Aspose::Email::Mime::HeaderCollection::Add ( const System::String &  item)
override

Adds the header without value

◆ Add() [3/4]

void Aspose::Email::Mime::HeaderCollection::Add ( System::SharedPtr< RawMimeHeader >  header,
System::SharedPtr< System::Text::Encoding >  preferredEncoding 
)

Adds a header to collection

Parameters
headerA RawMimeHeader containing a header key and a raw header value
preferredEncodingA preferred text encoding
Exceptions
ArgumentExceptionA HeaderKey of header is null or empty
ArgumentNullExceptionheader is null

◆ Add() [4/4]

void Aspose::Email::Mime::HeaderCollection::Add ( System::String  name,
System::String  value 
)

Adds the header.

Parameters
nameThe header name.
valueThe header value.

◆ Add_()

virtual void Aspose::Email::Mime::HeaderCollection::Add_ ( System::String  name,
System::String  value 
)
virtual

Adds the header.

Parameters
nameThe header name.
valueThe header value.

◆ AddHeaderObject()

void Aspose::Email::Mime::HeaderCollection::AddHeaderObject ( System::String  headerName,
System::SharedPtr< System::Object >  headerValue 
)

Adds the specified header value

Parameters
headerNameA header name
headerValueA header value
Exceptions
ArgumentExceptionheaderName is null or empty

◆ Clear()

void Aspose::Email::Mime::HeaderCollection::Clear ( )
override

Clears all headers.

◆ Contains()

bool Aspose::Email::Mime::HeaderCollection::Contains ( const System::String &  item) const
override

Gets a value indicating whether the specified header is contained in the collection

Parameters
itemA header to search
Returns
True if collection contains specified item ; otherwise, false

◆ CopyTo()

void Aspose::Email::Mime::HeaderCollection::CopyTo ( System::ArrayPtr< System::String >  array,
int32_t  arrayIndex 
)
override

Copies all the elements of the current collection to the specified string array starting at the specified destination index.

Parameters
arrayThe destination of the elements copied from the current collection.
arrayIndexAn integer that represents the index in array at which copying begins.

◆ Get() [1/2]

virtual System::String Aspose::Email::Mime::HeaderCollection::Get ( int32_t  index)
virtual

Gets the value at the specified index.

Parameters
indexAn integer that represents the position of the element to get.
Returns
The value at the specified position in current collection.

◆ Get() [2/2]

System::String Aspose::Email::Mime::HeaderCollection::Get ( System::String  name)

Gets the header value by a given header name.

Parameters
nameThe haeader name.
Returns
The header value.

◆ get_AllKeys()

virtual System::ArrayPtr<System::String> Aspose::Email::Mime::HeaderCollection::get_AllKeys ( )
virtual

Gets an array of strings containing all header keys in collections

◆ get_Count()

int32_t Aspose::Email::Mime::HeaderCollection::get_Count ( ) const
override

Gets a count of headers

◆ get_IsReadOnly()

bool Aspose::Email::Mime::HeaderCollection::get_IsReadOnly ( ) const
override

Is collection readonly

◆ get_Keys()

virtual System::SharedPtr<System::Collections::ObjectModel::ReadOnlyCollection<System::String> > Aspose::Email::Mime::HeaderCollection::get_Keys ( )
virtual

Gets a T:System::Collections::ObjectModel::ReadOnlyCollection<string> containing all header keys in collections

◆ GetDecodedValue()

System::String Aspose::Email::Mime::HeaderCollection::GetDecodedValue ( System::String  name)

Gets the header value.

Parameters
nameThe text header name.
Returns
Decoded text value

◆ GetEnumerator()

System::SharedPtr<System::Collections::Generic::IEnumerator<System::String> > Aspose::Email::Mime::HeaderCollection::GetEnumerator ( )
override

Returns an enumerator that iterates through a collection.

Returns
An T:System::Collections::Generic::IEnumerator<string> object that can be used to iterate through the collection.

◆ GetHeaderObject()

System::SharedPtr<System::Object> Aspose::Email::Mime::HeaderCollection::GetHeaderObject ( System::String  headerName)

Gets the object representing the specified header value Note: it gets the first value for multi-valued headers

Parameters
headerNameA header name
Exceptions
ArgumentExceptionheaderName is null or empty
Returns
An object corresponding to the specified header

◆ GetHeaderObjects()

System::SharedPtr<System::Collections::Generic::ListExt<System::SharedPtr<System::Object> > > Aspose::Email::Mime::HeaderCollection::GetHeaderObjects ( System::String  headerName)

Gets the objects array representing the specified header value Note: it gets the first value for multi-valued headers

Parameters
headerNameA header name
Exceptions
ArgumentExceptionheaderName is null or empty
Returns
An objects array corresponding to the specified header

◆ GetKey()

virtual System::String Aspose::Email::Mime::HeaderCollection::GetKey ( int32_t  index)
virtual

Gets the key at the specified index of the collection.

Parameters
indexThe index of the key.
Returns
The key at the specified index.

◆ GetString()

System::String Aspose::Email::Mime::HeaderCollection::GetString ( )

Returns a System::String that represents this instance.

Returns
A System::String that represents this instance.

◆ GetValues()

System::ArrayPtr<System::String> Aspose::Email::Mime::HeaderCollection::GetValues ( System::String  name)

Gets the header values.

Parameters
nameThe header name.
Returns
The collection of header values.

◆ HasKeys()

bool Aspose::Email::Mime::HeaderCollection::HasKeys ( )

Gets a value indicating whether the collection contains keys.

Returns
Returns true if collection has an items, otherwise returns false.

◆ idx_get() [1/2]

System::String Aspose::Email::Mime::HeaderCollection::idx_get ( int32_t  index)

Gets a value from collection by the index.

Parameters
indexThe index in collection for an item.
Returns
Returns specified item

◆ idx_get() [2/2]

System::String Aspose::Email::Mime::HeaderCollection::idx_get ( System::String  name)

Gets a value from collection by the name.

Parameters
nameThe name (key) in collection for an item.
Returns
Returns specified item

◆ idx_set()

void Aspose::Email::Mime::HeaderCollection::idx_set ( System::String  name,
System::String  value 
)

Gets a value from collection by the name.

Parameters
nameThe name (key) in collection for an item.
valueReturns specified item

◆ Insert()

void Aspose::Email::Mime::HeaderCollection::Insert ( System::String  name,
System::String  value 
)

Inserts the header in collection. If collection contains headers with the same name this header will be inserted before other headers with the same name.

Parameters
nameThe header name.
valueThe header value.

◆ InternalRemove()

void Aspose::Email::Mime::HeaderCollection::InternalRemove ( System::String  name)

◆ InternalSet()

void Aspose::Email::Mime::HeaderCollection::InternalSet ( System::String  name,
System::String  value 
)

◆ Remove()

bool Aspose::Email::Mime::HeaderCollection::Remove ( const System::String &  item)
override

Removes the header from collection by a given header name.

Parameters
itemThe header name.
Returns
true if item was successfully removed from the collection.

◆ Set()

void Aspose::Email::Mime::HeaderCollection::Set ( System::String  name,
System::String  value 
)

Sets the header.

Parameters
nameThe header name.
valueThe header value.

◆ SetHeaderObject()

void Aspose::Email::Mime::HeaderCollection::SetHeaderObject ( System::String  headerName,
System::SharedPtr< System::Object >  headerValue 
)

Sets the specified header value

Parameters
headerNameA header name
headerValueA header value
Exceptions
ArgumentExceptionheaderName is null or empty

Friends And Related Function Documentation

◆ Aspose::Email::Bounce::BounceDetector

friend class Aspose::Email::Bounce::BounceDetector
friend

◆ Aspose::Email::Clients::Exchange::WebService::EWSClient2007

friend class Aspose::Email::Clients::Exchange::WebService::EWSClient2007
friend

◆ Aspose::Email::Clients::Exchange::WebService::EwsConverterUtils

friend class Aspose::Email::Clients::Exchange::WebService::EwsConverterUtils
friend

◆ Aspose::Email::Clients::Exchange::WebService::Extensions::MailMessageExtensions

friend class Aspose::Email::Clients::Exchange::WebService::Extensions::MailMessageExtensions
friend

◆ Aspose::Email::MailMessage

friend class Aspose::Email::MailMessage
friend

◆ Aspose::Email::Mapi::ClearSignedMailMessageInterpretor

friend class Aspose::Email::Mapi::ClearSignedMailMessageInterpretor
friend

◆ Aspose::Email::Mapi::MailMessageInterpretor

friend class Aspose::Email::Mapi::MailMessageInterpretor
friend

◆ Aspose::Email::Mapi::MapiMessage

friend class Aspose::Email::Mapi::MapiMessage
friend

◆ Aspose::Email::Mapi::NDRReportMailMessageInterpretor

friend class Aspose::Email::Mapi::NDRReportMailMessageInterpretor
friend

◆ Aspose::Email::Mapi::OpaqueSignedMailMessageInterpretor

friend class Aspose::Email::Mapi::OpaqueSignedMailMessageInterpretor
friend

◆ Aspose::Email::Mapi::OutlookUtil

friend class Aspose::Email::Mapi::OutlookUtil
friend

◆ Aspose::Email::Message

friend class Aspose::Email::Message
friend

◆ Aspose::Email::Mime::ContentDisposition

◆ Aspose::Email::Mime::ContentType

friend class Aspose::Email::Mime::ContentType
friend

◆ Aspose::Email::Mime::MimeBasePart

friend class Aspose::Email::Mime::MimeBasePart
friend

◆ Aspose::Email::Mime::MimeMessageReader

friend class Aspose::Email::Mime::MimeMessageReader
friend

◆ Aspose::Email::Mime::MimePart

friend class Aspose::Email::Mime::MimePart
friend

◆ Aspose::Email::Storage::Nsf::Note

friend class Aspose::Email::Storage::Nsf::Note
friend