Return the MIME type description for any given file ending
| Return Type | Function name | Arguments |
|---|---|---|
| hzMimetype | Filename2Mimetype | (const char*,) |
Declared in file: hzMimetype.h
Defined in file : hzTypes.cpp
Function Logic:
Function body:
hzMimetype Filename2Mimetype (const char* fpath)
{
// Category: Config
//
// Return the MIME type description for any given file ending
//
// Arguments: 1) fpath Relative or full pathname of file
//
// Returns: Enum hzMimetype
_hzfunc(__func__) ;
if (!s_mimesEnum.Count())
HadronZooInitMimes() ;
const char* i ; // Path iterator
_mimeType m ; // MIME type info
hzString S ; // Lookup string
i = strchr(fpath, CHAR_PERIOD) ;
if (i)
S = i + 1;
else
S = fpath ;
m = s_mimesFile[S] ;
return m.v ;
}