00001 /* 00002 ** Passport -- a class to handle passport operations, 00003 ** 00004 */ 00005 00006 #ifndef PASSPORT_H 00007 #define PASSPORT_H 00008 00009 // microsoft pragma to avoid warnings relating to the container 00010 // template names being too long 00011 #pragma warning(disable:4786) 00012 00013 #include <string> 00014 #include <map> 00015 00016 typedef struct // _PASSPORT_ENTRY 00017 { 00018 char _key[18]; 00019 char _value[40]; 00020 } PASSPORT_ENTRY; 00021 00022 00023 typedef std::map<std::string, PASSPORT_ENTRY> PASSPORT_MAP; 00024 typedef PASSPORT_MAP::iterator PASSPORT_MAP_ITR; 00025 00026 00027 // --------------------------------------------------------- 00028 00029 class Passport 00030 { 00031 protected: 00032 00033 PASSPORT_MAP Entries; 00034 00035 public: 00036 00037 Passport(); 00038 ~Passport(); 00039 00040 bool AddEntry( std::string p_key, PASSPORT_ENTRY p_entry ); 00041 00042 bool GetEntry( std::string p_key, PASSPORT_ENTRY * p_container ); 00043 00044 bool LoadEntries(); 00045 00046 bool DeleteEntry( std::string p_key ); 00047 }; 00048 00049 #endif