ZOO-Project
Macros | Typedefs | Enumerations | Functions | Variables
mimetypes.h File Reference
#include "service.h"

Go to the source code of this file.

Macros

#define NUM_MIME_TYPES   767
 

Typedefs

typedef enum MimeTypes mimetype
 

Enumerations

enum  MimeTypes { M_Type, M_Extension }
 

Functions

static bool getFileExtension (const char *mimeType, char *extension, size_t length)
 Obtain default file extension for a give MIME type. More...
 
static mapgetFileExtensionMap (const char *mimeType, bool *hasExt)
 Obtain default file extension for a give MIME type. More...
 

Variables

const char *const MIME [NUM_MIME_TYPES][2]
 

Macro Definition Documentation

#define NUM_MIME_TYPES   767

Typedef Documentation

typedef enum MimeTypes mimetype

Enumeration Type Documentation

enum MimeTypes
Enumerator
M_Type 
M_Extension 

Function Documentation

static bool getFileExtension ( const char *  mimeType,
char *  extension,
size_t  length 
)
static

Obtain default file extension for a give MIME type.

Parameters
mimeTypea MIME type (lowercase string), e.g. "image/png"
extensiona buffer in which to store the file extension; the default value is "txt" if no extension is found
lengththe size of the buffer extension
Returns
true if a file extension is found for the given MIME type, otherwise false
static map* getFileExtensionMap ( const char *  mimeType,
bool hasExt 
)
static

Obtain default file extension for a give MIME type.

Parameters
mimeTypea MIME type (lowercase string), e.g. "image/png"
hasExtthe value of this pointer is set to true if a default file extension is found, otherwise false
Returns
a map with name "extension" and value set to file extension, e.g. "png"; if not found the default value is "txt"

Variable Documentation

const char* const MIME[NUM_MIME_TYPES][2]