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...
 
static int isGeographic (const char *mimeType)
 

Variables

const char *const MIME [NUM_MIME_TYPES][2]
 

Macro Definition Documentation

◆ NUM_MIME_TYPES

#define NUM_MIME_TYPES   767

Typedef Documentation

◆ mimetype

typedef enum MimeTypes mimetype

Enumeration Type Documentation

◆ MimeTypes

enum MimeTypes
Enumerator
M_Type 
M_Extension 

Function Documentation

◆ getFileExtension()

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

◆ getFileExtensionMap()

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"

◆ isGeographic()

static int isGeographic ( const char *  mimeType)
static

Variable Documentation

◆ MIME

const char* const MIME[NUM_MIME_TYPES][2]