Advanced Strategic Command
password.h
Go to the documentation of this file.
1 /***************************************************************************
2  password.h - description
3  -------------------
4  begin : Mon Nov 27 2000
5  copyright : (C) 2000 by Martin Bickel
6  email : bickel@asc-hq.org
7  ***************************************************************************/
8 
13 /***************************************************************************
14  * *
15  * This program is free software; you can redistribute it and/or modify *
16  * it under the terms of the GNU General Public License as published by *
17  * the Free Software Foundation; either version 2 of the License, or *
18  * (at your option) any later version. *
19  * *
20  ***************************************************************************/
21 
22 #ifndef password_h_included
23  #define password_h_included
24 
25  #include <string>
26  #include "basestreaminterface.h"
27  class Password {
28  ASCString password;
29  protected:
30  int encodepassword ( const char* pw ) const ;
31  string encodedpassword2string ( int pwd ) const;
32 
33  public:
34  void setUnencoded ( const string& s );
35  void setEncoded ( const string& s );
36  void setInt ( int pwd );
37  bool empty() const;
38  void reset();
39  string toString ( ) const ;
40 
41  bool operator== ( const Password& p ) const;
42  bool operator!= ( const Password& p ) const;
43  void read ( tnstream& stream );
44  void write ( tnstream& stream ) const;
45 
46  };
47 
48 
49 #endif
bool operator!=(const Password &p) const
Definition: password.cpp:54
void write(tnstream &stream) const
Definition: password.cpp:106
void read(tnstream &stream)
Definition: password.cpp:100
int encodepassword(const char *pw) const
Definition: password.cpp:60
The interface for all kinds of IO stream.
void setUnencoded(const string &s)
Definition: password.cpp:27
The ASCString class provides an abstract way to manipulate strings.
Definition: ascstring.h:14
void setEncoded(const string &s)
Definition: password.cpp:32
bool empty() const
Definition: password.cpp:89
void setInt(int pwd)
Definition: password.cpp:44
string encodedpassword2string(int pwd) const
Definition: password.cpp:73
void reset()
Definition: password.cpp:120
string toString() const
Definition: password.cpp:94
The standard interface for ASC streams. This is the parent class for all kinds of streams: normal fil...
bool operator==(const Password &p) const
Definition: password.cpp:49