Every Bodypart has a number(), and contains text(), data(), or a message(), based on its contentType(). It knows how many numBytes(), numEncodedBytes() and numEncodedLines() of data it contains, and can present itself asText().
This class is also responsible for parsing bodyparts in messages.
Constructs a Bodypart with number n and parent p.
Constructs an empty Bodypart. This is meant to be used only by parseBodypart().
Returns the text representation of this Bodypart.
We probably should transition away from this function.
Returns the content transfer encoding of this Bodypart, which may be any of EString::Binary, EString::QuotedPrintable and EString::Base64.
Returns the ContentType of this Bodypart, which may be a null pointer in case the Content-Type is the default one. The default is either text/plain or message/rfc822.
The Bodypart cannot find the default alone, since it depends on the surrounding type.
Returns this Bodypart's content, provided it has an 8-bit type. If this Bodypart is a text part, data() returns an empty string.
Returns an error message describing why this bodypart is bad, or an empty string if nothing seems to be the matter.
Returns the id of this bodypart in the bodyparts table, or 0 if it has not been stored there yet.
Returns a pointer to the subsidiary message, provided this is a message/rfc822 bodypart, or a null pointer in other cases.
Returns the number of bytes in this body part, as set using setNumBytes().
Returns the number of lines in this body part, as set using setNumEncodedLines().
Returns a number that reflects this Bodypart's position within its containing Multipart.
Parses the part of rfc2822 from start to end (not including end) as a single bodypart with MIME/RFC 822 header h.
This removes the "charset" argument from the Content-Type field in h.
Parses the part of rfc2822 from index i to (but not including) end, dividing the part into bodyparts wherever the boundary divider occurs and adding each bodypart to children, and setting the correct parent. divider does not contain the leading or trailing hyphens. digest is true for multipart/digest and false for other types.
Sets the data of this Bodypart to s. For use only by MessageBodyFetcher for now.
Sets the id of this bodypart to id. Meant for use only by the Injector.
Notifies this Bodypart that it has a subsidiary message m. This function is only meaningful if the Bodypart has content-type message/rfc822.
Notifies this Bodypart that it contains n bytes of data(). The initial value is 0.
Compare to numBytes(), which returns the raw number of bytes.
Sets the text of this Bodypart to s. For use only by MessageBodyFetcher for now.
Returns the text of this Bodypart. MUST NOT be called for non-text parts (whose contents are not known to be well-formed text).
This web page based on source code belonging to The Archiveopteryx Developers. All rights reserved.