Bincimap 2.0.16
Easy Imapping
|
The MaildirMessage class provides an interface for IMAP messages. More...
#include <maildirmessage.h>
Public Types | |
enum | Flags { None = 0x00 , Expunged = 0x01 , FlagsChanged = 0x02 , JustArrived = 0x04 , WasWrittenTo = 0x08 , Committed = 0x10 , CustomFlagsChanged = 0x20 } |
Public Member Functions | |
void | setUID (unsigned int uid) |
unsigned int | getUID (void) const |
void | setSize (unsigned int size) |
unsigned int | getSize (bool determine=false) const |
void | setStdFlag (unsigned char flags) |
void | resetStdFlags (void) |
unsigned char | getStdFlags (void) const |
void | setCustomFlag (const std::string &flag) |
void | removeCustomFlag (const std::string &flag) |
void | resetCustomFlags (void) |
std::vector< std::string > | getCustomFlags (void) const |
void | setInternalFlag (unsigned char flags) |
void | clearInternalFlag (unsigned char flags) |
unsigned char | getInternalFlags (void) const |
void | setFlagsUnchanged (void) |
bool | hasFlagsChanged (void) const |
void | setInternalDate (time_t internaldate) |
time_t | getInternalDate (void) const |
int | readChunk (std::string &chunk) |
bool | appendChunk (const std::string &chunk) |
void | close (void) |
void | setExpunged (void) |
void | setUnExpunged (void) |
bool | isExpunged (void) const |
const std::string & | getHeader (const std::string &header) |
bool | headerContains (const std::string &header, const std::string &text) |
bool | bodyContains (const std::string &text) |
bool | textContains (const std::string &text) |
bool | printBodyStructure (bool extended=true) const |
bool | printEnvelope (void) const |
bool | printHeader (const std::string §ion, std::vector< std::string > headers, bool includeHeaders=false, unsigned int startOffset=0, unsigned int length=UINTMAX, bool mime=false) const |
unsigned int | getHeaderSize (const std::string §ion, std::vector< std::string > headers, bool includeHeaders=false, unsigned int startOffset=0, unsigned int length=UINTMAX, bool mime=false) const |
bool | printBody (const std::string §ion="", unsigned int startOffset=0, unsigned int length=UINTMAX) const |
unsigned int | getBodySize (const std::string §ion, unsigned int startOffset=0, unsigned int length=UINTMAX) const |
bool | printDoc (unsigned int startOffset=0, unsigned int length=UINTMAX, bool onlyText=false) const |
unsigned int | getDocSize (unsigned int startOffset=0, unsigned int length=UINTMAX, bool onlyText=false) const |
void | setUnique (const std::string &s_in) |
const std::string & | getUnique (void) const |
MaildirMessage (Maildir &home) | |
~MaildirMessage (void) | |
bool | operator< (const MaildirMessage &a) const |
MaildirMessage (const MaildirMessage ©) | |
MaildirMessage & | operator= (const MaildirMessage ©) |
Protected Member Functions | |
bool | parseFull (void) const |
bool | parseHeaders (void) const |
std::string | getFixedFilename (void) const |
std::string | getFileName (void) const |
void | setFile (int fd) |
int | getFile (void) const |
void | setSafeName (const std::string &name) |
const std::string & | getSafeName (void) const |
Friends | |
class | Maildir |
The MaildirMessage class provides an interface for IMAP messages.
Mailbox independent operations and properties are available through this interface.
Definition at line 37 of file maildirmessage.h.
enum Flags |
Enumerator | |
---|---|
None | |
Expunged | |
FlagsChanged | |
JustArrived | |
WasWrittenTo | |
Committed | |
CustomFlagsChanged |
Definition at line 243 of file maildirmessage.h.
MaildirMessage | ( | Maildir & | home | ) |
Definition at line 383 of file maildirmessage.cc.
~MaildirMessage | ( | void | ) |
Definition at line 406 of file maildirmessage.cc.
MaildirMessage | ( | const MaildirMessage & | copy | ) |
Definition at line 391 of file maildirmessage.cc.
|
virtual |
Appends a chunk of bytes to a message. appendChunk() is used for copying or appending a message to a mailbox.
chunk | The content of this string is appended to the message. |
Implements Message.
Definition at line 679 of file maildirmessage.cc.
|
virtual |
Implements Message.
Definition at line 927 of file maildirmessage.cc.
void clearInternalFlag | ( | unsigned char | flags | ) |
Removes the internal flags.
flags | a bitmask of the Flags enum. |
Definition at line 1097 of file maildirmessage.cc.
|
virtual |
Resets a message and frees all allocated resources.
Implements Message.
Definition at line 441 of file maildirmessage.cc.
|
virtual |
Implements Message.
Definition at line 851 of file maildirmessage.cc.
|
virtual |
Implements Message.
Definition at line 1147 of file maildirmessage.cc.
|
virtual |
Implements Message.
Definition at line 891 of file maildirmessage.cc.
|
protected |
Definition at line 583 of file maildirmessage.cc.
|
protected |
Definition at line 645 of file maildirmessage.cc.
|
protected |
|
virtual |
Returns the first occurrance of a MIME header in a message, counting from the top of the message and downwards, or "" if no such header is found.
header | The name of the header to be fetched. |
Implements Message.
Definition at line 995 of file maildirmessage.cc.
|
virtual |
Implements Message.
Definition at line 795 of file maildirmessage.cc.
|
virtual |
Returns the internal date of the message in seconds since the epoch.
Implements Message.
Definition at line 539 of file maildirmessage.cc.
unsigned char getInternalFlags | ( | void | ) | const |
Returns the internal flags.
Definition at line 1091 of file maildirmessage.cc.
|
protected |
|
virtual |
Returns the size of the message, optionally determining the size if it is not yet known.
determine | If render is true and the size is unknown, the size will be calculated and stored implicitly. Otherwise if the size is unknown, 0 is returned. |
Implements Message.
Definition at line 522 of file maildirmessage.cc.
|
virtual |
Returns the flags that are set on a message.
Implements Message.
Definition at line 504 of file maildirmessage.cc.
|
virtual |
Returns the UID of a message.
Implements Message.
Definition at line 516 of file maildirmessage.cc.
const string & getUnique | ( | void | ) | const |
|
virtual |
Returns true if flags have been added or reset since the last call to setFlagsUnchanged(), otherwise returns false.
Implements Message.
Definition at line 498 of file maildirmessage.cc.
|
virtual |
Implements Message.
Definition at line 909 of file maildirmessage.cc.
|
virtual |
Returns true if the message is marked as expunged, otherwise returns false.
Implements Message.
Definition at line 510 of file maildirmessage.cc.
bool operator< | ( | const MaildirMessage & | a | ) | const |
Definition at line 436 of file maildirmessage.cc.
MaildirMessage & operator= | ( | const MaildirMessage & | copy | ) |
Definition at line 412 of file maildirmessage.cc.
|
protected |
Definition at line 717 of file maildirmessage.cc.
|
protected |
Definition at line 739 of file maildirmessage.cc.
|
virtual |
Implements Message.
Definition at line 828 of file maildirmessage.cc.
|
virtual |
Implements Message.
Definition at line 762 of file maildirmessage.cc.
|
virtual |
Implements Message.
Definition at line 872 of file maildirmessage.cc.
|
virtual |
Implements Message.
Definition at line 772 of file maildirmessage.cc.
|
virtual |
Implements Message.
Definition at line 782 of file maildirmessage.cc.
|
virtual |
Reads a chunk of up to 4096 bytes from a message. Call close() before readChunk() to read the first chunk from a message.
readChunk() is used for copying or appending a message to a mailbox.
chunk | The characters are stored in this string. |
Implements Message.
Definition at line 659 of file maildirmessage.cc.
|
virtual |
Implements Message.
Definition at line 1121 of file maildirmessage.cc.
|
virtual |
Implements Message.
Definition at line 1138 of file maildirmessage.cc.
|
virtual |
Resets all flags on a message.
Implements Message.
Definition at line 558 of file maildirmessage.cc.
|
virtual |
Implements Message.
Definition at line 1103 of file maildirmessage.cc.
|
virtual |
Marks the message as expunged. Equivalent to calling setStdFlag() with F_EXPUNGED.
Implements Message.
Definition at line 480 of file maildirmessage.cc.
|
protected |
|
virtual |
Sets a state in a message that indicates that no flags have been changed. Used together with hasFlagsChanged() to check if the flags in this message have been changed.
Implements Message.
Definition at line 492 of file maildirmessage.cc.
|
virtual |
Sets the internal date of a message. This is usually the date in which the message arrived in the mailbox.
internaldate | The internal date of the message in seconds since the epoch. |
Implements Message.
Definition at line 545 of file maildirmessage.cc.
void setInternalFlag | ( | unsigned char | flags | ) |
Sets the internal flags.
flags | a bitmask of the Flags enum. |
Definition at line 1085 of file maildirmessage.cc.
|
protected |
|
virtual |
Sets the size of the message. This size must be consistent with the size reported when fetching the full message.
size | The size of the message in characters, after any conversion to CRLF. |
Implements Message.
Definition at line 571 of file maildirmessage.cc.
|
virtual |
Adds one or more flags to a message.
flags | This is a bitmask of flags from the Flags enum. |
Implements Message.
Definition at line 551 of file maildirmessage.cc.
|
virtual |
Sets the UID of a message.
uid | The UID that will be set. |
Implements Message.
Definition at line 565 of file maildirmessage.cc.
|
virtual |
Removes the F_EXPUNGED flag from the message.
Implements Message.
Definition at line 486 of file maildirmessage.cc.
void setUnique | ( | const std::string & | s_in | ) |
|
virtual |
Implements Message.
Definition at line 965 of file maildirmessage.cc.
|
friend |
Definition at line 236 of file maildirmessage.h.