VTK  9.0.1
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 
57  VTK_LEGACY(void SetPrintDebugInformation(bool));
58  VTK_LEGACY(bool GetPrintDebugInformation());
59  VTK_LEGACY(void PrintDebugInformationOn());
60  VTK_LEGACY(void PrintDebugInformationOff());
62 
64 
68  vtkSetMacro(LogVerbosity, int);
69  vtkGetMacro(LogVerbosity, int);
71 
73 
78  virtual std::string Locate(const std::string& anchor, const std::string& landmark,
79  const std::string& defaultDir = std::string());
81 
83 
91  virtual std::string Locate(const std::string& anchor,
92  const std::vector<std::string>& landmark_prefixes, const std::string& landmark,
93  const std::string& defaultDir = std::string());
95 
97 
105  static std::string GetLibraryPathForSymbolUnix(const char* symbolname);
106  static std::string GetLibraryPathForSymbolWin32(const void* fptr);
108 
109 protected:
111  ~vtkResourceFileLocator() override;
112 
113 private:
115  void operator=(const vtkResourceFileLocator&) = delete;
116 
117  int LogVerbosity;
118 };
119 
120 #if defined(_WIN32) && !defined(__CYGWIN__)
121 #define vtkGetLibraryPathForSymbol(function) \
122  vtkResourceFileLocator::GetLibraryPathForSymbolWin32(reinterpret_cast<const void*>(&function))
123 #else
124 #define vtkGetLibraryPathForSymbol(function) \
125  vtkResourceFileLocator::GetLibraryPathForSymbolUnix(#function)
126 #endif
127 
128 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:62
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:33
utility to locate resource files.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...