-rw-r--r-- | noncore/net/mail/mailtypes.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/noncore/net/mail/mailtypes.h b/noncore/net/mail/mailtypes.h index 7d7bebc..abfbe65 100644 --- a/noncore/net/mail/mailtypes.h +++ b/noncore/net/mail/mailtypes.h | |||
@@ -137,2 +137,49 @@ public: | |||
137 | 137 | ||
138 | class encodedString | ||
139 | { | ||
140 | public: | ||
141 | encodedString(); | ||
142 | /* | ||
143 | creates an new content string. | ||
144 | it makes a deep copy of it! | ||
145 | */ | ||
146 | encodedString(const char*nContent,unsigned int length); | ||
147 | /* | ||
148 | Take over the nContent. Means: it will just copy the pointer, not the content. | ||
149 | so make sure: No one else frees the string, the string has allocated with | ||
150 | malloc for compatibility with c-based libs | ||
151 | */ | ||
152 | encodedString(char*nContent,unsigned int nSize); | ||
153 | /* copy construkor - makes ALWAYS a deep copy!!!! */ | ||
154 | encodedString(const encodedString&old); | ||
155 | /* assign operator - makes ALWAYS a deep copy!!!! */ | ||
156 | encodedString& operator=(const encodedString&old); | ||
157 | /* destructor - cleans the content */ | ||
158 | virtual ~encodedString(); | ||
159 | |||
160 | /* returns a pointer to the content - do not delete yoursel! */ | ||
161 | const char*Content()const; | ||
162 | /* returns the lengths of the content 'cause it must not be a null-terminated string! */ | ||
163 | const int Length()const; | ||
164 | |||
165 | /* | ||
166 | makes a deep copy of nContent! | ||
167 | */ | ||
168 | void setContent(const char*nContent,int nSize); | ||
169 | /* | ||
170 | Take over the nContent. Means: it will just copy the pointer, not the content. | ||
171 | so make sure: No one else frees the string, the string has allocated with | ||
172 | malloc for compatibility with c-based libs | ||
173 | */ | ||
174 | void setContent(char*nContent,int nSize); | ||
175 | |||
176 | protected: | ||
177 | char * content; | ||
178 | unsigned int size; | ||
179 | |||
180 | void init(); | ||
181 | void copy_old(const encodedString&old); | ||
182 | void clean(); | ||
183 | }; | ||
184 | |||
138 | #endif | 185 | #endif |