author | ar <ar> | 2004-05-27 22:04:46 (UTC) |
---|---|---|
committer | ar <ar> | 2004-05-27 22:04:46 (UTC) |
commit | 4f7c3c4d0d634706d13950b3827714b168e279e3 (patch) (unidiff) | |
tree | 2df448e7a4dcd538c26365873e194be2b55e83b7 /noncore/apps/opie-reader/Filedata.h | |
parent | 46f81a089ba8febdb79e0d150b69f74bb1ea7d18 (diff) | |
download | opie-4f7c3c4d0d634706d13950b3827714b168e279e3.zip opie-4f7c3c4d0d634706d13950b3827714b168e279e3.tar.gz opie-4f7c3c4d0d634706d13950b3827714b168e279e3.tar.bz2 |
- convert qDebug to odebug
Diffstat (limited to 'noncore/apps/opie-reader/Filedata.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/Filedata.h | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/noncore/apps/opie-reader/Filedata.h b/noncore/apps/opie-reader/Filedata.h index 096dd31..1b85b71 100644 --- a/noncore/apps/opie-reader/Filedata.h +++ b/noncore/apps/opie-reader/Filedata.h | |||
@@ -8,44 +8,44 @@ class CFiledata | |||
8 | unsigned char* data; | 8 | unsigned char* data; |
9 | bool m_own; | 9 | bool m_own; |
10 | public: | 10 | public: |
11 | CFiledata(tchar* d) | 11 | CFiledata(tchar* d) |
12 | { | 12 | { |
13 | data = (unsigned char*)d; | 13 | data = (unsigned char*)d; |
14 | m_own = false; | 14 | m_own = false; |
15 | } | 15 | } |
16 | CFiledata(time_t dt, tchar* nm) | 16 | CFiledata(time_t dt, tchar* nm) |
17 | { | 17 | { |
18 | int nlen = ustrlen(nm)+1; | 18 | int nlen = ustrlen(nm)+1; |
19 | data = new unsigned char[sizeof(time_t)+sizeof(tchar)*nlen]; | 19 | data = new unsigned char[sizeof(time_t)+sizeof(tchar)*nlen]; |
20 | *((time_t *)data) = dt; | 20 | *((time_t *)data) = dt; |
21 | memcpy(data+sizeof(time_t), nm, sizeof(tchar)*nlen); | 21 | memcpy(data+sizeof(time_t), nm, sizeof(tchar)*nlen); |
22 | m_own = true; | 22 | m_own = true; |
23 | } | 23 | } |
24 | ~CFiledata() | 24 | ~CFiledata() |
25 | { | 25 | { |
26 | if (m_own && data != NULL) | 26 | if (m_own && data != NULL) |
27 | { | 27 | { |
28 | delete [] data; | 28 | delete [] data; |
29 | // qDebug("~Filedata: deleting"); | 29 | // odebug << "~Filedata: deleting" << oendl; |
30 | } | 30 | } |
31 | else | 31 | else |
32 | { | 32 | { |
33 | // qDebug("~Filedata: not deleting"); | 33 | // odebug << "~Filedata: not deleting" << oendl; |
34 | } | 34 | } |
35 | } | 35 | } |
36 | tchar* name() const { return (tchar*)(data+sizeof(time_t)); } | 36 | tchar* name() const { return (tchar*)(data+sizeof(time_t)); } |
37 | time_t date() { return *((time_t *)data); } | 37 | time_t date() { return *((time_t *)data); } |
38 | void setdate(time_t _t) { *((time_t *)data) = _t; } | 38 | void setdate(time_t _t) { *((time_t *)data) = _t; } |
39 | unsigned char* content() { return data; } | 39 | unsigned char* content() { return data; } |
40 | size_t length() const { return sizeof(time_t)+sizeof(tchar)*(ustrlen(name())+1); } | 40 | size_t length() const { return sizeof(time_t)+sizeof(tchar)*(ustrlen(name())+1); } |
41 | bool operator==(const CFiledata& rhs) | 41 | bool operator==(const CFiledata& rhs) |
42 | { | 42 | { |
43 | return ((length() == rhs.length()) && (memcmp(data, rhs.data, length()) == 0)); | 43 | return ((length() == rhs.length()) && (memcmp(data, rhs.data, length()) == 0)); |
44 | } | 44 | } |
45 | bool samename(const CFiledata& rhs) | 45 | bool samename(const CFiledata& rhs) |
46 | { | 46 | { |
47 | return (ustrcmp((tchar *)(data+sizeof(time_t)),(tchar *)(rhs.data+sizeof(time_t))) == 0); | 47 | return (ustrcmp((tchar *)(data+sizeof(time_t)),(tchar *)(rhs.data+sizeof(time_t))) == 0); |
48 | } | 48 | } |
49 | }; | 49 | }; |
50 | 50 | ||
51 | #endif | 51 | #endif |