"Fossies" - the Fresh Open Source Software Archive

Member "postal-0.76/bhmusers.h" (30 Jun 2016, 831 Bytes) of package /linux/privat/postal-0.76.tgz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "bhmusers.h" see the Fossies "Dox" file reference documentation.

    1 #ifndef USERLIST_H
    2 #define USERLIST_H
    3 
    4 using namespace std;
    5 
    6 #include <string>
    7 #include "conf.h"
    8 
    9 #include <tr1/unordered_map>
   10 
   11 #include "postal.h"
   12 
   13 typedef enum { eNone = 0, eDefer, eReject, eBounce, eGrey } USER_SMTP_ACTION;
   14 
   15 typedef struct
   16 {
   17   USER_SMTP_ACTION action;
   18   int sync_time;
   19 } BHM_DATA;
   20 
   21 typedef std::tr1::unordered_map<string, BHM_DATA, hash<string> > NAME_MAP;
   22 
   23 class BHMUsers
   24 {
   25 public:
   26   BHMUsers(const char *userListFile);
   27   ~BHMUsers() {};
   28 
   29 private:
   30   BHMUsers(BHMUsers &list);
   31 
   32   NAME_MAP m_map;
   33 
   34   USER_SMTP_ACTION chrToAction(char c)
   35   {
   36     switch(c)
   37     {
   38     case 'd':
   39       return eDefer;
   40     case 'r':
   41       return eReject;
   42     case 'b':
   43       return eBounce;
   44     case 'g':
   45       return eGrey;
   46     }
   47     return eNone;
   48   }
   49 
   50   BHMUsers(const BHMUsers&);
   51   BHMUsers & operator=(const BHMUsers&);
   52 };
   53 
   54 #endif