VMime
|
Public Member Functions | |
~headerField () | |
shared_ptr< component > | clone () const |
void | copyFrom (const component &other) |
headerField & | operator= (const headerField &other) |
const std::vector< shared_ptr < component > > | getChildComponents () |
void | setName (const string &name) |
const string | getName () const |
bool | isCustom () const |
virtual shared_ptr< const headerFieldValue > | getValue () const |
template<typename T > | |
shared_ptr< const T > | getValue () const |
virtual shared_ptr < headerFieldValue > | getValue () |
template<typename T > | |
shared_ptr< T > | getValue () |
virtual void | setValue (shared_ptr< headerFieldValue > value) |
virtual void | setValueConst (shared_ptr< const headerFieldValue > value) |
virtual void | setValue (const headerFieldValue &value) |
void | setValue (const string &value) |
size_t | getGeneratedSize (const generationContext &ctx) |
Public Member Functions inherited from component | |
component () | |
virtual | ~component () |
void | parse (const string &buffer) |
void | parse (const parsingContext &ctx, const string &buffer) |
void | parse (shared_ptr< utility::inputStream > inputStream, const size_t length) |
void | parse (const string &buffer, const size_t position, const size_t end, size_t *newPosition=NULL) |
void | parse (const parsingContext &ctx, const string &buffer, const size_t position, const size_t end, size_t *newPosition=NULL) |
void | parse (shared_ptr< utility::inputStream > inputStream, const size_t position, const size_t end, size_t *newPosition=NULL) |
void | parse (const parsingContext &ctx, shared_ptr< utility::inputStream > inputStream, const size_t position, const size_t end, size_t *newPosition=NULL) |
virtual const string | generate (const size_t maxLineLength=lineLengthLimits::infinite, const size_t curLinePos=0) const |
virtual void | generate (utility::outputStream &outputStream, const size_t curLinePos=0, size_t *newLinePos=NULL) const |
virtual void | generate (const generationContext &ctx, utility::outputStream &outputStream, const size_t curLinePos=0, size_t *newLinePos=NULL) const |
size_t | getParsedOffset () const |
size_t | getParsedLength () const |
Static Public Member Functions | |
static shared_ptr< headerField > | parseNext (const parsingContext &ctx, const string &buffer, const size_t position, const size_t end, size_t *newPosition=NULL) |
Protected Member Functions | |
headerField () | |
headerField (const string &fieldName) | |
void | parseImpl (const parsingContext &ctx, const string &buffer, const size_t position, const size_t end, size_t *newPosition=NULL) |
void | generateImpl (const generationContext &ctx, utility::outputStream &os, const size_t curLinePos=0, size_t *newLinePos=NULL) const |
Protected Member Functions inherited from component | |
void | setParsedBounds (const size_t start, const size_t end) |
virtual void | parseImpl (const parsingContext &ctx, shared_ptr< utility::parserInputStreamAdapter > parser, const size_t position, const size_t end, size_t *newPosition=NULL) |
Protected Member Functions inherited from object | |
object () | |
object (const object &) | |
object & | operator= (const object &) |
virtual | ~object () |
Protected Attributes | |
string | m_name |
shared_ptr< headerFieldValue > | m_value |
Base class for header fields.
|
protected |
|
protected |
~headerField | ( | ) |
|
virtual |
Clone this component.
Implements component.
References headerFieldFactory::getInstance(), and headerField::m_name.
|
virtual |
Replace data in this component by data in other component.
Both components must be of the same type.
std::bad_cast_exception | if the components are not of the same (dynamic) type |
other | other component to copy data from |
Implements component.
Reimplemented in parameterizedHeaderField.
References headerField::m_value.
Referenced by parameterizedHeaderField::copyFrom(), and headerField::operator=().
|
protectedvirtual |
Implements component.
Reimplemented in parameterizedHeaderField.
Referenced by parameterizedHeaderField::generateImpl().
|
virtual |
Return the list of children of this component.
Implements component.
Reimplemented in parameterizedHeaderField.
References headerField::m_value.
Referenced by parameterizedHeaderField::getChildComponents().
|
virtual |
Get the number of bytes that will be used by this component when it is generated.
This may be a heuristically-derived estimate, but such an estimated size should always be larger than the actual generated size.
ctx | generation context |
Reimplemented from component.
References headerField::m_name, and headerField::m_value.
const string getName | ( | ) | const |
Return the name of this field.
References headerField::m_name.
Referenced by headerFieldFactory::isValueTypeValid(), headerField::setValue(), and headerField::setValueConst().
|
virtual |
Return the read-only value object attached to this field.
References headerField::m_value.
Referenced by body::getContentType(), and MDNHelper::isMDN().
shared_ptr<const T> getValue | ( | ) | const |
Return the read-only value object attached to this field, casted to the specified type.
|
virtual |
Return the value object attached to this field.
References headerField::m_value.
shared_ptr<T> getValue | ( | ) |
Return the value object attached to this field, casted to the specified type.
bool isCustom | ( | ) | const |
Check whether this field is a custom (non-standard) field.
Custom fields have a name beginning with "X-".
References headerField::m_name.
headerField & operator= | ( | const headerField & | other | ) |
References headerField::copyFrom().
|
protectedvirtual |
Reimplemented from component.
Reimplemented in parameterizedHeaderField.
|
static |
Parse a header field from a buffer.
ctx | parsing context |
buffer | input buffer |
position | current position in the input buffer |
end | end position in the input buffer |
newPosition | will receive the new position in the input buffer |
References vmime::end(), parserHelpers::findEOL(), headerFieldFactory::getInstance(), and parserHelpers::isSpace().
Referenced by header::parseImpl().
void setName | ( | const string & | name | ) |
Sets the name of this field.
name | field name (eg: "From" or "X-MyField"). |
References headerField::m_name.
|
virtual |
Set the value of this field.
exceptions::bad_field_value_type | if the value type is not valid for this header field |
value | new value |
References headerFieldFactory::getInstance(), headerField::getName(), and headerField::m_value.
|
virtual |
Set the value of this field (reference version).
The value will be cloned.
exceptions::bad_field_value_type | if the value type is not valid for this header field |
value | new value |
References vmime::clone(), headerFieldFactory::getInstance(), headerField::getName(), and headerField::m_value.
void setValue | ( | const string & | value | ) |
Set the value of this field given a character string.
value | value string to parse |
References component::parse().
|
virtual |
Set the value of this field by cloning the specified value.
exceptions::bad_field_value_type | if the value type is not valid for this header field |
value | new value |
References vmime::clone(), headerFieldFactory::getInstance(), headerField::getName(), and headerField::m_value.
|
protected |
|
protected |