Main Page Class Hierarchy Alphabetical List Compound List Examples |
#include <field.h>
Public Types | |
typedef mimetic::istring | istring |
Public Member Functions | |
Field (const std::string &) | |
Field (const std::string &, const std::string &) | |
Field (const Field &) | |
Field & | operator= (const Field &) |
void | name (const std::string &) |
const istring & | name () const |
void | value (const std::string &) |
std::string | value () const |
std::ostream & | write (std::ostream &, unsigned int fold=0) const |
Static Public Attributes | |
const Field | null |
Friends | |
class | Rfc822Header |
std::ostream & | operator<< (std::ostream &, const Field &) |
Field class is a C++ representation of RFC822 header field. Use this class when you need to create or parse messages' header fields. Note that field name is case insensitive.
Parsing:
Rfc822::Field f1("X-My-Field: some text(with a trailing comment)"); cout << f.name() << endl; cout << f.value() << endl; cout << f.value(true) << endl; // canonicalize (see RFC822)
Building:
Rfc822::Field f; f.name("X-Unknown"); f.value("some text(with a trailing comment)"); cout << f;