headerField Class Reference

Base class for header fields. More...

Inheritance diagram for headerField:
Inheritance graph
[legend]
Collaboration diagram for headerField:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ~headerField ()
ref< componentclone () const
void copyFrom (const component &other)
headerFieldoperator= (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< headerFieldValuegetValue ()
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< headerFieldparseNext (const string &buffer, const string::size_type position, const string::size_type end, string::size_type *newPosition=NULL)

Protected Attributes

string m_name
ref< headerFieldValuem_value

Detailed Description

Base class for header fields.


Constructor & Destructor Documentation

headerField (  )  [protected]
headerField ( const string fieldName  )  [protected]
~headerField (  ) 

Member Function Documentation

ref< component > clone (  )  const [virtual]

Clone this component.

Returns:
a copy of 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.

Exceptions:
std::bad_cast_exception if the components are not of the same (dynamic) type
Parameters:
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.

Parameters:
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).

Returns:
list of child components

Implements component.

Reimplemented in parameterizedHeaderField.

References headerField::m_value.

const string getName (  )  const

Return the name of this field.

Returns:
field name

References headerField::m_name.

ref< headerFieldValue > getValue (  )  [virtual]

Return the value object attached to this field.

Returns:
value object

References headerField::m_value.

ref< const headerFieldValue > getValue (  )  const [virtual]

Return the read-only value object attached to this field.

Returns:
read-only value object

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-".

Returns:
true if the field is a custom field, false otherwise

References headerField::m_name.

headerField & operator= ( const headerField other  ) 
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.

Parameters:
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]
void setName ( const string name  ) 

Sets the name of this field.

Parameters:
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.

Parameters:
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.

Parameters:
value new value

References component::clone(), and headerField::m_value.

void setValue ( ref< headerFieldValue value  )  [virtual]

Set the value of this field.

Parameters:
value new value

References headerField::m_value.

void setValueConst ( ref< const headerFieldValue value  )  [virtual]

Set the value of this field by cloning the specified value.

Parameters:
value new value

References headerField::m_value.


Member Data Documentation

string m_name [protected]
ref<headerFieldValue> m_value [protected]

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

Generated by  doxygen 1.6.2