VMime
word Class Reference
Inheritance diagram for word:
Collaboration diagram for word:

Public Member Functions

 word ()
 
 word (const word &w)
 
 word (const string &buffer)
 
 word (const string &buffer, const charset &charset)
 
 word (const string &buffer, const charset &charset, const string &lang)
 
const stringgetBuffer () const
 
stringgetBuffer ()
 
bool isEmpty () const
 
void setBuffer (const string &buffer)
 
const charsetgetCharset () const
 
void setCharset (const charset &ch)
 
const string getLanguage () const
 
void setLanguage (const string &lang)
 
bool isEquivalent (const word &other) const
 
wordoperator= (const word &w)
 
wordoperator= (const string &s)
 
bool operator== (const word &w) const
 
bool operator!= (const word &w) const
 
const string getConvertedText (const charset &dest, const charsetConverterOptions &opts=charsetConverterOptions()) const
 
void copyFrom (const component &other)
 
shared_ptr< componentclone () const
 
const std::vector< shared_ptr
< component > > 
getChildComponents ()
 
- Public Member Functions inherited from headerFieldValue
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
 

Protected Member Functions

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
 
void parseWithState (const parsingContext &ctx, const string &buffer, const size_t position, const size_t end, size_t *newPosition, parserState *state)
 
- 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 &)
 
objectoperator= (const object &)
 
virtual ~object ()
 

Detailed Description

A class that encapsulates an encoded-word (RFC-2047): some text encoded into one specified charset.

Constructor & Destructor Documentation

word ( )

Construct an empty word.

Charset is set to the current locale charset.

word ( const word w)

Construct a word by copying another word.

word ( const string buffer)
explicit

Construct a word using a string buffer.

Charset is set to the current locale charset.

word ( const string buffer,
const charset charset 
)

Construct a word using a string buffer and a specified charset.

Parameters
bufferstring buffer
charsetcharset in which the string is encoded
word ( const string buffer,
const charset charset,
const string lang 
)

Construct a word using a string buffer and a specified charset and language tag (RFC-1766).

Parameters
bufferstring buffer
charsetcharset in which the string is encoded
langlanguage tag, in the format specified by RFC-1766

Member Function Documentation

shared_ptr< component > clone ( ) const
virtual

Clone this word.

Returns
a copy of this word

Implements component.

void copyFrom ( const component other)
virtual

Replace data in this word by data in other word.

Parameters
otherother word to copy data from

Implements component.

void generateImpl ( const generationContext ctx,
utility::outputStream os,
const size_t  curLinePos = 0,
size_t newLinePos = NULL 
) const
protectedvirtual

Implements component.

References component::generate().

string & getBuffer ( )

Return the raw data for this encoded word.

Returns
raw data buffer
const charset & getCharset ( ) const

Return the charset of this word.

Returns
charset for this word
const std::vector< shared_ptr< component > > getChildComponents ( )
virtual

Return the list of children of this component.

Returns
list of child components

Implements component.

const string getConvertedText ( const charset dest,
const charsetConverterOptions opts = charsetConverterOptions() 
) const

Return the contained text converted to the specified charset.

Parameters
destoutput charset
optsoptions for charset conversion
Returns
word converted to the specified charset

References charset::convert().

Referenced by word::isEquivalent(), and courierMaildirFormat::toModifiedUTF7().

const string getLanguage ( ) const

Return the language used in this word (optional).

If not specified, the value is empty.

Returns
language tag for this word, in the format specified by RFC-1766
bool isEmpty ( ) const

Tests whether this word is empty.

Returns
true if the buffer is empty, false otherwise

Referenced by fileAttachment::fileAttachment(), and emailAddress::isEmpty().

bool isEquivalent ( const word other) const

Returns whether two words actually represent the same text, regardless of their charset.

Parameters
otherword to compare to
Returns
true if the two words represent the same text, or false otherwise

References word::getConvertedText(), and vmime::charsets::UTF_8.

bool operator!= ( const word w) const
word & operator= ( const word w)
word & operator= ( const string s)
bool operator== ( const word w) const
void parseImpl ( const parsingContext ctx,
const string buffer,
const size_t  position,
const size_t  end,
size_t newPosition = NULL 
)
protectedvirtual

Reimplemented from component.

void parseWithState ( const parsingContext ctx,
const string buffer,
const size_t  position,
const size_t  end,
size_t newPosition,
parserState *  state 
)
protected
void setBuffer ( const string buffer)

Set the raw data for this encoded word.

Parameters
bufferraw data buffer

Referenced by kmailMaildirFormat::folderPathToFileSystemPath().

void setCharset ( const charset ch)

Set the charset of this word.

Parameters
chcharset of this word
void setLanguage ( const string lang)

Set the language used in this word (optional).

Parameters
langlanguage tag, in the format specified by RFC-1766

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