VMime
fetchAttributes Class Reference

#include <fetchAttributes.hpp>

Inheritance diagram for fetchAttributes:
Collaboration diagram for fetchAttributes:

Public Types

enum  PredefinedFetchAttributes {
  ENVELOPE = (1 << 0) , STRUCTURE = (1 << 1) , CONTENT_INFO = (1 << 2) , FLAGS = (1 << 3) ,
  SIZE = (1 << 4) , FULL_HEADER = (1 << 5) , UID = (1 << 6) , IMPORTANCE = (1 << 7) ,
  CUSTOM = (1 << 16)
}

Public Member Functions

 fetchAttributes ()
 fetchAttributes (const int attribs)
 fetchAttributes (const fetchAttributes &attribs)
void add (const int attribs)
void add (const string &header)
bool has (const int attribs) const
bool has (const string &header) const
VMIME_DEPRECATED bool operator& (const int attribs) const
const std::vector< stringgetHeaderFields () const

Additional Inherited Members

Protected Member Functions inherited from object
 object ()
 object (const object &)
objectoperator= (const object &)
virtual ~object ()

Detailed Description

Holds a set of attributes to fetch for a message.

Member Enumeration Documentation

◆ PredefinedFetchAttributes

Predefined attributes that can be fetched.

Enumerator
ENVELOPE 

Sender, recipients, date, subject.

STRUCTURE 

MIME structure (body parts).

CONTENT_INFO 

Top-level content type.

FLAGS 

Message flags.

SIZE 

Message size (exact or estimated).

FULL_HEADER 

Full RFC-[2]822 header.

UID 

Unique identifier (protocol specific).

IMPORTANCE 

Header fields suitable for use with misc::importanceHelper.

CUSTOM 

Reserved for future use.

Constructor & Destructor Documentation

◆ fetchAttributes() [1/3]

fetchAttributes ( )

Constructs an empty fetchAttributes object.

Referenced by fetchAttributes().

◆ fetchAttributes() [2/3]

fetchAttributes ( const int attribs)

Constructs a new fetchAttributes object by specifying one or more predefined objects.

Parameters
attribsone or more OR-ed values of the PredefinedFetchAttributes enum

◆ fetchAttributes() [3/3]

fetchAttributes ( const fetchAttributes & attribs)

Constructs a new fetchAttributes object by copying an existing object.

Parameters
attribsobject to copy

References fetchAttributes(), and object::object().

Member Function Documentation

◆ add() [1/2]

void add ( const int attribs)

Adds the specified predefined attribute to the set of attributes to fetch.

Parameters
attribsone or more OR-ed values of the PredefinedFetchAttributes enum

◆ add() [2/2]

void add ( const string & header)

Adds the specified header field to the set of attributes to fetch.

Fetching custom header fields is not supported by all protocols. At this time, only IMAP supports this.

Parameters
headername of header field (eg. "X-Mailer")

References stringUtils::toLower().

◆ getHeaderFields()

const std::vector< string > getHeaderFields ( ) const

Returns a list of header fields to fetch.

Returns
list of header names (eg. "X-Mailer")

◆ has() [1/2]

bool has ( const int attribs) const

Returns true if the set contains the specified attribute(s).

Parameters
attribsone or more OR-ed values of the PredefinedFetchAttributes enum
Returns
true if the specified attributes are to be fetched

Referenced by POP3Folder::fetchMessage(), POP3Folder::fetchMessages(), and operator&().

◆ has() [2/2]

bool has ( const string & header) const

Returns true if the set contains the specified header field.

Parameters
headername of header field (eg. "X-Mailer")
Returns
true if the specified header fields are to be fetched

References stringUtils::toLower().

◆ operator&()

VMIME_DEPRECATED bool operator& ( const int attribs) const

Returns true if the set contains the specified attribute(s).

Deprecated
Use the has() methods instead
Parameters
attribsone or more OR-ed values of the PredefinedFetchAttributes enum
Returns
true if the specified attributes are to be fetched

References has().


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