Main Page | Namespace List | Class List | File List | Namespace Members | Class Members | Related Pages

Media_Type Class Reference

A media type. More...

#include <libarc.h>

List of all members.

Public Member Functions

 Media_Type (const char *mt=0)
 Constructor.

 Media_Type (const Media_Type &mt)
 Copy Constructor.

const Media_Typeoperator= (const char *mt)
const Media_Typeoperator= (const std::string &mt)
 Assignment operator.

const char * Type () const
 Return the Type component of the media type.

const char * Subtype () const
 Return the Sub-type component of the media type.

bool compare (const Media_Type &mt) const
 Compare a media type to this one.


Detailed Description

A media type.

As described in Section 3.7 of the HTTP 1.1 specification.


Constructor & Destructor Documentation

Media_Type const char *  mt = 0  ) 
 

Constructor.

Construct a new Media_Type from the supplied text.

Parameters:
mt Optional null-terminated byte-string containing the media type.

Media_Type const Media_Type mt  ) 
 

Copy Constructor.

Construct a new Media_Type from the supplied type.

Parameters:
mt The media type to copy.


Member Function Documentation

bool compare const Media_Type mt  )  const
 

Compare a media type to this one.

The argument media type is compared to this one using wild-cards: text/html and text/* each match text/html.

Parameters:
mt The media type to compare.
Returns:
True if the media type is equal to this one.

const Media_Type& operator= const std::string &  mt  )  [inline]
 

Assignment operator.

Assign a std::string containing a media type to the media type.

Parameters:
mt The string.
Returns:
Ourself.

const Media_Type& operator= const char *  mt  )  [inline]
 

Assign a null-terminated byte-string containing a media type to the media type.

Parameters:
mt Null-terminated byte-string containing the media type.
Returns:
Ourself.

const char* Subtype  )  const [inline]
 

Return the Sub-type component of the media type.

Returns:
Null-terminated byte-string of the Sub-type.

const char* Type  )  const [inline]
 

Return the Type component of the media type.

Returns:
Null-terminated byte-string of the Type.


Generated on Tue Jun 8 21:30:14 2004 by doxygen SourceForge.net Logo