Esempio n. 1
0
Vector<String> MIMETypeRegistry::getMediaMIMETypesForExtension(const String& ext)
{
    if (mediaMIMETypeMap().contains(ext))
        return *mediaMIMETypeMap().get(ext);

    return Vector<String>();
}
Esempio n. 2
0
String MIMETypeRegistry::getMediaMIMETypeForExtension(const String& ext)
{
    if (mediaMIMETypeMap().contains(ext))
        return (*mediaMIMETypeMap().get(ext))[0];
    
    return String();
}
String MIMETypeRegistry::getMediaMIMETypeForExtension(const String& ext)
{
    // Look in the system-specific registry first.
    String type = getMIMETypeForExtension(ext);
    if (!type.isEmpty())
        return type;

    Vector<String>* typeList = mediaMIMETypeMap().get(ext);
    if (typeList)
        return (*typeList)[0];
    
    return String();
}
Vector<String> MIMETypeRegistry::getMediaMIMETypesForExtension(const String& ext)
{
    Vector<String>* typeList = mediaMIMETypeMap().get(ext);
    if (typeList)
        return *typeList;

    // Only need to look in the system-specific registry if mediaMIMETypeMap() doesn't contain
    // the extension at all, because it always contains the system-specific type if the
    // extension is in the static mapping table.
    String type = getMIMETypeForExtension(ext);
    if (!type.isEmpty()) {
        Vector<String> typeList;
        typeList.append(type);
        return typeList;
    }
    
    return Vector<String>();
}