Base class for header fields. More...


Public Member Functions | |
| ~headerField () | |
| ref< component > | clone () const |
| void | copyFrom (const component &other) |
| headerField & | operator= (const headerField &other) |
| const std::vector< ref< const component > > | getChildComponents () const |
| void | setName (const string &name) |
| const string | getName () const |
| bool | isCustom () const |
| virtual ref< const headerFieldValue > | getValue () const |
| virtual ref< headerFieldValue > | getValue () |
| virtual void | setValue (ref< headerFieldValue > value) |
| virtual void | setValueConst (ref< const headerFieldValue > value) |
| virtual void | setValue (const headerFieldValue &value) |
| void | setValue (const string &value) |
| void | parse (const string &buffer, const string::size_type position, const string::size_type end, string::size_type *newPosition=NULL) |
| void | generate (utility::outputStream &os, const string::size_type maxLineLength=lineLengthLimits::infinite, const string::size_type curLinePos=0, string::size_type *newLinePos=NULL) const |
Protected Member Functions | |
| headerField () | |
| headerField (const string &fieldName) | |
Static Protected Member Functions | |
| static ref< headerField > | parseNext (const string &buffer, const string::size_type position, const string::size_type end, string::size_type *newPosition=NULL) |
Protected Attributes | |
| string | m_name |
| ref< headerFieldValue > | m_value |
Base class for header fields.
| headerField | ( | ) | [protected] |
| headerField | ( | const string & | fieldName | ) | [protected] |
| ~headerField | ( | ) |
| ref< component > clone | ( | ) | const [virtual] |
Clone this component.
Implements component.
References headerFieldFactory::create(), headerFieldFactory::getInstance(), and headerField::m_name.
| void copyFrom | ( | const component & | other | ) | [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 headerField::operator=().
| void generate | ( | utility::outputStream & | os, | |
| const string::size_type | maxLineLength = lineLengthLimits::infinite, |
|||
| const string::size_type | curLinePos = 0, |
|||
| string::size_type * | newLinePos = NULL | |||
| ) | const [virtual] |
Generate RFC-2822/MIME data for this component.
| os | output stream | |
| maxLineLength | maximum line length for output | |
| curLinePos | length of the current line in the output buffer | |
| newLinePos | will receive the new line position (length of the last line written) |
Implements component.
Reimplemented in parameterizedHeaderField.
References headerField::m_name, and headerField::m_value.
| const std::vector< ref< const component > > getChildComponents | ( | ) | const [virtual] |
Return the list of children of this component (const version).
Implements component.
Reimplemented in parameterizedHeaderField.
References headerField::m_value.
| const string getName | ( | ) | const |
| ref< headerFieldValue > getValue | ( | ) | [virtual] |
Return the value object attached to this field.
References headerField::m_value.
| ref< const headerFieldValue > getValue | ( | ) | const [virtual] |
Return the read-only value object attached to this field.
References headerField::m_value.
Referenced by attachmentHelper::getBodyPartAttachment(), attachmentHelper::isBodyPartAnAttachment(), and parameterizedHeaderField::parse().
| 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().
| void parse | ( | const string & | buffer, | |
| const string::size_type | position, | |||
| const string::size_type | end, | |||
| string::size_type * | newPosition = NULL | |||
| ) | [virtual] |
Parse RFC-822/MIME data for this component.
| 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 |
Implements component.
Reimplemented in parameterizedHeaderField.
References headerField::m_value.
Referenced by headerField::setValue().
| ref< headerField > parseNext | ( | const string & | buffer, | |
| const string::size_type | position, | |||
| const string::size_type | end, | |||
| string::size_type * | newPosition = NULL | |||
| ) | [static, protected] |
References headerFieldFactory::create(), headerFieldFactory::getInstance(), and parserHelpers::isSpace().
Referenced by header::parse().
| void setName | ( | const string & | name | ) |
Sets the name of this field.
| name | field name (eg: "From" or "X-MyField"). |
References headerField::m_name.
| void setValue | ( | const string & | value | ) |
Set the value of this field given a character string.
| value | value string to parse |
References headerField::parse().
| void setValue | ( | const headerFieldValue & | value | ) | [virtual] |
Set the value of this field (reference version).
The value will be cloned.
| value | new value |
References component::clone(), and headerField::m_value.
| void setValue | ( | ref< headerFieldValue > | value | ) | [virtual] |
| void setValueConst | ( | ref< const headerFieldValue > | value | ) | [virtual] |
Set the value of this field by cloning the specified value.
| value | new value |
References headerField::m_value.
ref<headerFieldValue> m_value [protected] |
1.6.2