SourcePro C++ 12.0 |
SourcePro® C++ API Reference Guide |
SourcePro C++ Documentation Home |
Represents a parameter within the content of a MIME header. More...
#include <rw/mime/RWMimeParameter.h>
Public Member Functions | |
RWMimeParameter (void) | |
RWMimeParameter (const RWCString &name, const RWCString &value) | |
RWMimeParameter (const RWMimeParameter &second) | |
RWMimeParameter & | operator= (const RWMimeParameter &second) |
~RWMimeParameter (void) | |
RWCString | getName (void) const |
void | setName (const RWCString &name) |
RWCString | getValue (void) const |
void | setValue (const RWCString &value) |
RWCString | asString (void) const |
void | fromString (const RWCString ¶meterString) |
Friends | |
bool | operator== (const RWMimeParameter &first, const RWMimeParameter &second) |
RWMimeParameter represents a parameter within the value of a MIME header. Each MIME parameter has a name and a value. An equal sign separates the name and the value. For example, the parameter charset=US-ASCII
contains the name charset
and the value US-ASCII
.
The parameter name may consist of US-ASCII characters with the exception of control characters, space, or any of the special characters shown below:
()<>@,;:\"/[]?=
The parameter value may contain any US-ASCII character with the exception of US-ASCII control characters, carriage return, and linefeed.
RWMimeParameter creates parameters in the syntax specified by RFC 2045, Section 5 (p. 9-12) and in compliance with RFC 2822.
RWMimeParameter::RWMimeParameter | ( | void | ) |
Default constructor. Constructs a parameter with an empty name and an empty value.
Constructs a parameter with the given name and value. Does not validate name or value. The RWCString should contain 7-bit US-ASCII data.
RWMimeParameter::RWMimeParameter | ( | const RWMimeParameter & | second | ) |
Copy constructor. Constructs a new parameter as a deep copy of second.
RWMimeParameter::~RWMimeParameter | ( | void | ) |
Destructor.
RWCString RWMimeParameter::asString | ( | void | ) | const |
Returns this parameter as a string. Produces a string in the format name="value"
. Escapes the parameter value as necessary to generate a correctly quoted and escaped string. Does not otherwise validate the returned string. Throws RWMimeError if self cannot be represented as valid MIME. The RWCString should contain 7-bit US-ASCII data.
void RWMimeParameter::fromString | ( | const RWCString & | parameterString | ) |
Populates self with the contents of parameterString. Throws RWMimeParseError if the function cannot parse parameterString as a valid MIME parameter. The RWCString should contain 7-bit US-ASCII data.
RWCString RWMimeParameter::getName | ( | void | ) | const |
Returns the name of this parameter. The RWCString should contain 7-bit US-ASCII data.
RWCString RWMimeParameter::getValue | ( | void | ) | const |
Returns the value of this parameter. The RWCString should contain 7-bit US-ASCII data.
RWMimeParameter& RWMimeParameter::operator= | ( | const RWMimeParameter & | second | ) |
Assignment operator. Makes self a deep copy of second.
void RWMimeParameter::setName | ( | const RWCString & | name | ) |
Sets the name of this parameter to name. Does not validate name. The RWCString should contain 7-bit US-ASCII data.
void RWMimeParameter::setValue | ( | const RWCString & | value | ) |
Sets the value of this parameter to value. The RWCString should contain 7-bit US-ASCII data.
bool operator== | ( | const RWMimeParameter & | first, | |
const RWMimeParameter & | second | |||
) | [friend] |
Equality operator. Returns true
if first and second are equal, false
otherwise. Uses a case-insensitive string comparison for parameter names, a case-sensitive string comparison for parameter values.
© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.