author | alwin <alwin> | 2003-12-16 13:14:05 (UTC) |
---|---|---|
committer | alwin <alwin> | 2003-12-16 13:14:05 (UTC) |
commit | 49c02bbbb7a0aeee933d58ba1d3d3e86e6bc7838 (patch) (side-by-side diff) | |
tree | 710393582789ed1db97592fed5bb88ad4d56550d /noncore/net/mail/libmailwrapper/mailtypes.cpp | |
parent | f42c15f884d4377bc99d73e16fa1722b0fb2a4d3 (diff) | |
download | opie-49c02bbbb7a0aeee933d58ba1d3d3e86e6bc7838.zip opie-49c02bbbb7a0aeee933d58ba1d3d3e86e6bc7838.tar.gz opie-49c02bbbb7a0aeee933d58ba1d3d3e86e6bc7838.tar.bz2 |
saving of attachments implemented.
Diffstat (limited to 'noncore/net/mail/libmailwrapper/mailtypes.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/mail/libmailwrapper/mailtypes.cpp | 90 |
1 files changed, 89 insertions, 1 deletions
diff --git a/noncore/net/mail/libmailwrapper/mailtypes.cpp b/noncore/net/mail/libmailwrapper/mailtypes.cpp index 8d9b247..d8a36e7 100644 --- a/noncore/net/mail/libmailwrapper/mailtypes.cpp +++ b/noncore/net/mail/libmailwrapper/mailtypes.cpp @@ -1,8 +1,8 @@ #include "mailtypes.h" - +#include <stdlib.h> RecMail::RecMail() :subject(""),date(""),from(""),mbox(""),msg_id(""),msg_number(0),msg_size(0),msg_flags(7) { init(); } @@ -242,6 +242,94 @@ void RecBody::setDescription(const RecPart&des) } const RecPart& RecBody::Description()const { return m_description; } + +/* handling encoded content */ +encodedString::encodedString() +{ + init(); +} + +encodedString::encodedString(const char*nContent,unsigned int nSize) +{ + init(); + setContent(nContent,nSize); +} + +encodedString::encodedString(char*nContent,unsigned int nSize) +{ + init(); + setContent(nContent,nSize); +} + +encodedString::encodedString(const encodedString&old) +{ + init(); + copy_old(old); + qDebug("encodedeString: copy constructor!"); +} + +encodedString& encodedString::operator=(const encodedString&old) +{ + init(); + copy_old(old); + qDebug("encodedString: assign operator!"); + return *this; +} + +encodedString::~encodedString() +{ + clean(); +} + +void encodedString::init() +{ + content = 0; + size = 0; +} + +void encodedString::clean() +{ + if (content) { + free(content); + } + content = 0; + size = 0; +} + +void encodedString::copy_old(const encodedString&old) +{ + clean(); + if (old.size>0 && old.content) { + content = (char*)malloc(old.size*sizeof(char)); + memcpy(content,old.content,size); + size = old.size; + } +} + +const char*encodedString::Content()const +{ + return content; +} + +const int encodedString::Length()const +{ + return size; +} + +void encodedString::setContent(const char*nContent,int nSize) +{ + if (nSize>0 && nContent) { + content = (char*)malloc(nSize*sizeof(char)); + memcpy(content,nContent,nSize); + size = nSize; + } +} + +void encodedString::setContent(char*nContent,int nSize) +{ + content = nContent; + size = nSize; +} |