1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
| // comments.cpp: implementation of the comments class.
//
//////////////////////////////////////////////////////////////////////
#include "comments.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
Comments::Comments() {
this->date_.InitHashTable(50);
this->comm_.InitHashTable(50);
}
Comments::~Comments() {
}
void Comments::Serialize(CArchive& ar) {
if (ar.IsStoring()) {
this->comm_.Serialize(ar);
this->date_.Serialize(ar);
} else { //IsLoading
this->comm_.Serialize(ar);
this->date_.Serialize(ar);
}
}
bool Comments::getDate(CString key, CString* retour) {
BOOL res;
CString str;
res = this->date_.Lookup(key, str);
retour->Format(L"%s", str);
return res != 0;
}
bool Comments::getComment(CString key, CString* retour) {
BOOL res;
CString str;
res = this->comm_.Lookup(key, str);
retour->Format(L"%s", str);
return res !=0;
}
void Comments::insere(CString key, CString date) {
this->date_.SetAt(key, date);
}
void Comments::insere(CString key, CString date, CString commentaire){
this->date_.SetAt(key, date);
this->comm_.SetAt(key, commentaire);
} |