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 };
29 
32  public:
33  virtual Result Get(std::string& password, int minsize, int maxsize);
34 };
35 
38  private:
39  std::string password_;
40  public:
41  PasswordSourceString(const std::string& password);
42  virtual Result Get(std::string& password, int minsize, int maxsize);
43 };
44 
47  private:
48  std::istream* password_;
49  public:
50  PasswordSourceStream(std::istream* password);
51  virtual Result Get(std::string& password, int minsize, int maxsize);
52 };
53 
56  private:
57  std::string prompt_;
58  bool verify_;
59  public:
60  PasswordSourceInteractive(const std::string& prompt, bool verify);
61  virtual Result Get(std::string& password, int minsize, int maxsize);
62 };
63 
66 } // namespace Arc
67 
68 #endif // __ARC_PASSWORD_SOURCE_H__
69