MIMETypeRegistryPlayStation.cpp [plain text]
#include "config.h"
#include "MIMETypeRegistry.h"
namespace WebCore {
struct TypeExtensionPair {
ASCIILiteral type;
ASCIILiteral extension;
};
const TypeExtensionPair commonMediaTypes[] = {
{ "bmp"_s, "image/bmp"_s },
{ "css"_s, "text/css"_s },
{ "gif"_s, "image/gif"_s },
{ "html"_s, "text/html"_s },
{ "htm"_s, "text/html"_s },
{ "ico"_s, "image/x-icon"_s },
{ "jpeg"_s, "image/jpeg"_s },
{ "jpg"_s, "image/jpeg"_s },
{ "js"_s, "application/x-javascript"_s },
{ "pdf"_s, "application/pdf"_s },
{ "png"_s, "image/png"_s },
{ "rss"_s, "application/rss+xml"_s },
{ "svg"_s, "image/svg+xml"_s },
{ "swf"_s, "application/x-shockwave-flash"_s },
{ "text"_s, "text/plain"_s },
{ "txt"_s, "text/plain"_s },
{ "xbm"_s, "image/x-xbitmap"_s },
{ "xml"_s, "text/xml"_s },
{ "xsl"_s, "text/xsl"_s },
{ "xhtml"_s, "application/xhtml+xml"_s },
{ "wml"_s, "text/vnd.wap.wml"_s },
{ "wmlc"_s, "application/vnd.wap.wmlc"_s },
};
String MIMETypeRegistry::getMIMETypeForExtension(const String& extension)
{
for (auto& entry : commonMediaTypes) {
if (equalIgnoringASCIICase(extension, entry.extension.characters()))
return entry.type;
}
return emptyString();
}
bool MIMETypeRegistry::isApplicationPluginMIMEType(const String&)
{
return false;
}
String MIMETypeRegistry::getPreferredExtensionForMIMEType(const String& mimeType)
{
for (auto& entry : commonMediaTypes) {
if (equalIgnoringASCIICase(mimeType, entry.type.characters()))
return entry.extension;
}
return emptyString();
}
}