VMime
|
Classes | |
struct | ValueInfo |
Public Member Functions | |
template<class T > | |
void | registerField (const string &name) |
template<class T > | |
void | registerFieldValue (const string &name) |
shared_ptr< headerField > | create (const string &name, const string &body=NULL_STRING) |
shared_ptr< headerFieldValue > | createValue (const string &fieldName) |
bool | isValueTypeValid (const headerField &field, const headerFieldValue &value) const |
Static Public Member Functions | |
static shared_ptr < headerFieldFactory > | getInstance () |
Protected Types | |
typedef shared_ptr< headerField >(* | AllocFunc )(void) |
typedef std::map< string, AllocFunc > | NameMap |
typedef std::map< string, ValueInfo > | ValueMap |
Protected Member Functions | |
headerFieldFactory () | |
~headerFieldFactory () | |
Protected Attributes | |
NameMap | m_nameMap |
ValueMap | m_valueMap |
Creates header field and header field value objects.
|
protected |
|
protected |
References vmime::fields::BCC, vmime::fields::CC, vmime::fields::CONTENT_DESCRIPTION, vmime::fields::CONTENT_DISPOSITION, vmime::fields::CONTENT_ID, vmime::fields::CONTENT_LOCATION, vmime::fields::CONTENT_TRANSFER_ENCODING, vmime::fields::CONTENT_TYPE, vmime::fields::DATE, vmime::fields::DELIVERED_TO, vmime::fields::DISPOSITION, vmime::fields::DISPOSITION_NOTIFICATION_TO, vmime::fields::FROM, vmime::fields::IN_REPLY_TO, vmime::fields::MESSAGE_ID, vmime::fields::MIME_VERSION, vmime::fields::ORGANIZATION, vmime::fields::ORIGINAL_MESSAGE_ID, vmime::fields::RECEIVED, vmime::fields::REFERENCES, vmime::fields::REPLY_TO, vmime::fields::RETURN_PATH, vmime::fields::SENDER, vmime::fields::SUBJECT, vmime::fields::TO, and vmime::fields::USER_AGENT.
|
protected |
shared_ptr< headerField > create | ( | const string & | name, |
const string & | body = NULL_STRING |
||
) |
Create a new field object for the specified field name.
If the field name has not been registered, a default type is used.
name | field name |
body | string that will be parsed to initialize the value of the field |
References vmime::NULL_STRING, and stringUtils::toLower().
shared_ptr< headerFieldValue > createValue | ( | const string & | fieldName | ) |
Create a new field value for the specified field.
fieldName | name of the field for which to create value |
References headerFieldFactory::m_valueMap, and stringUtils::toLower().
|
static |
bool isValueTypeValid | ( | const headerField & | field, |
const headerFieldValue & | value | ||
) | const |
Returns whether the specified value type is valid for the specified field.
field | header field |
value | value for this header field |
References headerField::getName(), and stringUtils::toLower().
void registerField | ( | const string & | name | ) |
Register a field type.
T | field class (must inherit from 'headerField') |
name | field name (eg. "X-MyField") |
References stringUtils::toLower().
void registerFieldValue | ( | const string & | name | ) |
Register a field value type.
T | value class (must inherit from 'headerFieldValue') |
name | field name |
References headerFieldFactory::ValueInfo::allocFunc, headerFieldFactory::ValueInfo::checkTypeFunc, and stringUtils::toLower().
|
protected |
|
protected |
Referenced by headerFieldFactory::createValue().