ContentType Namespace Reference
Functions | |
MimeType | fromFileExtension (const char *extension, MimeType unknown) |
Obtain MIME type value from file extension. More... | |
String | fromFileExtension (const char *extension) |
Obtain content type string from file extension. More... | |
String | fromFileExtension (const String &extension) |
Obtain content type string from file extension. 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... | |
Obtain MIME type value from file name or path, with extension | |
MimeType | fromFullFileName (const char *fileName, MimeType unknown) |
MimeType | fromFullFileName (const String &fileName, MimeType unknown) |
Obtain content type string from file name or path, with extension | |
String | fromFullFileName (const char *fileName) |
String | fromFullFileName (const String &fileName) |
Function Documentation
◆ fromFileExtension() [1/3]
String ContentType::fromFileExtension | ( | const char * | extension | ) |
Obtain content type string from file extension.
- Parameters
-
extension excluding '.' separator (e.g. "htm", "json")
- Return values
-
String
◆ fromFileExtension() [2/3]
Obtain MIME type value from file extension.
- Parameters
-
extension excluding '.' separator (e.g. "htm", "json") unknown Value to return if type cannot be determined
- Return values
-
MimeType
◆ fromFileExtension() [3/3]
◆ fromFullFileName() [1/4]
String ContentType::fromFullFileName | ( | const char * | fileName | ) |
- Parameters
-
fileName as NUL-terminated string
- Return values
-
String
◆ fromFullFileName() [2/4]
- Parameters
-
fileName As NUL-terminated string unknown Value to return if type cannot be determined
- Return values
-
MimeType
◆ fromFullFileName() [3/4]
- Parameters
-
fileName as wiring String
◆ fromFullFileName() [4/4]
- Parameters
-
fileName As wiring String
◆ fromString() [1/2]
MimeType ContentType::fromString | ( | const char * | str | ) |
Get enumerated value for a MIME type string.
- Parameters
-
str
- Return values
-
MimeType If empty, null or unrecognised returns MIME_UNKNOWN