| | |
| | | Hashelement OverFlow;
|
| | | public:
|
| | |
|
| | | Hash::~Hash()
|
| | | ~Hash()
|
| | | {
|
| | | }
|
| | |
|
| | | Hash::Hash(void)
|
| | | Hash(void)
|
| | | {
|
| | | TotalKey=0;
|
| | | OverFlow = _T("OverFlow");
|
| | | };
|
| | | Hash::Hash(CString thisName)
|
| | | Hash(CString thisName)
|
| | | {
|
| | | TotalKey=0;
|
| | | this->Name=thisName;
|
| | |
| | | if (index == -1) return false;
|
| | | else return true;
|
| | | }
|
| | | Hashelement & Hash::operator [] (const char * str)
|
| | | Hashelement & operator [] (const char * str)
|
| | | {
|
| | | CString s1(str);
|
| | | return this->operator [] (s1);
|
| | | };
|
| | | Hashelement & Hash::operator [] (CString s)
|
| | | Hashelement & operator [] (CString s)
|
| | | {
|
| | | int left = 0;
|
| | | int right = TotalKey - 1;
|
| | |
| | |
|
| | | return elements[index];
|
| | | };
|
| | | Hashelement & Hash::operator [] (int k)
|
| | | Hashelement & operator [] (int k)
|
| | | {
|
| | | return elements[k];
|
| | | };
|
| | |
| | | }
|
| | | return nCount;
|
| | | }
|
| | | int Hash::SaveToFile(CString FilePathName,CString Section)
|
| | | int SaveToFile(CString FilePathName,CString Section)
|
| | | {
|
| | | int i;
|
| | | CString Key,Value;
|
| | |
| | | return 1;
|
| | | };
|
| | |
|
| | | int Hash::LoadFromFile(CString FilePathName,CString Section)
|
| | | int LoadFromFile(CString FilePathName,CString Section)
|
| | | {
|
| | | CString Key;
|
| | | CString value,value1,value2;
|
| | |
| | | for (int i=0; i<h2.TotalKey; ++i)
|
| | | {
|
| | | CString key = *(h2.elements[i].Key);
|
| | | CString value1 = h1[key];
|
| | | CString value1 = *(h1[key].Value);
|
| | | CString value2 = *(h2.elements[i].Value);
|
| | | if (value1.GetLength()>256 || value2.GetLength()>256)
|
| | | {
|