ContentType Namespace Reference

Functions

String fromFileExtension (const char *extension)
 Obtain content type string from file extension. More...
 
static String fromFileExtension (const String &extension)
 Obtain content type string from file extension. More...
 
String toString (enum MimeType m)
 Get textual representation for a MIME type. More...
 
MimeType fromString (const char *str)
 Get enumerated value for a MIME type string. More...
 
MimeType fromString (const String &str)
 Get enumerated value for a MIME type string. More...
 
String fromFullFileName (const char *fileName)
 Obtain content type string from file name or path, with extension. More...
 
static String fromFullFileName (const String &fileName)
 Obtain content type string from file name or path, with extension. More...
 

Function Documentation

◆ fromFileExtension() [1/2]

String ContentType::fromFileExtension ( const char *  extension)

Obtain content type string from file extension.

Parameters
extensionexcluding '.' separator (e.g. "htm", "json")
Return values
String

◆ fromFileExtension() [2/2]

static String ContentType::fromFileExtension ( const String extension)
inlinestatic

Obtain content type string from file extension.

Parameters
extension
Return values
String

◆ fromFullFileName() [1/2]

String ContentType::fromFullFileName ( const char *  fileName)

Obtain content type string from file name or path, with extension.

Parameters
fileName
Return values
String

◆ fromFullFileName() [2/2]

static String ContentType::fromFullFileName ( const String fileName)
inlinestatic

Obtain content type string from file name or path, with extension.

Parameters
fileName
Return values
String

◆ fromString() [1/2]

MimeType ContentType::fromString ( const char *  str)

Get enumerated value for a MIME type string.

Parameters
str
Return values
MimeTypeIf empty, null or unrecognised returns MIME_UNKNOWN

◆ fromString() [2/2]

MimeType ContentType::fromString ( const String str)
inline

Get enumerated value for a MIME type string.

Parameters
str
Return values
MimeTypeIf empty, null or unrecognised returns MIME_UNKNOWN

◆ toString()

String ContentType::toString ( enum MimeType  m)

Get textual representation for a MIME type.

Parameters
mthe MIME type
Return values
String