VTK  9.2.6
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 =========================================================================*/
35 #ifndef vtkResourceFileLocator_h
36 #define vtkResourceFileLocator_h
37 
38 #include "vtkCommonMiscModule.h" // For export macro
39 #include "vtkObject.h"
40 
41 #include <string> // needed for std::string
42 #include <vector> // needed for std::vector
43 
44 class VTKCOMMONMISC_EXPORT vtkResourceFileLocator : public vtkObject
45 {
46 public:
47  static vtkResourceFileLocator* New();
49  void PrintSelf(ostream& os, vtkIndent indent) override;
50 
52 
56  vtkSetMacro(LogVerbosity, int);
57  vtkGetMacro(LogVerbosity, int);
59 
61 
66  virtual std::string Locate(const std::string& anchor, const std::string& landmark,
67  const std::string& defaultDir = std::string());
69 
71 
79  virtual std::string Locate(const std::string& anchor,
80  const std::vector<std::string>& landmark_prefixes, const std::string& landmark,
81  const std::string& defaultDir = std::string());
83 
85 
93  static VTK_FILEPATH std::string GetLibraryPathForSymbolUnix(const char* symbolname);
94  static VTK_FILEPATH std::string GetLibraryPathForSymbolWin32(const void* fptr);
96 
97 protected:
99  ~vtkResourceFileLocator() override;
100 
101 private:
103  void operator=(const vtkResourceFileLocator&) = delete;
104 
105  int LogVerbosity;
106 };
107 
108 #if defined(_WIN32) && !defined(__CYGWIN__)
109 #define vtkGetLibraryPathForSymbol(function) \
110  vtkResourceFileLocator::GetLibraryPathForSymbolWin32(reinterpret_cast<const void*>(&function))
111 #else
112 #define vtkGetLibraryPathForSymbol(function) \
113  vtkResourceFileLocator::GetLibraryPathForSymbolUnix(#function)
114 #endif
115 
116 #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:39
utility to locate resource files.
#define VTK_FILEPATH
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...