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
StoreList & | operator= (const StoreList &)=delete
StoreList & | operator= (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 146 of file gpopstore.h.

## Member Typedef Documentation

## ◆ List

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

Definition at line 152 of file gpopstore.h.

## ◆ Size

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

Definition at line 151 of file gpopstore.h.

## Constructor & Destructor Documentation

## ◆ StoreList()

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

Constructor.

Definition at line 228 of file gpopstore.cpp.

## Member Function Documentation

## ◆ byteCount()

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

Returns the message size.

Definition at line 278 of file gpopstore.cpp.

## ◆ cbegin()

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

Returns the begin iterator.

Definition at line 236 of file gpopstore.cpp.

## ◆ cend()

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

Returns the end iterator.

Definition at line 241 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 316 of file gpopstore.cpp.

## ◆ content()

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

Retrieves the message content.

Definition at line 285 of file gpopstore.cpp.

## ◆ get()

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

Returns the item with index id-1.

Definition at line 271 of file gpopstore.cpp.

## ◆ messageCount()

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

Returns the store's message count.

Definition at line 246 of file gpopstore.cpp.

## ◆ remove()

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

Marks the message files for deletion.

Definition at line 307 of file gpopstore.cpp.

## ◆ rollback()

void GPop::StoreList::rollback | ( |  | ) |

Rolls back remove()als.

Definition at line 357 of file gpopstore.cpp.

## ◆ totalByteCount()

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

Returns the store's total byte count.

Definition at line 254 of file gpopstore.cpp.

## ◆ uidl()

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

Returns a message's unique 1-based id.

Definition at line 349 of file gpopstore.cpp.

## ◆ valid()

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

Validates a message id.

Definition at line 265 of file gpopstore.cpp.

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

- /tmp/slackdce/slackrepo.HKsbdz/build_emailrelay/emailrelay-2.6/src/gpop/gpopstore.h
- /tmp/slackdce/slackrepo.HKsbdz/build_emailrelay/emailrelay-2.6/src/gpop/gpopstore.cpp