MeshLib C++ Docs
Loading...
Searching...
No Matches
MRSystemPath.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRMeshFwd.h"
4#include "MRExpected.h"
5
6#include <filesystem>
7
8namespace MR
9{
10
12class SystemPath
13{
14public:
15#ifndef MR_PARSING_FOR_ANY_BINDINGS
17 MRMESH_API static const Expected<std::filesystem::path> & getExecutablePath();
18
20 MRMESH_API static const Expected<std::filesystem::path> & getLibraryPath();
21
24 MRMESH_API static Expected<std::filesystem::path> getLibraryPathForSymbol( const void* symbol );
25
27 MRMESH_API static Expected<std::filesystem::path> getExecutableDirectory();
28
30 MRMESH_API static Expected<std::filesystem::path> getLibraryDirectory();
31#endif
32
34 enum class Directory
35 {
37 Resources,
39 Fonts,
41 Plugins,
43 PythonModules,
44 Count
45 };
46
47 // supported types of system fonts fonts
48 enum class SystemFontType
49 {
50 Regular,
51 Bold,
52 Italic,
53 BoldItalic,
54 Count
55 };
56
57 using SystemFontPaths = std::array<std::filesystem::path, size_t( SystemFontType::Count )>;
58
60 MRMESH_API static std::filesystem::path getDirectory( Directory dir );
62 MRMESH_API static void overrideDirectory( Directory dir, const std::filesystem::path& path );
63
65 static std::filesystem::path getResourcesDirectory() { return getDirectory( Directory::Resources ); }
67 static std::filesystem::path getFontsDirectory() { return getDirectory( Directory::Fonts ); }
69 static std::filesystem::path getPluginsDirectory() { return getDirectory( Directory::Plugins ); }
71 static std::filesystem::path getPythonModulesDirectory() { return getDirectory( Directory::PythonModules ); }
73 MRMESH_API static const std::vector<SystemFontPaths>& getSystemFonts();
74};
75
76} // namespace MR
#define MRMESH_API
Definition MRMeshFwd.h:80
Definition MRCameraOrientationPlugin.h:8