author | pohly <pohly> | 2004-08-24 20:52:45 (UTC) |
---|---|---|
committer | pohly <pohly> | 2004-08-24 20:52:45 (UTC) |
commit | 73253e93327cf4ef0932de1b4afb56af22a0f37e (patch) (side-by-side diff) | |
tree | 1c9a7a6dd3341e036a894d348a3372525d29acec /noncore/apps/opie-reader/Filedata.h | |
parent | e90847c784c48bd21bf8768cb38edb853b832697 (diff) | |
download | opie-73253e93327cf4ef0932de1b4afb56af22a0f37e.zip opie-73253e93327cf4ef0932de1b4afb56af22a0f37e.tar.gz opie-73253e93327cf4ef0932de1b4afb56af22a0f37e.tar.bz2 |
updated source to opie-reader 0.7g
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 1b85b71..096dd31 100644 --- a/noncore/apps/opie-reader/Filedata.h +++ b/noncore/apps/opie-reader/Filedata.h @@ -4,48 +4,48 @@ #include <time.h> class CFiledata { unsigned char* data; bool m_own; public: CFiledata(tchar* d) - { - data = (unsigned char*)d; - m_own = false; - } + { + data = (unsigned char*)d; + m_own = false; + } CFiledata(time_t dt, tchar* nm) - { - int nlen = ustrlen(nm)+1; - data = new unsigned char[sizeof(time_t)+sizeof(tchar)*nlen]; - *((time_t *)data) = dt; - memcpy(data+sizeof(time_t), nm, sizeof(tchar)*nlen); - m_own = true; - } + { + int nlen = ustrlen(nm)+1; + data = new unsigned char[sizeof(time_t)+sizeof(tchar)*nlen]; + *((time_t *)data) = dt; + memcpy(data+sizeof(time_t), nm, sizeof(tchar)*nlen); + m_own = true; + } ~CFiledata() - { - if (m_own && data != NULL) - { - delete [] data; -// odebug << "~Filedata: deleting" << oendl; - } - else - { -// odebug << "~Filedata: not deleting" << oendl; - } - } + { + if (m_own && data != NULL) + { + delete [] data; +// qDebug("~Filedata: deleting"); + } + else + { +// qDebug("~Filedata: not deleting"); + } + } tchar* name() const { return (tchar*)(data+sizeof(time_t)); } time_t date() { return *((time_t *)data); } void setdate(time_t _t) { *((time_t *)data) = _t; } unsigned char* content() { return data; } size_t length() const { return sizeof(time_t)+sizeof(tchar)*(ustrlen(name())+1); } bool operator==(const CFiledata& rhs) - { - return ((length() == rhs.length()) && (memcmp(data, rhs.data, length()) == 0)); - } + { + return ((length() == rhs.length()) && (memcmp(data, rhs.data, length()) == 0)); + } bool samename(const CFiledata& rhs) - { - return (ustrcmp((tchar *)(data+sizeof(time_t)),(tchar *)(rhs.data+sizeof(time_t))) == 0); - } + { + return (ustrcmp((tchar *)(data+sizeof(time_t)),(tchar *)(rhs.data+sizeof(time_t))) == 0); + } }; #endif |