00001 #ifndef __PROFILE_H__ 00002 #define __PROFILE_H__ 00003 00004 #include "Common/Types.h" 00005 #include "Common/Table.h" 00006 00007 class KIni; 00008 00009 //--------------------------------------------------------------------------------------------------------------------- 00010 class KProfile 00011 { 00012 protected: 00013 char* m_pLogin; 00014 char* m_pPassword; 00015 char* m_pNickname; 00016 00017 public: 00018 KProfile(); 00019 KProfile( char* pLogin, char* pPassword, char* pNickname ); 00020 ~KProfile(); 00021 00022 char* GetpLogin() { return m_pLogin; } 00023 char* GetpPassword() { return m_pPassword; } 00024 char* GetpNickname() { return m_pNickname; } 00025 00026 void SetpLogin( char* pLogin ); 00027 void SetpPassword( char* pPassword ); 00028 void SetpNickname( char* pNickname ); 00029 }; 00030 00031 //--------------------------------------------------------------------------------------------------------------------- 00032 class KProfileBank 00033 { 00034 protected: 00035 KTable<KProfile*> m_ProfileList; 00036 KIni* m_pIni; 00037 KProfile* m_pCurrent; 00038 00039 public: 00040 KProfileBank(); 00041 ~KProfileBank(); 00042 00043 void AddpProfile( KProfile* pProfile ) { m_ProfileList.Add( pProfile ); } 00044 u32 GetnProfiles() { return m_ProfileList.GetSize(); } 00045 KProfile* GetpProfile( u32 ProfileId ) { return m_ProfileList[ProfileId]; } 00046 bool LoadProfiles(); 00047 bool SaveProfiles(); 00048 void Flush(); 00049 KProfile* GetpCurrent() { return m_pCurrent; } 00050 void SetpCurrent( KProfile* pCurrent ) { m_pCurrent = pCurrent; } 00051 }; 00052 00053 #endif __PROFILE_H__
1.5.1-p1