E-MailRelay
Public Types | Public Member Functions | List of all members
GPop::StoreList Class Reference

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
 
StoreListoperator= (const StoreList &)=delete
 
StoreListoperator= (StoreList &&)=default
 

Detailed Description

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().

See also
RFC-1939

Definition at line 132 of file gpopstore.h.

Member Typedef Documentation

◆ List

using GPop::StoreList::List = std::vector<StoreMessage>

Definition at line 138 of file gpopstore.h.

◆ Size

using GPop::StoreList::Size = StoreMessage::Size

Definition at line 137 of file gpopstore.h.

Constructor & Destructor Documentation

◆ StoreList()

GPop::StoreList::StoreList ( const StoreUser store_user,
bool  allow_delete 
)

Constructor.

Definition at line 210 of file gpopstore.cpp.

Member Function Documentation

◆ byteCount()

GPop::StoreList::Size GPop::StoreList::byteCount ( int  id) const

Returns the message size.

Definition at line 258 of file gpopstore.cpp.

◆ cbegin()

GPop::StoreList::List::const_iterator GPop::StoreList::cbegin ( ) const

Returns the begin iterator.

Definition at line 218 of file gpopstore.cpp.

◆ cend()

GPop::StoreList::List::const_iterator GPop::StoreList::cend ( ) const

Returns the end iterator.

Definition at line 223 of file gpopstore.cpp.

◆ commit()

void GPop::StoreList::commit ( )

Commits remove()als.

Messages remain marked for deletion so another commit() will emit 'cannot delete' error messages.

Definition at line 290 of file gpopstore.cpp.

◆ content()

std::unique_ptr< std::istream > GPop::StoreList::content ( int  id) const

Retrieves the message content.

Definition at line 264 of file gpopstore.cpp.

◆ get()

GPop::StoreMessage GPop::StoreList::get ( int  id) const

Returns the item with index id-1.

Definition at line 252 of file gpopstore.cpp.

◆ messageCount()

GPop::StoreMessage::Size GPop::StoreList::messageCount ( ) const

Returns the store's message count.

Definition at line 228 of file gpopstore.cpp.

◆ remove()

void GPop::StoreList::remove ( int  id)

Marks the message files for deletion.

Definition at line 284 of file gpopstore.cpp.

◆ rollback()

void GPop::StoreList::rollback ( )

Rolls back remove()als.

Definition at line 330 of file gpopstore.cpp.

◆ totalByteCount()

GPop::StoreList::Size GPop::StoreList::totalByteCount ( ) const

Returns the store's total byte count.

Definition at line 236 of file gpopstore.cpp.

◆ uidl()

std::string GPop::StoreList::uidl ( int  id) const

Returns a message's unique 1-based id.

Definition at line 323 of file gpopstore.cpp.

◆ valid()

bool GPop::StoreList::valid ( int  id) const

Validates a message id.

Definition at line 247 of file gpopstore.cpp.


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