diff options
Diffstat (limited to 'src/include/maildir.h')
-rw-r--r-- | src/include/maildir.h | 53 |
1 files changed, 24 insertions, 29 deletions
diff --git a/src/include/maildir.h b/src/include/maildir.h index 4a262b5..dda88df 100644 --- a/src/include/maildir.h +++ b/src/include/maildir.h @@ -6,13 +6,13 @@ * ----------------------------------------------------------------- **/ #ifndef maildir_h_included #define maildir_h_included -#include <string> -#include <vector> -#include <map> - #include "mailbox.h" #include "maildirmessage.h" +#include <map> +#include <string> +#include <vector> + namespace Binc { static const std::string CACHEFILEVERSION = "1.0.5"; static const std::string UIDVALFILEVERSION = "1.0.5"; @@ -26,7 +26,7 @@ namespace Binc { private: std::string lock; }; - + //------------------------------------------------------------------------ class MaildirIndexItem { public: @@ -35,14 +35,12 @@ namespace Binc { }; //------------------------------------------------------------------------ - class MaildirIndex - { + class MaildirIndex { private: std::map<std::string, MaildirIndexItem> idx; public: - void insert(const std::string &unique, unsigned int uid, - const std::string &fileName = ""); + void insert(const std::string &unique, unsigned int uid, const std::string &fileName = ""); void remove(const std::string &unique); void clear(void); void clearFileNames(void); @@ -59,18 +57,19 @@ namespace Binc { class iterator : public BaseIterator { public: iterator(void); - iterator(Maildir *home, MessageMap::iterator i, + iterator(Maildir *home, + MessageMap::iterator i, const SequenceSet &bset, unsigned int mod = INCLUDE_EXPUNGED | SQNR_MODE); iterator(const iterator ©); ~iterator(void); - Message &operator *(void); - void operator ++(void); - bool operator ==(const BaseIterator &) const; - bool operator !=(const BaseIterator &) const; + Message &operator*(void); + void operator++(void); + bool operator==(const BaseIterator &) const; + bool operator!=(const BaseIterator &) const; - iterator &operator =(const iterator ©); + iterator &operator=(const iterator ©); void erase(void); @@ -94,7 +93,8 @@ namespace Binc { const std::string getTypeName(void) const; - Mailbox::iterator begin(const SequenceSet &bset, unsigned int mod = INCLUDE_EXPUNGED | SQNR_MODE) const; + Mailbox::iterator begin(const SequenceSet &bset, + unsigned int mod = INCLUDE_EXPUNGED | SQNR_MODE) const; Mailbox::iterator end(void) const; unsigned int getMaxUid(void) const; @@ -102,8 +102,7 @@ namespace Binc { unsigned int getUidValidity(void) const; unsigned int getUidNext(void) const; - bool getUpdates(bool doscan, unsigned int type, - PendingUpdates &updates, bool forceScan); + bool getUpdates(bool doscan, unsigned int type, PendingUpdates &updates, bool forceScan); const std::string &getPath(void) const; void setPath(const std::string &path_in); @@ -119,7 +118,11 @@ namespace Binc { bool selectMailbox(const std::string &name, const std::string &s_in); void closeMailbox(void); void expungeMailbox(void); - bool createMailbox(const std::string &s, mode_t mode, uid_t owner = 0, gid_t group = 0, bool root = false); + bool createMailbox(const std::string &s, + mode_t mode, + uid_t owner = 0, + gid_t group = 0, + bool root = false); bool deleteMailbox(const std::string &s); Message *createMessage(const std::string &mbox, time_t idate = 0); @@ -136,21 +139,13 @@ namespace Binc { friend class MaildirMessage; protected: - enum ReadCacheResult { - Ok, - NoCache, - Error - }; + enum ReadCacheResult { Ok, NoCache, Error }; ReadCacheResult readCache(void); bool writeCache(void); bool scanFileNames(void) const; - enum ScanResult { - Success = 0, - TemporaryError = 1, - PermanentError = 2 - }; + enum ScanResult { Success = 0, TemporaryError = 1, PermanentError = 2 }; ScanResult scan(bool forceScan = false); |