Update of /cvsroot/mahogany/M/include
In directory sc8-pr-cvs1:/tmp/cvs-serv18875/include
Modified Files:
MessageCC.h MimePart.h MimePartCC.h
Log Message:
MimePart::GetContent() doesn't copy data once again (inefficient!) any more; separate
GetTextContent() which does it was added; yet another bug in handling base64 data fixed
Index: MessageCC.h
===================================================================
RCS file: /cvsroot/mahogany/M/include/MessageCC.h,v
retrieving revision 1.55
retrieving revision 1.56
diff -b -u -2 -r1.55 -r1.56
--- MessageCC.h 16 Feb 2003 01:19:09 -0000 1.55
+++ MessageCC.h 12 Jul 2003 18:57:43 -0000 1.56
@@ -243,10 +243,4 @@
Profile *m_Profile;
- /** A temporarily allocated buffer for GetPartContent().
- It holds the information returned by that function and is only
- valid until its next call.
- */
- void *m_partContentPtr;
-
/// pointer to the main message MIME part, it links to all others
MimePartCC *m_mimePartTop;
@@ -254,4 +248,17 @@
/// total number of MIME parts in the message
size_t m_numParts;
+
+ /**
+ A temporarily allocated buffer for GetPartContent().
+
+ It holds the information returned by that function and is only
+ valid until its next call.
+
+ We should free it only if m_ownsPartContent flag is true!
+ */
+ void *m_partContentPtr;
+
+ /// Flag telling whether we should free m_partContentPtr or not
+ bool m_ownsPartContent;
};
Index: MimePart.h
===================================================================
RCS file: /cvsroot/mahogany/M/include/MimePart.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -b -u -2 -r1.9 -r1.10
--- MimePart.h 16 Feb 2003 01:21:03 -0000 1.9
+++ MimePart.h 12 Jul 2003 18:57:43 -0000 1.10
@@ -179,6 +179,19 @@
virtual const void *GetRawContent(unsigned long *len = NULL) const = 0;
- /// get the decoded contents of this part
- virtual const void *GetContent(unsigned long *len = NULL) const = 0;
+ /**
+ get the decoded contents of this part
+
+ WARNING: the pointer is not NULL terminated, len must be used!
+ */
+ virtual const void *GetContent(unsigned long *len) const = 0;
+
+ /**
+ get contents of this part as text.
+
+ This function is more expensive than GetContent() as it copies the data
+ one extra time just to append the terminating NUL to it, so it should be
+ avoided if you don't need NUL-terminated data.
+ */
+ virtual String GetTextContent() const = 0;
/// get all headers as one string
Index: MimePartCC.h
===================================================================
RCS file: /cvsroot/mahogany/M/include/MimePartCC.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -b -u -2 -r1.4 -r1.5
--- MimePartCC.h 16 Feb 2003 01:21:03 -0000 1.4
+++ MimePartCC.h 12 Jul 2003 18:57:43 -0000 1.5
@@ -49,4 +49,5 @@
virtual const void *GetRawContent(unsigned long *len = NULL) const;
virtual const void *GetContent(unsigned long *len = NULL) const;
+ virtual String GetTextContent() const;
virtual String GetHeaders() const;
virtual MimeXferEncoding GetTransferEncoding() const;
-------------------------------------------------------
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps1
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates