00001 /*************************************************************************** 00002 password.h - description 00003 ------------------- 00004 begin : Mon Nov 27 2000 00005 copyright : (C) 2000 by Martin Bickel 00006 email : bickel@asc-hq.org 00007 ***************************************************************************/ 00008 00013 /*************************************************************************** 00014 * * 00015 * This program is free software; you can redistribute it and/or modify * 00016 * it under the terms of the GNU General Public License as published by * 00017 * the Free Software Foundation; either version 2 of the License, or * 00018 * (at your option) any later version. * 00019 * * 00020 ***************************************************************************/ 00021 00022 #ifndef password_h_included 00023 #define password_h_included 00024 00025 #include <string> 00026 #include "basestreaminterface.h" 00027 class Password { 00028 ASCString password; 00029 protected: 00030 int encodepassword ( const char* pw ) const ; 00031 string encodedpassword2string ( int pwd ) const; 00032 00033 public: 00034 void setUnencoded ( const string& s ); 00035 void setEncoded ( const string& s ); 00036 void setInt ( int pwd ); 00037 bool empty() const; 00038 void reset(); 00039 string toString ( ) const ; 00040 00041 bool operator== ( const Password& p ) const; 00042 bool operator!= ( const Password& p ) const; 00043 void read ( tnstream& stream ); 00044 void write ( tnstream& stream ) const; 00045 00046 }; 00047 00048 00049 #endif
1.4.2