Module: Internet Protocols Module Package: MIME
Does not inherit
asString() fromString() getName() |
getValue() operator=() operator==() |
RWMimeParameter() setName() setValue() |
~RWMimeParameter() |
#include <rw/mime/RWMimeParameter.h>
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.
RWMimeParameter(void);
Default constructor. Constructs a parameter with an empty name and an empty value.
NOTE -- A parameter with an empty name and an empty value does not meet the specification of a MIME parameter.
RWMimeParameter(const RWCString& name, const RWCString& 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(const RWMimeParameter& second);
Constructs a new parameter as a deep copy of second.
~RWMimeParameter(void);
Destructor.
RWMimeParameter& operator=(const RWMimeParameter& second);
Makes self a deep copy of second.
bool operator==(const RWMimeParameter& first, const RWMimeParameter& second);
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.
RWCstring asString(void) const;
Returns this parameter as a string. Produces a string in the format name="value". Does not validate the returned string. Escapes the special characters " and \ within the parameter value. Throws RWMimeError if self cannot be represented as valid MIME. The RWCString should contain 7-bit US-ASCII data.
void 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 getName(void) const;
Returns the name of this parameter. The RWCString should contain 7-bit US-ASCII data.
RWCString getValue(void) const;
Returns the value of this parameter. The RWCString should contain 7-bit US-ASCII data.
void 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 setValue(const RWCString& value);
Sets the value of this parameter to value. The RWCString should contain 7-bit US-ASCII data.
© 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.