ERMimeType Class Reference

Inherited by ERGlobMimeType.

Collaboration diagram for ERMimeType:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 ERMimeType (String name, String mimeType, String uti, NSArray< String > extensions)
NSArray< Stringextensions ()
ERGlobMimeType globMimeType ()
boolean isAudio ()
boolean isImage ()
boolean isRepresentedByExtension (String extension)
boolean isVideo ()
boolean matches (ERMimeType otherMimeType)
boolean matchesExactly (ERMimeType mimeType)
String mimeType ()
String name ()
String primaryExtension ()
String subtype ()
String toString ()
String type ()
String uti ()

Private Attributes

NSArray< String_extensions
String _mimeType
String _name
String _uti


Detailed Description

ERMimeType stores the metadata about a particular mime type.

Author:
mschrag

Constructor & Destructor Documentation

ERMimeType ( String  name,
String  mimeType,
String  uti,
NSArray< String extensions 
)

Constructs an ERMimeType.

Parameters:
name the display name of the mime type ("Portable Network Graphics")
mimeType the mime type string ("image/jpg")
uti the universal type identifier that corresponds to this mime type ("public.jpeg")
extensions the array of file extensions for this mime type ("jpg", "jpeg", etc)


Member Function Documentation

NSArray<String> extensions (  ) 

Returns the list of extensions that map to this mime type.

Returns:
the list of extensions that map to this mime type

Reimplemented in ERGlobMimeType.

ERGlobMimeType globMimeType (  ) 

Returns the glob type of this mime type (image/pdf=>image/*).

Returns:
the glob type of this mime type

boolean isAudio (  ) 

Returns true for audio/<whatever> mime types.

Returns:
true for audio/<whatever> mime types

boolean isImage (  ) 

Returns true for image/<whatever> mime types.

Returns:
true for image/<whatever> mime types

boolean isRepresentedByExtension ( String  extension  ) 

Returns true if this mime type represents a file of the given extension.

Parameters:
extension the extension to lookup
Returns:
true if the extension matches one of the extensions in this mime type

boolean isVideo (  ) 

Returns true for video/<whatever> mime types.

Returns:
true for video/<whatever> mime types

boolean matches ( ERMimeType  otherMimeType  ) 

Supports glob mime types for comparison, so image/* matches image/jpeg.

Parameters:
otherMimeType the other mime type to compare against
Returns:
true if the mime types are compatible

boolean matchesExactly ( ERMimeType  mimeType  ) 

Returns true if this mime type exactly matches the other, meaning, the underlying mime type strings are identical.

Parameters:
mimeType the other mime type to compare
Returns:
true if the mime type strings are identical

String mimeType (  ) 

Returns the mime type string representation.

Returns:
the mime type string representation

String name (  ) 

Returns the name of this mime type.

Returns:
the name of this mime type

String primaryExtension (  ) 

Returns the "primary" extension for this mime type. The primary extension is the first extension in the list, and generally should be considered the most common extension to use for the type.

Returns:
the primary extension (or "" if there are no extensions)

String subtype (  ) 

Returns the part of the mime type after the "/".

Returns:
the subtype of the mime type

String toString (  ) 

String type (  ) 

Returns the part of the mime type before the "/".

Returns:
the type of the mime type

String uti (  ) 

Returns the universal type identifier.

Returns:
the universal type identifier

Reimplemented in ERGlobMimeType.


Member Data Documentation

NSArray<String> _extensions [private]

String _mimeType [private]

String _name [private]

String _uti [private]


The documentation for this class was generated from the following file:

Generated on Sat May 26 06:42:42 2012 for Project Wonder by  doxygen 1.5.8