E-MailRelay
|
Represents the protocol's view of the pop store having 1-based message ids. More...
#include <gpopstore.h>
Public Types | |
using | Size = StoreMessage::Size |
using | List = std::vector< StoreMessage > |
Public Member Functions | |
StoreList () | |
Constructor for an empty list. | |
StoreList (const StoreUser &, bool allow_delete) | |
Constructor. More... | |
List::const_iterator | cbegin () const |
Returns the begin iterator. More... | |
List::const_iterator | cend () const |
Returns the end iterator. More... | |
List::value_type | get (int id) const |
Returns the item with index id-1. More... | |
Size | messageCount () const |
Returns the store's message count. More... | |
Size | totalByteCount () const |
Returns the store's total byte count. More... | |
std::string | uidl (int id) const |
Returns a message's unique 1-based id. More... | |
bool | valid (int id) const |
Validates a message id. More... | |
Size | byteCount (int id) const |
Returns the message size. More... | |
std::unique_ptr< std::istream > | content (int id) const |
Retrieves the message content. More... | |
void | remove (int) |
Marks the message files for deletion. More... | |
void | rollback () |
Rolls back remove()als. More... | |
void | commit () |
Commits remove()als. More... | |
StoreList (const StoreList &)=delete | |
StoreList (StoreList &&)=default | |
StoreList & | operator= (const StoreList &)=delete |
StoreList & | operator= (StoreList &&)=default |
Represents the protocol's view of the pop store having 1-based message ids.
Messages can be marked as deleted and then actually deleted by commit().
Definition at line 146 of file gpopstore.h.
using GPop::StoreList::List = std::vector<StoreMessage> |
Definition at line 152 of file gpopstore.h.
using GPop::StoreList::Size = StoreMessage::Size |
Definition at line 151 of file gpopstore.h.
GPop::StoreList::StoreList | ( | const StoreUser & | store_user, |
bool | allow_delete | ||
) |
Constructor.
Definition at line 228 of file gpopstore.cpp.
GPop::StoreList::Size GPop::StoreList::byteCount | ( | int | id | ) | const |
Returns the message size.
Definition at line 278 of file gpopstore.cpp.
GPop::StoreList::List::const_iterator GPop::StoreList::cbegin | ( | ) | const |
Returns the begin iterator.
Definition at line 236 of file gpopstore.cpp.
GPop::StoreList::List::const_iterator GPop::StoreList::cend | ( | ) | const |
Returns the end iterator.
Definition at line 241 of file gpopstore.cpp.
void GPop::StoreList::commit | ( | ) |
Commits remove()als.
Messages remain marked for deletion so another commit() will emit 'cannot delete' error messages.
Definition at line 316 of file gpopstore.cpp.
std::unique_ptr< std::istream > GPop::StoreList::content | ( | int | id | ) | const |
Retrieves the message content.
Definition at line 285 of file gpopstore.cpp.
GPop::StoreMessage GPop::StoreList::get | ( | int | id | ) | const |
Returns the item with index id-1.
Definition at line 271 of file gpopstore.cpp.
GPop::StoreMessage::Size GPop::StoreList::messageCount | ( | ) | const |
Returns the store's message count.
Definition at line 246 of file gpopstore.cpp.
void GPop::StoreList::remove | ( | int | id | ) |
Marks the message files for deletion.
Definition at line 307 of file gpopstore.cpp.
void GPop::StoreList::rollback | ( | ) |
Rolls back remove()als.
Definition at line 357 of file gpopstore.cpp.
GPop::StoreList::Size GPop::StoreList::totalByteCount | ( | ) | const |
Returns the store's total byte count.
Definition at line 254 of file gpopstore.cpp.
std::string GPop::StoreList::uidl | ( | int | id | ) | const |
Returns a message's unique 1-based id.
Definition at line 349 of file gpopstore.cpp.
bool GPop::StoreList::valid | ( | int | id | ) | const |
Validates a message id.
Definition at line 265 of file gpopstore.cpp.