MeshLib
 
Loading...
Searching...
No Matches
MRSystem.h
Go to the documentation of this file.
1#pragma once
2#include "MRMeshFwd.h"
3#include "MRColor.h"
4#include <filesystem>
5#include <string>
6
7namespace MR
8{
9
10// sets debug name for the current thread
11MRMESH_API void SetCurrentThreadName( const char * name );
12
13// returns path of current exe directory
14[[deprecated( "Use SystemPath::getExecutableDirectory() instead" )]]
15[[nodiscard]] MRMESH_API std::filesystem::path GetExeDirectory();
16
17// returns path of resource files directory
18// .json and .png files
19[[deprecated( "Use SystemPath::getResourcesDirectory() instead" )]]
20[[nodiscard]] MRMESH_API std::filesystem::path GetResourcesDirectory();
21
22// returns path of font files directory
23// .ttf files
24[[deprecated( "Use SystemPath::getFontsDirectory() instead" )]]
25[[nodiscard]] MRMESH_API std::filesystem::path GetFontsDirectory();
26
27// returns path of lib files directory
28// .dll .so files
29[[deprecated( "Use SystemPath::getPluginsDirectory() instead" )]]
30[[nodiscard]] MRMESH_API std::filesystem::path GetLibsDirectory();
31
32// returns path of embedded python modules files directory
33// .dll .so files
34[[deprecated( "Use SystemPath::getPythonModulesDirectory() instead" )]]
35[[nodiscard]] MRMESH_API std::filesystem::path GetEmbeddedPythonDirectory();
36
37// return path to the folder with user config file(s)
38[[nodiscard]] MRMESH_API std::filesystem::path getUserConfigDir();
39
40// returns path of config file in APPDATA
41[[nodiscard]] MRMESH_API std::filesystem::path getUserConfigFilePath();
42
43// returns temp directory
44[[nodiscard]] MRMESH_API std::filesystem::path GetTempDirectory();
45
46// returns home directory
47[[nodiscard]] MRMESH_API std::filesystem::path GetHomeDirectory();
48
49#ifdef _WIN32
50// returns the folder where Windows installed, typically "C:\Windows"
51[[nodiscard]] MRMESH_API std::filesystem::path GetWindowsInstallDirectory();
52#endif //_WIN32
53
54// returns version of MR
55[[nodiscard]] MRMESH_API std::string GetMRVersionString();
56
57// Opens given link in default browser
58MRMESH_API void OpenLink( const std::string& url );
59
60// Opens given file (or directory) in associated application
61MRMESH_API bool OpenDocument( const std::filesystem::path& path );
62
63// returns string identification of the CPU
64[[nodiscard]] MRMESH_API std::string GetCpuId();
65
66// returns string with OS name with details
67[[nodiscard]] MRMESH_API std::string GetDetailedOSName();
68
69// returns string identification of the OS
70[[nodiscard]] MRMESH_API std::string getOSNoSpaces();
71
72// sets new handler for operator new if needed for some platforms
74
75using FileNamesStack = std::vector<std::filesystem::path>;
76
77#ifndef __EMSCRIPTEN__
79[[nodiscard]] MRMESH_API std::string getCurrentStacktrace();
80#endif
81
82#ifdef _WIN32
83struct ProccessMemoryInfo
84{
85 size_t currVirtual = 0, maxVirtual = 0;
86 size_t currPhysical = 0, maxPhysical = 0;
87};
88[[nodiscard]] MRMESH_API ProccessMemoryInfo getProccessMemoryInfo();
89#endif //_WIN32
90
98
99} // namespace MR
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:46
Definition MRCameraOrientationPlugin.h:8
MRMESH_API std::filesystem::path GetResourcesDirectory()
MRMESH_API bool OpenDocument(const std::filesystem::path &path)
MRMESH_API std::filesystem::path GetHomeDirectory()
MRMESH_API std::string getOSNoSpaces()
MRMESH_API std::filesystem::path GetTempDirectory()
MRMESH_API std::filesystem::path GetExeDirectory()
MRMESH_API void setupLoggerByDefault()
MRMESH_API std::string getCurrentStacktrace()
returns string representation of the current stacktrace
MRMESH_API void setNewHandlerIfNeeded()
MRMESH_API std::filesystem::path getUserConfigFilePath()
MRMESH_API std::string GetCpuId()
MRMESH_API std::string GetDetailedOSName()
MRMESH_API std::filesystem::path GetFontsDirectory()
MRMESH_API std::filesystem::path GetLibsDirectory()
MRMESH_API std::filesystem::path GetEmbeddedPythonDirectory()
MRMESH_API void SetCurrentThreadName(const char *name)
std::vector< std::filesystem::path > FileNamesStack
Definition MRIOFilesMenuItems.h:14
MRMESH_API std::string GetMRVersionString()
MRMESH_API std::filesystem::path getUserConfigDir()
MRMESH_API void OpenLink(const std::string &url)