VTK
Public Types | Public Member Functions | Static Public Member Functions
vtkMimeTypes Class Reference

Determines the MIME type of a resource. More...

#include <vtkMimeTypes.h>

Inheritance diagram for vtkMimeTypes:
[legend]
Collaboration diagram for vtkMimeTypes:
[legend]

List of all members.

Public Types

typedef vtkObject Superclass
- Public Types inherited from vtkObject

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)
- Public Member Functions inherited from vtkObject
virtual void DebugOn ()
virtual void DebugOff ()
unsigned char GetDebug ()
void SetDebug (unsigned char debugFlag)
virtual void Modified ()
virtual unsigned long GetMTime ()
unsigned long AddObserver (unsigned long event, vtkCommand *, float priority=0.0f)
unsigned long AddObserver (const char *event, vtkCommand *, float priority=0.0f)
vtkCommandGetCommand (unsigned long tag)
void RemoveObserver (vtkCommand *)
void RemoveObservers (unsigned long event, vtkCommand *)
void RemoveObservers (const char *event, vtkCommand *)
int HasObserver (unsigned long event, vtkCommand *)
int HasObserver (const char *event, vtkCommand *)
void RemoveObserver (unsigned long tag)
void RemoveObservers (unsigned long event)
void RemoveObservers (const char *event)
void RemoveAllObservers ()
int HasObserver (unsigned long event)
int HasObserver (const char *event)
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f)
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
int InvokeEvent (unsigned long event, void *callData)
int InvokeEvent (const char *event, void *callData)
int InvokeEvent (unsigned long event)
int InvokeEvent (const char *event)
- Public Member Functions inherited from vtkObjectBase
const char * GetClassName () const
virtual void Delete ()
virtual void FastDelete ()
void Print (ostream &os)
virtual void Register (vtkObjectBase *o)
virtual void UnRegister (vtkObjectBase *o)
void SetReferenceCount (int)
void PrintRevisions (ostream &os)
virtual void PrintHeader (ostream &os, vtkIndent indent)
virtual void PrintTrailer (ostream &os, vtkIndent indent)
int GetReferenceCount ()

Static Public Member Functions

static vtkMimeTypesNew ()
static int IsTypeOf (const char *type)
static vtkMimeTypesSafeDownCast (vtkObject *o)
*will match any and static
text bool 
Match (const vtkStdString &pattern, const vtkStdString &type)
- Static Public Member Functions inherited from vtkObject
static void BreakOnError ()
static void SetGlobalWarningDisplay (int val)
static void GlobalWarningDisplayOn ()
static void GlobalWarningDisplayOff ()
static int GetGlobalWarningDisplay ()

Additional Inherited Members

- Protected Member Functions inherited from vtkObject
 vtkObject ()
virtual ~vtkObject ()
virtual void RegisterInternal (vtkObjectBase *, int check)
virtual void UnRegisterInternal (vtkObjectBase *, int check)
void InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL)
void InternalReleaseFocus ()
- Protected Member Functions inherited from vtkObjectBase
 vtkObjectBase ()
virtual ~vtkObjectBase ()
virtual void CollectRevisions (ostream &os)
virtual void ReportReferences (vtkGarbageCollector *)
 vtkObjectBase (const vtkObjectBase &)
void operator= (const vtkObjectBase &)
- Protected Attributes inherited from vtkObject
unsigned char Debug
vtkTimeStamp MTime
vtkSubjectHelper * SubjectHelper
- Protected Attributes inherited from vtkObjectBase
int ReferenceCount
vtkWeakPointerBase ** WeakPointers

Detailed Description

Determines the MIME type of a resource.

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.

See also:
vtkMimeTypeStrategy, vtkFileExtensionMimeTypeStrategy.
Thanks:
Developed by Timothy M. Shead (tshea.nosp@m.d@sa.nosp@m.ndia..nosp@m.gov) at Sandia National Laboratories.
Tests:
vtkMimeTypes (Tests)

Definition at line 58 of file vtkMimeTypes.h.


Member Typedef Documentation

Reimplemented from vtkObject.

Definition at line 63 of file vtkMimeTypes.h.


Member Function Documentation

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

Methods invoked by print to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from vtkObject.

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

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