VTK
vtkResourceFileLocator.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkResourceFileLocator.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 =========================================================================*/
32 #ifndef vtkResourceFileLocator_h
33 #define vtkResourceFileLocator_h
34 
35 #include "vtkCommonMiscModule.h" // For export macro
36 #include "vtkObject.h"
37 
38 #include <string> // needed for std::string
39 #include <vector> // needed for std::vector
40 
41 class VTKCOMMONMISC_EXPORT vtkResourceFileLocator : public vtkObject
42 {
43 public:
44  static vtkResourceFileLocator* New();
46  void PrintSelf(ostream& os, vtkIndent indent) override;
47 
49 
53  vtkSetMacro(PrintDebugInformation, bool);
54  vtkGetMacro(PrintDebugInformation, bool);
55  vtkBooleanMacro(PrintDebugInformation, bool);
57 
59 
64  virtual std::string Locate(const std::string& anchor, const std::string& landmark,
65  const std::string& defaultDir = std::string());
67 
69 
77  virtual std::string Locate(const std::string& anchor,
78  const std::vector<std::string>& landmark_prefixes, const std::string& landmark,
79  const std::string& defaultDir = std::string());
81 
83 
91  static std::string GetLibraryPathForSymbolUnix(const char* symbolname);
92  static std::string GetLibraryPathForSymbolWin32(const void* fptr);
94 
95 protected:
97  ~vtkResourceFileLocator() override;
98 
100 
101 private:
103  void operator=(const vtkResourceFileLocator&) = delete;
104 };
105 
106 #if defined(_WIN32) && !defined(__CYGWIN__)
107 #define vtkGetLibraryPathForSymbol(function) \
108  vtkResourceFileLocator::GetLibraryPathForSymbolWin32(reinterpret_cast<const void*>(&function))
109 #else
110 #define vtkGetLibraryPathForSymbol(function) \
111  vtkResourceFileLocator::GetLibraryPathForSymbolUnix(#function)
112 #endif
113 
114 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:59
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
a simple class to control print indentation
Definition: vtkIndent.h:39
utility to locate resource files.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...