author | alwin <alwin> | 2003-12-16 13:14:05 (UTC) |
---|---|---|
committer | alwin <alwin> | 2003-12-16 13:14:05 (UTC) |
commit | 49c02bbbb7a0aeee933d58ba1d3d3e86e6bc7838 (patch) (unidiff) | |
tree | 710393582789ed1db97592fed5bb88ad4d56550d /noncore/net/mail/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/mailtypes.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/mail/mailtypes.cpp | 90 |
1 files changed, 89 insertions, 1 deletions
diff --git a/noncore/net/mail/mailtypes.cpp b/noncore/net/mail/mailtypes.cpp index 8d9b247..d8a36e7 100644 --- a/noncore/net/mail/mailtypes.cpp +++ b/noncore/net/mail/mailtypes.cpp | |||
@@ -1,5 +1,5 @@ | |||
1 | #include "mailtypes.h" | 1 | #include "mailtypes.h" |
2 | 2 | #include <stdlib.h> | |
3 | 3 | ||
4 | RecMail::RecMail() | 4 | RecMail::RecMail() |
5 | :subject(""),date(""),from(""),mbox(""),msg_id(""),msg_number(0),msg_size(0),msg_flags(7) | 5 | :subject(""),date(""),from(""),mbox(""),msg_id(""),msg_number(0),msg_size(0),msg_flags(7) |
@@ -245,3 +245,91 @@ const RecPart& RecBody::Description()const | |||
245 | { | 245 | { |
246 | return m_description; | 246 | return m_description; |
247 | } | 247 | } |
248 | |||
249 | /* handling encoded content */ | ||
250 | encodedString::encodedString() | ||
251 | { | ||
252 | init(); | ||
253 | } | ||
254 | |||
255 | encodedString::encodedString(const char*nContent,unsigned int nSize) | ||
256 | { | ||
257 | init(); | ||
258 | setContent(nContent,nSize); | ||
259 | } | ||
260 | |||
261 | encodedString::encodedString(char*nContent,unsigned int nSize) | ||
262 | { | ||
263 | init(); | ||
264 | setContent(nContent,nSize); | ||
265 | } | ||
266 | |||
267 | encodedString::encodedString(const encodedString&old) | ||
268 | { | ||
269 | init(); | ||
270 | copy_old(old); | ||
271 | qDebug("encodedeString: copy constructor!"); | ||
272 | } | ||
273 | |||
274 | encodedString& encodedString::operator=(const encodedString&old) | ||
275 | { | ||
276 | init(); | ||
277 | copy_old(old); | ||
278 | qDebug("encodedString: assign operator!"); | ||
279 | return *this; | ||
280 | } | ||
281 | |||
282 | encodedString::~encodedString() | ||
283 | { | ||
284 | clean(); | ||
285 | } | ||
286 | |||
287 | void encodedString::init() | ||
288 | { | ||
289 | content = 0; | ||
290 | size = 0; | ||
291 | } | ||
292 | |||
293 | void encodedString::clean() | ||
294 | { | ||
295 | if (content) { | ||
296 | free(content); | ||
297 | } | ||
298 | content = 0; | ||
299 | size = 0; | ||
300 | } | ||
301 | |||
302 | void encodedString::copy_old(const encodedString&old) | ||
303 | { | ||
304 | clean(); | ||
305 | if (old.size>0 && old.content) { | ||
306 | content = (char*)malloc(old.size*sizeof(char)); | ||
307 | memcpy(content,old.content,size); | ||
308 | size = old.size; | ||
309 | } | ||
310 | } | ||
311 | |||
312 | const char*encodedString::Content()const | ||
313 | { | ||
314 | return content; | ||
315 | } | ||
316 | |||
317 | const int encodedString::Length()const | ||
318 | { | ||
319 | return size; | ||
320 | } | ||
321 | |||
322 | void encodedString::setContent(const char*nContent,int nSize) | ||
323 | { | ||
324 | if (nSize>0 && nContent) { | ||
325 | content = (char*)malloc(nSize*sizeof(char)); | ||
326 | memcpy(content,nContent,nSize); | ||
327 | size = nSize; | ||
328 | } | ||
329 | } | ||
330 | |||
331 | void encodedString::setContent(char*nContent,int nSize) | ||
332 | { | ||
333 | content = nContent; | ||
334 | size = nSize; | ||
335 | } | ||