#include <vtkMimeTypes.h>
vtkMimeTypes is a helper class for determining the MIME type of a resource at runtime. To use it, create an instance of vtkMimeTypes, then call the Lookup() method to determine the MIME type of each resource of-interest.
vtkMimeTypes relies on a set of strategy objects to perform the actual lookups. These strategy objects may determine the MIME type based on arbitrary methods, including looking at file extensions, examining the contents of the resource, or some combination thereof.
By default, vtkMimeTypes is configured with a simple cross-platform strategy that identifies resources based on a hard-coded list of filename extensions, but you can supplement this process with your own strategies. The list of strategies is executed in-order to determine the MIME type of a resource, so earlier strategies "override" later strategies.
Definition at line 58 of file vtkMimeTypes.h.
Public Types | |
typedef vtkObject | Superclass |
Public Member Functions | |
virtual const char * | GetClassName () |
virtual int | IsA (const char *type) |
void | PrintSelf (ostream &os, vtkIndent indent) |
*will match any | type (including empty type) |
void | ClearStrategies () |
void | PrependStrategy (vtkMimeTypeStrategy *strategy) |
void | AppendStrategy (vtkMimeTypeStrategy *strategy) |
vtkStdString | Lookup (const vtkStdString &uri) |
vtkStdString | Lookup (const char *begin, const char *end) |
vtkStdString | Lookup (const vtkTypeUInt8 *begin, const vtkTypeUInt8 *end) |
vtkStdString | Lookup (const vtkStdString &uri, const char *begin, const char *end) |
vtkStdString | Lookup (const vtkStdString &uri, const vtkTypeUInt8 *begin, const vtkTypeUInt8 *end) |
Static Public Member Functions | |
static vtkMimeTypes * | New () |
static int | IsTypeOf (const char *type) |
static vtkMimeTypes * | SafeDownCast (vtkObject *o) |
*will match any and static text bool | Match (const vtkStdString &pattern, const vtkStdString &type) |
typedef vtkObject vtkMimeTypes::Superclass |
static vtkMimeTypes* vtkMimeTypes::New | ( | ) | [static] |
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
Reimplemented from vtkObject.
virtual const char* vtkMimeTypes::GetClassName | ( | ) | [virtual] |
Reimplemented from vtkObject.
static int vtkMimeTypes::IsTypeOf | ( | const char * | name | ) | [static] |
Return 1 if this class type is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.
Reimplemented from vtkObject.
virtual int vtkMimeTypes::IsA | ( | const char * | name | ) | [virtual] |
Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.
Reimplemented from vtkObject.
static vtkMimeTypes* vtkMimeTypes::SafeDownCast | ( | vtkObject * | o | ) | [static] |
Reimplemented from vtkObject.
void vtkMimeTypes::PrintSelf | ( | ostream & | os, | |
vtkIndent | indent | |||
) | [virtual] |
void vtkMimeTypes::ClearStrategies | ( | ) |
Clear the list of strategies.
void vtkMimeTypes::PrependStrategy | ( | vtkMimeTypeStrategy * | strategy | ) |
Clear the list of strategies.
void vtkMimeTypes::AppendStrategy | ( | vtkMimeTypeStrategy * | strategy | ) |
Clear the list of strategies.
vtkStdString vtkMimeTypes::Lookup | ( | const vtkStdString & | uri | ) |
Given a resource URI, returns the MIME-type of the resource, or empty-string if the type cannot be identified.
vtkStdString vtkMimeTypes::Lookup | ( | const char * | begin, | |
const char * | end | |||
) |
Given a resource URI, returns the MIME-type of the resource, or empty-string if the type cannot be identified.
vtkStdString vtkMimeTypes::Lookup | ( | const vtkTypeUInt8 * | begin, | |
const vtkTypeUInt8 * | end | |||
) |
Given a resource URI, returns the MIME-type of the resource, or empty-string if the type cannot be identified.
vtkStdString vtkMimeTypes::Lookup | ( | const vtkStdString & | uri, | |
const char * | begin, | |||
const char * | end | |||
) |
Given a resource URI, returns the MIME-type of the resource, or empty-string if the type cannot be identified.
vtkStdString vtkMimeTypes::Lookup | ( | const vtkStdString & | uri, | |
const vtkTypeUInt8 * | begin, | |||
const vtkTypeUInt8 * | end | |||
) |
Given a resource URI, returns the MIME-type of the resource, or empty-string if the type cannot be identified.
* will match any vtkMimeTypes::type | ( | including empty | type | ) |
Returns true iff a Mime pattern matches the given type. Handles wildcards so the pattern "
* will match any and static text bool vtkMimeTypes::Match | ( | const vtkStdString & | pattern, | |
const vtkStdString & | type | |||
) | [static] |