Diffstat (limited to 'noncore/net/mail/libmailwrapper/mailtypes.h') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/mail/libmailwrapper/mailtypes.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/noncore/net/mail/libmailwrapper/mailtypes.h b/noncore/net/mail/libmailwrapper/mailtypes.h index 7d7bebc..abfbe65 100644 --- a/noncore/net/mail/libmailwrapper/mailtypes.h +++ b/noncore/net/mail/libmailwrapper/mailtypes.h @@ -126,13 +126,60 @@ public: virtual ~RecBody(); void setBodytext(const QString&); const QString& Bodytext()const; void setDescription(const RecPart&des); const RecPart& Description()const; void setParts(const QValueList<RecPart>&parts); const QValueList<RecPart>& Parts()const; void addPart(const RecPart&part); }; +class encodedString +{ +public: + encodedString(); + /* + creates an new content string. + it makes a deep copy of it! + */ + encodedString(const char*nContent,unsigned int length); + /* + Take over the nContent. Means: it will just copy the pointer, not the content. + so make sure: No one else frees the string, the string has allocated with + malloc for compatibility with c-based libs + */ + encodedString(char*nContent,unsigned int nSize); + /* copy construkor - makes ALWAYS a deep copy!!!! */ + encodedString(const encodedString&old); + /* assign operator - makes ALWAYS a deep copy!!!! */ + encodedString& operator=(const encodedString&old); + /* destructor - cleans the content */ + virtual ~encodedString(); + + /* returns a pointer to the content - do not delete yoursel! */ + const char*Content()const; + /* returns the lengths of the content 'cause it must not be a null-terminated string! */ + const int Length()const; + + /* + makes a deep copy of nContent! + */ + void setContent(const char*nContent,int nSize); + /* + Take over the nContent. Means: it will just copy the pointer, not the content. + so make sure: No one else frees the string, the string has allocated with + malloc for compatibility with c-based libs + */ + void setContent(char*nContent,int nSize); + +protected: + char * content; + unsigned int size; + + void init(); + void copy_old(const encodedString&old); + void clean(); +}; + #endif |