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{
12
13
16{
17public:
18#ifndef MR_PARSING_FOR_ANY_BINDINGS
21
24
27 MRMESH_API static Expected<std::filesystem::path> getLibraryPathForSymbol( const void* symbol );
28
31
34#endif
35
37 enum class Directory
38 {
42 Fonts,
44 Plugins,
47 Count
48 };
49
51 enum class SystemFontType
52 {
53 Regular,
54 Bold,
55 Italic,
57 Count
58 };
59
60 using SystemFontPaths = std::array<std::filesystem::path, size_t( SystemFontType::Count )>;
61
63 MRMESH_API static std::filesystem::path getDirectory( Directory dir );
65 MRMESH_API static void overrideDirectory( Directory dir, const std::filesystem::path& path );
66
68 static std::filesystem::path getResourcesDirectory() { return getDirectory( Directory::Resources ); }
70 static std::filesystem::path getFontsDirectory() { return getDirectory( Directory::Fonts ); }
72 static std::filesystem::path getPluginsDirectory() { return getDirectory( Directory::Plugins ); }
74 static std::filesystem::path getPythonModulesDirectory() { return getDirectory( Directory::PythonModules ); }
76 MRMESH_API static const std::vector<SystemFontPaths>& getSystemFonts();
77};
78
79}
system directory path manager
Definition MRSystemPath.h:16
static std::filesystem::path getPythonModulesDirectory()
get the Python modules' binaries' directory path
Definition MRSystemPath.h:74
SystemFontType
supported types of system fonts fonts
Definition MRSystemPath.h:52
static std::filesystem::path getPluginsDirectory()
get the plugin binaries' directory path
Definition MRSystemPath.h:72
static MRMESH_API const std::vector< SystemFontPaths > & getSystemFonts()
get name all system fonts that have italics, bold, bold italics
static MRMESH_API const Expected< std::filesystem::path > & getExecutablePath()
get the current executable's file path
static MRMESH_API Expected< std::filesystem::path > getLibraryPathForSymbol(const void *symbol)
static MRMESH_API Expected< std::filesystem::path > getLibraryDirectory()
get the MRMesh binary's directory path
static std::filesystem::path getFontsDirectory()
get the font files' directory path
Definition MRSystemPath.h:70
tl::expected< T, E > Expected
Definition MRExpected.h:31
static MRMESH_API Expected< std::filesystem::path > getExecutableDirectory()
get the current executable's directory path
static std::filesystem::path getResourcesDirectory()
get the resource files' directory path
Definition MRSystemPath.h:68
static MRMESH_API void overrideDirectory(Directory dir, const std::filesystem::path &path)
override the directory path for specified category, useful for custom configurations
std::array< std::filesystem::path, size_t(SystemFontType::Count)> SystemFontPaths
Definition MRSystemPath.h:60
static MRMESH_API const Expected< std::filesystem::path > & getLibraryPath()
get the MRMesh binary's file path
static MRMESH_API std::filesystem::path getDirectory(Directory dir)
get the directory path for specified category
Directory
directory category
Definition MRSystemPath.h:38
@ Fonts
fonts (.ttf, .otf)
@ PythonModules
Python modules (.pyd, .so, .dylib, .pyi)
@ Plugins
plugins (.dll, .so, .dylib)
@ Resources
resources (.json, .png)
only for bindings generation
Definition MRCameraOrientationPlugin.h:8