1 #ifndef USERLIST_H 2 #define USERLIST_H 3 4 using namespace std; 5 6 #include "conf.h" 7 8 #ifdef HAVE_VECTOR 9 #include <vector> 10 #else 11 #include <vector.h> 12 #endif 13 14 #include <string> 15 16 typedef vector<string> STR_VEC; 17 18 #include "postal.h" 19 20 class UserList 21 { 22 public: 23 UserList(const char *userListFile, bool usePass, bool stripDom = false); 24 UserList(UserList &list); 25 ~UserList(); 26 27 const string &randomUser(); 28 string password(); // get the password from the last user we got 29 string sequentialUser(); 30 size_t maxNameLen() const { return m_maxNameLen; } 31 32 private: 33 STR_VEC *m_users; 34 STR_VEC *m_passwords; 35 unsigned int m_index; 36 size_t m_maxNameLen; 37 bool m_primary; 38 39 UserList(const UserList&); 40 UserList & operator=(const UserList&); 41 }; 42 43 #endif