summaryrefslogtreecommitdiff
path: root/src/include/depot.h
diff options
context:
space:
mode:
authorJannis M. Hoffmann <jannis@fehcom.de>2023-10-07 22:33:50 +0200
committerJannis M. Hoffmann <jannis@fehcom.de>2023-10-08 11:35:51 +0200
commit1978c49bea5b439d993067c055cec47e70db8fd6 (patch)
tree255caea96a13f95564e6b631be9a4ac55ce33cd9 /src/include/depot.h
parent3b1278f5459514a6d6364f068ff97b8a0432057b (diff)
minor refactoring
Diffstat (limited to 'src/include/depot.h')
-rw-r--r--src/include/depot.h38
1 files changed, 16 insertions, 22 deletions
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 <map>
#include <string>
#include <vector>
@@ -18,7 +20,6 @@ namespace Binc {
class Depot;
class Status;
- //------------------------------------------------------------------
class DepotFactory {
private:
std::vector<Depot *> 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 &copy);
iterator(DIR *, struct dirent *);
~iterator(void);
- void deref(void);
-
iterator &operator=(const iterator &copy);
+ 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<std::string, Status> 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();
};