4
* 2002-April-20 Jason Rohrer
7
* 2002-September-17 Jason Rohrer
8
* Moved mime.ini into settings directory.
10
* 2002-October-7 Jason Rohrer
11
* Added a function for getting mime types from file names.
13
* 2003-September-1 Jason Rohrer
14
* Copied into minorGems from the konspire2b project.
19
#ifndef MIME_TYPER_INCLUDED
20
#define MIME_TYPER_INCLUDED
29
* A class that can resolve file extensions to mime types.
31
* @author Jason Rohrer
42
* Constructs a mime typer.
44
* @param inFileName the configuration file from, or
45
* NULL to specify the default file name, "mime.ini".
46
* File name is relative to the settings directory.
48
* Must be destroyed by caller if non-NULL and non-const.
50
MimeTyper( char *inConfigFileName = NULL );
57
* Gets a mime type string from a file extension string.
59
* @param inFileExtension a \0-terminated string containing
60
* a file extension, including the '.'
61
* Must be destroyed by caller if non-const.
63
* @return the mime type as a \0-terminated string,
64
* or NULL if there is no match.
65
* Must be destroyed by caller if non-NULL.
67
char *getMimeType( char *inFileExtension );
72
* Gets a mime type string from a file name.
74
* @param inFileName a \0-terminated string containing
75
* a file name with extension.
76
* Must be destroyed by caller if non-const.
78
* @return the mime type as a \0-terminated string,
79
* or NULL if there is no match.
80
* Must be destroyed by caller if non-NULL.
82
char *getFileNameMimeType( char *inFileName );
90
// a string containing all types read from the configuration file
91
char *mMimeTypesString;