From 1978c49bea5b439d993067c055cec47e70db8fd6 Mon Sep 17 00:00:00 2001 From: "Jannis M. Hoffmann" Date: Sat, 7 Oct 2023 22:33:50 +0200 Subject: minor refactoring --- src/include/depot.h | 38 ++++++++++++++++---------------------- 1 file changed, 16 insertions(+), 22 deletions(-) (limited to 'src/include/depot.h') diff --git a/src/include/depot.h b/src/include/depot.h index bd4f743..3e65c8e 100644 --- a/src/include/depot.h +++ b/src/include/depot.h @@ -1,11 +1,13 @@ -/** -------------------------------------------------------------------- +/** * @filec depot.h * @file Declaration of the Depot class (the mail storage) * @author Andreas Aardal Hanssen * @date 2002-2005 - * ----------------------------------------------------------------- **/ + */ + #ifndef depot_h_included #define depot_h_included + #include #include #include @@ -18,7 +20,6 @@ namespace Binc { class Depot; class Status; - //------------------------------------------------------------------ class DepotFactory { private: std::vector depots; @@ -32,26 +33,24 @@ namespace Binc { ~DepotFactory(void); }; - //------------------------------------------------------------------ class Depot { public: - //-- class iterator { public: - std::string operator*(void) const; - void operator++(void); - bool operator!=(iterator) const; - bool operator==(iterator) const; - iterator(void); iterator(const iterator ©); iterator(DIR *, struct dirent *); ~iterator(void); - void deref(void); - iterator &operator=(const iterator ©); + std::string operator*(void) const; + void operator++(void); + bool operator!=(iterator) const; + bool operator==(iterator) const; + + void deref(void); + friend class Depot; private: @@ -77,11 +76,15 @@ namespace Binc { mutable std::map mailboxstatuses; public: + Depot(); + Depot(const std::string &name); + virtual ~Depot(void) = default; + virtual iterator begin(const std::string &) const; virtual const iterator &end(void) const; void setDelimiter(char); - const char getDelimiter(void) const; + char getDelimiter(void) const; virtual void assign(Mailbox *); @@ -116,14 +119,8 @@ namespace Binc { virtual bool unsubscribeTo(const std::string mailbox); virtual void loadSubscribes(void); virtual bool saveSubscribes(void) const; - - //-- - Depot(void); - Depot(const std::string &name); - virtual ~Depot(void); }; - //------------------------------------------------------------------ class MaildirPPDepot : public Depot { public: std::string mailboxToFilename(const std::string &m) const; @@ -131,7 +128,6 @@ namespace Binc { const std::string &getPersonalNamespace(void) const; - //-- MaildirPPDepot(); ~MaildirPPDepot(); @@ -139,13 +135,11 @@ namespace Binc { std::string privateNamespace; }; - //------------------------------------------------------------------ class IMAPdirDepot : public Depot { public: std::string mailboxToFilename(const std::string &m) const; std::string filenameToMailbox(const std::string &m) const; - //-- IMAPdirDepot(); ~IMAPdirDepot(); }; -- cgit v1.2.3