File: userlist.h

package info (click to toggle)
postal 0.70
  • links: PTS
  • area: main
  • in suites: lenny, squeeze
  • size: 540 kB
  • ctags: 525
  • sloc: cpp: 4,131; sh: 289; ansic: 258; makefile: 134
file content (43 lines) | stat: -rw-r--r-- 746 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef USERLIST_H
#define USERLIST_H

using namespace std;

#include "conf.h"

#ifdef HAVE_VECTOR
#include <vector>
#else
#include <vector.h>
#endif

#include <string>

typedef vector<string> STR_VEC;

#include "postal.h"

class UserList
{
public:
  UserList(const char *userListFile, bool usePass, bool stripDom = false);
  UserList(UserList &list);
  ~UserList();

  const string &randomUser();
  string password(); // get the password from the last user we got
  string sequentialUser();
  size_t maxNameLen() const { return m_maxNameLen; }

private:
  STR_VEC *m_users;
  STR_VEC *m_passwords;
  unsigned int m_index;
  size_t m_maxNameLen;
  bool m_primary;

  UserList(const UserList&);
  UserList & operator=(const UserList&);
};

#endif