VMime
|
Public Member Functions | |
~messageSet () | |
messageSet (const messageSet &other) | |
void | addRange (const messageRange &range) |
void | enumerate (messageSetEnumerator &en) const |
bool | isEmpty () const |
bool | isNumberSet () const |
bool | isUIDSet () const |
size_t | getRangeCount () const |
const messageRange & | getRangeAt (const size_t i) const |
Static Public Member Functions | |
static messageSet | empty () |
static messageSet | byNumber (const int number) |
static messageSet | byNumber (const int first, const int last) |
static messageSet | byNumber (const std::vector< int > &numbers) |
static messageSet | byUID (const message::uid &uid) |
static messageSet | byUID (const message::uid &first, const message::uid &last) |
static messageSet | byUID (const std::vector< message::uid > &uids) |
Additional Inherited Members | |
Protected Member Functions inherited from object | |
object () | |
object (const object &) | |
object & | operator= (const object &) |
virtual | ~object () |
Represents a set of messages, designated either by their sequence number, or by their UID (but not both).
Following is example code to designate messages by their number:
Or, to designate messages by their UID, use:
~messageSet | ( | ) |
messageSet | ( | const messageSet & | other | ) |
void addRange | ( | const messageRange & | range | ) |
Adds the specified range to this set.
The type of message range (either number or UID) must match the type of the ranges already contained in this set (ie. it's not possible to have a message set which contains both number ranges and UID ranges).
range | range to add |
std::invalid_argument | exception if the range type does not match the type of the ranges in this set |
References messageRange::clone().
|
static |
Constructs a new message set and initializes it with a single message represented by its sequence number.
number | message number (numbering starts at 1, not 0) |
Referenced by IMAPFolder::fetchMessages(), maildirMessage::setFlags(), and IMAPMessage::setFlags().
|
static |
Constructs a new message set and initializes it with a range of messages represented by their sequence number.
first | number of the first message in the range (numbering starts at 1, not 0) |
last | number of the last message in the range, or use the special value -1 to designate the last message in the folder |
|
static |
Constructs a new message set and initializes it with a possibly unsorted list of messages represented by their sequence number.
Please note that numbering starts at 1, not 0.
The function tries to group consecutive message numbers into ranges to reduce the size of the resulting set.
For example, given the list "1,2,3,4,5,7,8,13,15,16,17" it will result in the following ranges: "1:5,7:8,13,15:17".
numbers | a vector containing numbers of the messages |
|
static |
Constructs a new message set and initializes it with a single message represented by its UID.
uid | message UID |
Referenced by IMAPMessage::setFlags().
|
static |
Constructs a new message set and initializes it with a range of messages represented by their sequence number.
first | UID of the first message in the range |
last | UID of the last message in the range, or use the special value '*' to designate the last message in the folder |
|
static |
Constructs a new message set and initializes it with a possibly unsorted list of messages represented by their UID.
For UIDs that actually are numbers (this is the case for IMAP), the function tries to group consecutive UIDs into ranges to reduce the size of the resulting set.
For example, given the list "1,2,3,4,5,7,8,13,15,16,17" it will result in the following ranges: "1:5,7:8,13,15:17".
uids | a vector containing UIDs of the messages |
References stringUtils::toString().
|
static |
Constructs an empty set.
Referenced by maildirFolder::addMessage(), IMAPFolder::addMessage(), maildirFolder::copyMessages(), and IMAPFolder::copyMessages().
void enumerate | ( | messageSetEnumerator & | en | ) | const |
Enumerates this set with the specified enumerator.
en | enumerator that will receive the method calls while enumerating the ranges in this set |
Referenced by POP3Utils::messageSetToNumberList().
const messageRange & getRangeAt | ( | const size_t | i | ) | const |
Returns the message range at the specified index.
i | range index (from 0 to getRangeCount()) |
size_t getRangeCount | ( | ) | const |
Returns the number of ranges contained in this set.
bool isEmpty | ( | ) | const |
Returns whether this set is empty (contains no range).
Referenced by IMAPFolder::deleteMessages(), POP3Folder::getAndFetchMessages(), maildirFolder::getAndFetchMessages(), IMAPFolder::getAndFetchMessages(), IMAPFolder::getMessages(), messageSet::isNumberSet(), and messageSet::isUIDSet().
bool isNumberSet | ( | ) | const |
Returns whether this set references messages by their sequence number.
References messageSet::isEmpty().
Referenced by POP3Folder::getMessages(), maildirFolder::getMessages(), IMAPFolder::getMessages(), and maildirFolder::setMessageFlags().
bool isUIDSet | ( | ) | const |
Returns whether this set references messages by their UID.
References messageSet::isEmpty().
Referenced by IMAPCommand::COPY(), IMAPCommand::FETCH(), IMAPFolder::getMessages(), and IMAPCommand::STORE().