summaryrefslogtreecommitdiffabout
path: root/T42CallLog.h
Unidiff
Diffstat (limited to 'T42CallLog.h') (more/less context) (show whitespace changes)
-rw-r--r--T42CallLog.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/T42CallLog.h b/T42CallLog.h
new file mode 100644
index 0000000..fa4a331
--- a/dev/null
+++ b/T42CallLog.h
@@ -0,0 +1,53 @@
1 class CT42CallLogEntry : public CObject{
2public:
3 enum {
4 statusOk = 0, statusFailed, statusProcessed,
5 statusNone
6 };
7 UINT m_Status;
8 CTime m_Time;
9 CString m_Caller;
10 CString m_Callee;
11 CString m_TTY;
12 CTimeSpan m_Duration;
13 CString m_Message;
14
15 CT42CallLogEntry() : m_Status(statusNone) {}
16 CT42CallLogEntry(CT42CallLogEntry& src) { Copy(src); }
17
18 void Copy(const CT42CallLogEntry& src) {
19 m_Status = src.m_Status;
20 m_Time = src.m_Time;
21 m_Caller = src.m_Caller; m_Callee = src.m_Callee;
22 m_TTY = src.m_TTY;
23 m_Duration = src.m_Duration;
24 m_Message = src.m_Message;
25 }
26 CT42CallLogEntry& operator=(const CT42CallLogEntry& src) {
27 Copy(src);
28 return *this;
29 }
30
31 void Serialize(CArchive& ar) {
32 if(ar.IsStoring()){
33 ar << m_Status;
34 ar << m_Time;
35 ar << m_Caller; ar << m_Callee; ar << m_TTY;
36 ar << m_Duration;
37 ar << m_Message;
38 }else{
39 ar >> m_Status;
40 ar >> m_Time;
41 ar >> m_Caller; ar >> m_Callee; ar >> m_TTY;
42 ar >> m_Duration;
43 ar >> m_Message;
44 }
45 }
46};
47
48inline void SerializeElements(CArchive& ar, CT42CallLogEntry* pElements, int nCount) {
49 for(int tmp=0;tmp<nCount;tmp++)
50 pElements[tmp].Serialize(ar);
51}
52
53typedef Klever::CBTreendex<CTime,CT42CallLogEntry,16,512> CT42CallLog;