ARC SDK
PasswordSource.h
1 #ifndef __ARC_PASSWORD_SOURCE_H__
2 #define __ARC_PASSWORD_SOURCE_H__
3 
4 #include <string>
5 
6 namespace Arc {
7 
11 
12 
18  public:
19  typedef enum {
23  PASSWORD = 1,
25  CANCEL = 2
26  } Result;
27  virtual Result Get(std::string& password, int minsize, int maxsize) = 0;
28  virtual ~PasswordSource(void) { };
29 };
30 
33  public:
34  virtual Result Get(std::string& password, int minsize, int maxsize);
35 };
36 
39  private:
40  std::string password_;
41  public:
42  PasswordSourceString(const std::string& password);
43  virtual Result Get(std::string& password, int minsize, int maxsize);
44 };
45 
48  private:
49  std::istream* password_;
50  public:
51  PasswordSourceStream(std::istream* password);
52  virtual Result Get(std::string& password, int minsize, int maxsize);
53 };
54 
57  private:
58  std::string prompt_;
59  bool verify_;
60  public:
61  PasswordSourceInteractive(const std::string& prompt, bool verify);
62  virtual Result Get(std::string& password, int minsize, int maxsize);
63 };
64 
67 } // namespace Arc
68 
69 #endif // __ARC_PASSWORD_SOURCE_H__
70