SourcePro® 2023.1 |
SourcePro® API Reference Guide |
Provides utility functions commonly needed by MIME applications. More...
#include <rw/mime/RWMimeUtils.h>
Static Public Member Functions | |
static RWCString | decode (const RWCString &str, const RWCString &encoding) |
static RWCString | encode (const RWCString &str, const RWCString &encoding) |
static RWCString | getUniqueBoundary (void) |
static RWCString | headerDecode (const RWCString &str, RWCString &charset) |
static RWCString | headerEncode (const RWCString &str, const RWCString &charset, const RWCString &encoding) |
static RWCString | replaceLineDelimiter (const RWCString &str, const RWCString &delim="\r\n") |
Static Public Attributes | |
static const RWCString | Base64 |
static const RWCString | Binary |
static const RWCString | EightBit |
static const RWCString | QuotedPrintable |
static const RWCString | SevenBit |
RWMimeUtils provides utility functions commonly needed by MIME applications. There is no need to instantiate this class, since it contains only static functions and static constants.
Decodes the string str according to the encoding method encoding. Throws RWMimeError if encoding is not recognized. See the Internet Protocols Module User's Guide for a discussion of encodings. The RWCString should contain 7-bit US-ASCII data.
Encodes the string str according to the encoding method encoding. Throws RWMimeError if encoding is not recognized. See the Internet Protocols Module User's Guide for a discussion of encodings. The RWCString should contain 7-bit US-ASCII data.
|
static |
Generates a unique string for use as the value of a boundary parameter. The generated string is of the form
where <milliseconds>
is the number of milliseconds since 00:00:00:000 January 1, 1901 UTC. The RWCString should contain 7-bit US-ASCII data.
Decodes the header value string str. If str is not a string encoded for use in an header, this function returns the original string, and the charset variable is set to US-ASCII. If the string is encoded, the unencoded string is returned, with the charset variable set to the charset of the returned string.
|
static |
Encodes the string str according to the encoding method encoding for use as a value in a MIME header. Throws RWMimeError if encoding is not recognized. Currently, the recognized encodings are "B"
and "Q"
as specified in RFC 2047.
|
static |
Translates the format of the text in str by replacing all occurrences of '\r'
, '\n'
and "\r\n"
in str with delim. By default, the function translates str to canonical form for text. Providing a different value for delim converts str to a platform-specific text format. An application sending a message typically converts a text part body to canonical form before encoding the text or inserting the text into a message. An application receiving a message typically converts a text part body to a platform-specific format after retrieving the body from the message and decoding the body. See RFC 2049, section 4 or the Internet Protocols Module User's Guide for a discussion of canonical form.
|
static |
|
static |
|
static |
|
static |
Copyright © 2023 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved. |