VTK  9.7.20260726
vtkResourceFileLocator.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
22
23#ifndef vtkResourceFileLocator_h
24#define vtkResourceFileLocator_h
25
26#include "vtkCommonMiscModule.h" // For export macro
27#include "vtkObject.h"
28
29#include <string> // needed for std::string
30#include <vector> // needed for std::vector
31
32VTK_ABI_NAMESPACE_BEGIN
33class VTKCOMMONMISC_EXPORT vtkResourceFileLocator : public vtkObject
34{
35public:
38 void PrintSelf(ostream& os, vtkIndent indent) override;
39
41
45 vtkSetMacro(LogVerbosity, int);
46 vtkGetMacro(LogVerbosity, int);
48
54 virtual std::string Locate(const std::string& anchor, const std::string& landmark,
55 const std::string& defaultDir = std::string());
56
65 virtual std::string Locate(const std::string& anchor,
66 const std::vector<std::string>& landmark_prefixes, const std::string& landmark,
67 const std::string& defaultDir = std::string());
68
72 static VTK_FILEPATH std::string GetLibraryPathForAddress(const void* ptr);
73
78
79protected:
82
83private:
85 void operator=(const vtkResourceFileLocator&) = delete;
86
87 int LogVerbosity;
88};
89
90#define vtkGetLibraryPathForSymbol(function) \
91 vtkResourceFileLocator::GetLibraryPathForAddress(reinterpret_cast<const void*>(&function))
92
93VTK_ABI_NAMESPACE_END
94#endif
a simple class to control print indentation
Definition vtkIndent.h:108
virtual std::string Locate(const std::string &anchor, const std::string &landmark, const std::string &defaultDir=std::string())
Given a starting anchor directory, look for the landmark file relative to the anchor.
~vtkResourceFileLocator() override
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkResourceFileLocator * New()
static std::string GetCurrentExecutablePath()
Return the path to the current executable.
virtual std::string Locate(const std::string &anchor, const std::vector< std::string > &landmark_prefixes, const std::string &landmark, const std::string &defaultDir=std::string())
This variant is used to look for landmark relative to the anchor using additional prefixes for the la...
static std::string GetLibraryPathForAddress(const void *ptr)
Return the path to the library containing the given pointer.
#define VTK_FILEPATH