class PMIMEInfo: public PStringToString

This class contains the Multipurpose Internet Mail Extensions parameters and variables

Inheritance:


Public Methods

[more]virtual void PrintOn ( ostream &strm ) const
Output the contents of the MIME dictionary to the stream.
[more]virtual void ReadFrom ( istream &strm )
Input the contents of the MIME dictionary from the stream.
[more]BOOL SetAt ( const char * key, const PString value )
Add a new value to the MIME info.
[more]BOOL SetAt ( const PString & key, const PString value )
Add a new value to the MIME info.
[more]BOOL SetAt ( const PCaselessString & key, const PString value )
Add a new value to the MIME info.
[more]BOOL Contains ( const char * key ) const
Determine if the specified key is present in the MIME information set.
[more]BOOL Contains ( const PString & key ) const
Determine if the specified key is present in the MIME information set.
[more]BOOL Contains ( const PCaselessString & key ) const
Determine if the specified key is present in the MIME information set.
[more]BOOL Read ( PInternetProtocol & socket )
Read MIME information from the socket.
[more]BOOL Write ( PInternetProtocol & socket ) const
Write MIME information to the socket.
[more]BOOL AddMIME ( const PString & line )
Add a MIME field given a "name: value" format string.
[more]PString GetString ( const PString & key, const PString & dflt ) const
Get a string for the particular MIME info field with checking for existance.
[more]long GetInteger ( const PString & key, long dflt = 0 ) const
Get an integer value for the particular MIME info field with checking for existance.
[more]void SetInteger ( const PCaselessString & key, long value )
Set an integer value for the particular MIME info field
[more]static void SetAssociation ( const PStringToString & allTypes, BOOL merge = TRUE )
Set an association between a file type and a MIME content type.
[more]static PString GetContentType ( const PString & fileType )
Look up the file type to MIME content type association dictionary and return the MIME content type string.


Inherited from PStringToString:

Public Classes

ostruct Initialiser


Inherited from PStringDictionary:

Public

Construction

Overrides from class PObject

New functions for class


Inherited from PAbstractDictionary:

Public

Overrides from class PCollection


Inherited from PHashTable:

Protected

Overrides from class PContainer


Inherited from PCollection:

Public

Common functions for collections


Inherited from PContainer:

Public

Common functions for containers

Protected Methods

ovirtual void DestroyContents()
ovirtual void AssignContents(const PContainer & c)
ovoid CopyContents(const PContainer & c)
ovoid CloneContents(const PContainer * src)
ovoid Destruct()


Inherited from PObject:

Public

Run Time Type functions

Comparison functions

I/O functions

Miscellaneous functions


Documentation

This class contains the Multipurpose Internet Mail Extensions parameters and variables
ovirtual void PrintOn( ostream &strm ) const
Output the contents of the MIME dictionary to the stream. This is primarily used by the standard operator<< function.

ovirtual void ReadFrom( istream &strm )
Input the contents of the MIME dictionary from the stream. This is primarily used by the standard operator>> function.

oBOOL SetAt( const char * key, const PString value )
Add a new value to the MIME info. If the value is already in the dictionary then this overrides the previous value.

Returns:
TRUE if the object was successfully added.

oBOOL SetAt( const PString & key, const PString value )
Add a new value to the MIME info. If the value is already in the dictionary then this overrides the previous value.

Returns:
TRUE if the object was successfully added.

oBOOL SetAt( const PCaselessString & key, const PString value )
Add a new value to the MIME info. If the value is already in the dictionary then this overrides the previous value.

Returns:
TRUE if the object was successfully added.

oBOOL Contains( const char * key ) const
Determine if the specified key is present in the MIME information set.

Returns:
TRUE if the MIME variable is present.

oBOOL Contains( const PString & key ) const
Determine if the specified key is present in the MIME information set.

Returns:
TRUE if the MIME variable is present.

oBOOL Contains( const PCaselessString & key ) const
Determine if the specified key is present in the MIME information set.

Returns:
TRUE if the MIME variable is present.

oBOOL Read( PInternetProtocol & socket )
Read MIME information from the socket.

Returns:
TRUE if the MIME information was successfully read.

oBOOL Write( PInternetProtocol & socket ) const
Write MIME information to the socket.

Returns:
TRUE if the MIME information was successfully read.

oBOOL AddMIME( const PString & line )
Add a MIME field given a "name: value" format string. Note that if the field name was already in the MIME dictionary then this will append the new value after a '\n' character to the previous value.

Returns:
TRUE is a field was added.

oPString GetString( const PString & key, const PString & dflt ) const
Get a string for the particular MIME info field with checking for existance. The dflt parameter is substituted if the field does not exist in the MIME information read in.

Returns:
String for the value of the MIME variable.

olong GetInteger( const PString & key, long dflt = 0 ) const
Get an integer value for the particular MIME info field with checking for existance. The dflt parameter is substituted if the field does not exist in the MIME information read in.

Returns:
Integer value for the MIME variable.

ovoid SetInteger( const PCaselessString & key, long value )
Set an integer value for the particular MIME info field

ostatic void SetAssociation( const PStringToString & allTypes, BOOL merge = TRUE )
Set an association between a file type and a MIME content type. The content type is then sent for any file in the directory sub-tree that has the same extension.

Note that if the merge parameter if TRUE then the dictionary is merged into the current association list and is not a simple replacement.

The default values placed in this dictionary are:


          ".txt", "text/plain"
          ".text", "text/plain"
          ".html", "text/html"
          ".htm", "text/html"
          ".aif", "audio/aiff"
          ".aiff", "audio/aiff"
          ".au", "audio/basic"
          ".snd", "audio/basic"
          ".wav", "audio/wav"
          ".gif", "image/gif"
          ".xbm", "image/x-bitmap"
          ".tif", "image/tiff"
          ".tiff", "image/tiff"
          ".jpg", "image/jpeg"
          ".jpe", "image/jpeg"
          ".jpeg", "image/jpeg"
          ".avi", "video/avi"
          ".mpg", "video/mpeg"
          ".mpeg", "video/mpeg"
          ".qt", "video/quicktime"
          ".mov", "video/quicktime"

The default content type will be äpplication/octet-stream".

ostatic PString GetContentType( const PString & fileType )
Look up the file type to MIME content type association dictionary and return the MIME content type string. If the file type is not found in the dictionary then the string äpplication/octet-stream" is returned.

Returns:
MIME content type for file type.


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.