Dacons LLP Mailit for C/C++ Version 1.0.8

Emai::ContentField Class Reference

EmaiContentField wrapper class.
ContentField object can be used to setup or retrieve parsed field data for Content-Type and Content-Disposition fields. For Content-Type field value member contains media type of the message part ("text/plain", "application/octet-stream", etc) For Content-Disposition field value member contains disposition of the message part ("attachment", "inline" etc). More...

#include <EmaiMessage.hpp>

Inheritance diagram for Emai::ContentField:

Emai::Object< EmaiContentField > List of all members.

Public Member Functions

 ContentField (EmaiConstUniCharPtr inValue, EmaiOptions inOptions=EmaiNullOptions)
 ContentField (EmaiContentField inContentField, bool inAddRef)
 ContentField (const ContentField &inCopy)
ContentFieldoperator= (const ContentField &inCopy)
void AddParameter (EmaiConstUniCharPtr inParamName, EmaiConstUniCharPtr inParamValue, EmaiOptions inOptions=EmaiNullOptions)
 Adds parameter name and parameter value to the field object.
EmaiConstUniCharPtr GetValue (EmaiOptions inOptions=EmaiNullOptions)
 Extracts the value from the content field.
EmaiUint32 GetParameterCount (EmaiOptions inOptions=EmaiNullOptions)
 Retrieves the number of parameters at the content field.
EmaiConstUniCharPtr GetParameterName (EmaiUint32 inIndex, EmaiOptions inOptions=EmaiNullOptions)
 Extracts parameter name at the specified index, from the content field.
EmaiConstUniCharPtr GetParameterValue (EmaiUint32 inIndex, EmaiOptions inOptions=EmaiNullOptions)
 Extracts parameter value at the specified index, from the content field.
EmaiConstUniCharPtr FindParameterValue (EmaiConstUniCharPtr inParamName, EmaiOptions inOptions=EmaiNullOptions)
 Finds parameter value with specified name, from the content field.

Detailed Description

EmaiContentField wrapper class.
ContentField object can be used to setup or retrieve parsed field data for Content-Type and Content-Disposition fields. For Content-Type field value member contains media type of the message part ("text/plain", "application/octet-stream", etc) For Content-Disposition field value member contains disposition of the message part ("attachment", "inline" etc).

See also:
EmaiContentField

Definition at line 177 of file EmaiMessage.hpp.


Member Function Documentation

void Emai::ContentField::AddParameter ( EmaiConstUniCharPtr  inParamName,
EmaiConstUniCharPtr  inParamValue,
EmaiOptions  inOptions = EmaiNullOptions 
) [inline]

Adds parameter name and parameter value to the field object.

Parameters:
inParamName - parameter name to be added (for example: "filename")
inParamValue - parameter value to be added (for example: "my file.txt")
inOptions - not used in current version, use EmaiNullOptions
See also:
EmaiContentFieldAddParameter

Definition at line 711 of file EmaiMessage.hpp.

References Emai::CheckErrorCode(), EmaiContentFieldAddParameter(), and Emai::Object< EmaiContentField >::mObject.

00716 {
00717     CheckErrorCode(EmaiContentFieldAddParameter(mObject, inParamName,
00718                             inParamValue, inOptions));
00719 }

EmaiConstUniCharPtr Emai::ContentField::GetValue ( EmaiOptions  inOptions = EmaiNullOptions  )  [inline]

Extracts the value from the content field.

Parameters:
inOptions - not used in current version, use EmaiNullOptions
Returns:
Zero-terminated unicode string which contains value of the field. The function returns NULL if invalid parameters are specified (i.e. inContentField is not valid object)
See also:
EmaiContentFieldGetValue

Definition at line 722 of file EmaiMessage.hpp.

References Emai::CheckErrorCode(), EmaiContentFieldGetValue(), EmaiErrIncorrectParameter, and Emai::Object< EmaiContentField >::mObject.

00725 {
00726     EmaiConstUniCharPtr value = EmaiContentFieldGetValue(mObject, inOptions);
00727     if (value == NULL)
00728         CheckErrorCode(EmaiErrIncorrectParameter);
00729 
00730     return value;
00731 }

EmaiUint32 Emai::ContentField::GetParameterCount ( EmaiOptions  inOptions = EmaiNullOptions  )  [inline]

Retrieves the number of parameters at the content field.

Parameters:
inOptions - not used in current version, use EmaiNullOptions
Returns:
On successful exit contains the number of the paramets at the content field
See also:
EmaiContentFieldGetParameterCount

Definition at line 734 of file EmaiMessage.hpp.

References Emai::CheckErrorCode(), EmaiContentFieldGetParameterCount(), and Emai::Object< EmaiContentField >::mObject.

00737 {
00738     EmaiUint32 count = 0;
00739     CheckErrorCode(EmaiContentFieldGetParameterCount(mObject, &count, inOptions));
00740     return count;
00741 }

EmaiConstUniCharPtr Emai::ContentField::GetParameterName ( EmaiUint32  inIndex,
EmaiOptions  inOptions = EmaiNullOptions 
) [inline]

Extracts parameter name at the specified index, from the content field.

Parameters:
inIndex - zero-based index of the parameter in the field
inOptions - not used in current version, use EmaiNullOptions
Returns:
Zero-terminated unicode string which contains parameter name. The function returns NULL if invalid parameters are specified (i.e. inContentField is not valid object or inIndex is out of range)
See also:
EmaiContentFieldGetParameterName

Definition at line 744 of file EmaiMessage.hpp.

References Emai::CheckErrorCode(), EmaiContentFieldGetParameterName(), EmaiErrIncorrectParameter, and Emai::Object< EmaiContentField >::mObject.

00748 {
00749     EmaiConstUniCharPtr name = EmaiContentFieldGetParameterName(mObject,
00750                                 inIndex, inOptions);
00751     if (name == NULL)
00752         CheckErrorCode(EmaiErrIncorrectParameter);
00753 
00754     return name;
00755 }

EmaiConstUniCharPtr Emai::ContentField::GetParameterValue ( EmaiUint32  inIndex,
EmaiOptions  inOptions = EmaiNullOptions 
) [inline]

Extracts parameter value at the specified index, from the content field.

Parameters:
inIndex - zero-based index of the parameter in the field
inOptions - not used in current version, use EmaiNullOptions
Returns:
Zero-terminated unicode string which contains parameter value. The function returns NULL if invalid parameters are specified (i.e. inContentField is not valid object or inIndex is out of range)
See also:
EmaiContentFieldGetParameterValue

Definition at line 758 of file EmaiMessage.hpp.

References Emai::CheckErrorCode(), EmaiContentFieldGetParameterValue(), EmaiErrIncorrectParameter, and Emai::Object< EmaiContentField >::mObject.

00762 {
00763     EmaiConstUniCharPtr value = EmaiContentFieldGetParameterValue(mObject,
00764                                 inIndex, inOptions);
00765     if (value == NULL)
00766         CheckErrorCode(EmaiErrIncorrectParameter);
00767 
00768     return value;
00769 }

EmaiConstUniCharPtr Emai::ContentField::FindParameterValue ( EmaiConstUniCharPtr  inParamName,
EmaiOptions  inOptions = EmaiNullOptions 
) [inline]

Finds parameter value with specified name, from the content field.

Parameters:
inParamName - parameter name to be found
inOptions - not used in current version, use EmaiNullOptions
Returns:
Zero-terminated unicode string which contains parameter value. The function returns NULL if invalid parameters are specified (i.e. inContentField is not valid object or parameter with the specified name is not found in the field)
See also:
EmaiContentFieldFindParameterValue

Definition at line 772 of file EmaiMessage.hpp.

References EmaiContentFieldFindParameterValue(), and Emai::Object< EmaiContentField >::mObject.

00776 {
00777     return EmaiContentFieldFindParameterValue(mObject,
00778                                 inParamName, inOptions);
00779 }


The documentation for this class was generated from the following file: