VTK
vtkMimeTypes.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkMimeTypes.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 /*-------------------------------------------------------------------------
16  Copyright 2008 Sandia Corporation.
17  Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
18  the U.S. Government retains certain rights in this software.
19 -------------------------------------------------------------------------*/
20 
50 #ifndef _vtkMimeTypes_h
51 #define _vtkMimeTypes_h
52 
53 #include <vtkObject.h>
54 #include <vtkStdString.h> //Needed for lookup
55 
57 
59  public vtkObject
60 {
61 public:
62  static vtkMimeTypes* New();
63  vtkTypeMacro(vtkMimeTypes, vtkObject);
64  void PrintSelf(ostream& os, vtkIndent indent);
65 
67 
68  void ClearStrategies();
69  // Description:
70  // Prepend a strategy to the list of strategies. vtkMimeTypes assumes ownership
71  // of the supplied object.
72  void PrependStrategy(vtkMimeTypeStrategy* strategy);
73  // Description:
74  // Append a strategy to the list of strategies. vtkMimeTypes assumes ownership
75  // of the supplied object.
76  void AppendStrategy(vtkMimeTypeStrategy* strategy);
78 
80 
82  vtkStdString Lookup(const vtkStdString& uri);
83  // Description:
84  // Given the contents of a resource, returns the MIME-type of the resource, or
85  // empty-string if the type cannot be identified.
86  vtkStdString Lookup(const char* begin, const char* end);
87  // Description:
88  // Given the contents of a resource, returns the MIME-type of the resource, or
89  // empty-string if the type cannot be identified.
90  vtkStdString Lookup(const vtkTypeUInt8* begin, const vtkTypeUInt8* end);
91  // Description:
92  // Given a resource URI and its contents, returns the MIME-type of the resource,
93  // or empty-string if the type cannot be identified.
94  vtkStdString Lookup(const vtkStdString& uri, const char* begin, const char* end);
95  // Description:
96  // Given a resource URI and its contents, returns the MIME-type of the resource,
97  // or empty-string if the type cannot be identified.
98  vtkStdString Lookup(const vtkStdString& uri, const vtkTypeUInt8* begin, const vtkTypeUInt8* end);
100 *" will match any type (including empty
103  type), and "text/*" will match "text/plain", "text/html", "text/xml",
104  etc. */
105  static bool Match(const vtkStdString& pattern, const vtkStdString& type);
106 
107 //BTX
108 private:
109  vtkMimeTypes();
110  ~vtkMimeTypes();
111 
112  vtkMimeTypes(const vtkMimeTypes&); //Not implemented.
113  void operator=(const vtkMimeTypes&); //Not implemented.
114 
115  class Implementation;
116  Implementation* const Internal;
117 //ETX
118 };
119 
120 #endif // !_vtkMimeTypes_h
121 
Wrapper around vtkstd::string to keep symbols short.
Definition: vtkStdString.h:45
#define VTK_TEXT_ANALYSIS_EXPORT
abstract base class for most VTK objects
Definition: vtkObject.h:60
virtual void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
Definition: vtkIndent.h:37
Determines the MIME type of a resource.
Definition: vtkMimeTypes.h:58
Abstract interface for an object that can identify the MIME type of a resource.
static vtkObject * New()