MeshLib C++ Docs
Loading...
Searching...
No Matches
MRSystem.h
Go to the documentation of this file.
1#pragma once
2#include "MRPch/MRBindingMacros.h"
3#include "MRMeshFwd.h"
4#include "MRColor.h"
5#include <filesystem>
6#include <string>
7
8namespace MR
9{
10
11// sets debug name for the current thread
12MRMESH_API void SetCurrentThreadName( const char * name );
13
14// returns path of current exe directory
15[[deprecated( "Use SystemPath::getExecutableDirectory() instead" )]]
16[[nodiscard]] MRMESH_API MR_BIND_IGNORE std::filesystem::path GetExeDirectory();
17
18// returns path of resource files directory
19// .json and .png files
20[[deprecated( "Use SystemPath::getResourcesDirectory() instead" )]]
21[[nodiscard]] MRMESH_API MR_BIND_IGNORE std::filesystem::path GetResourcesDirectory();
22
23// returns path of font files directory
24// .ttf files
25[[deprecated( "Use SystemPath::getFontsDirectory() instead" )]]
26[[nodiscard]] MRMESH_API MR_BIND_IGNORE std::filesystem::path GetFontsDirectory();
27
28// returns path of lib files directory
29// .dll .so files
30[[deprecated( "Use SystemPath::getPluginsDirectory() instead" )]]
31[[nodiscard]] MRMESH_API MR_BIND_IGNORE std::filesystem::path GetLibsDirectory();
32
33// returns path of embedded python modules files directory
34// .dll .so files
35[[deprecated( "Use SystemPath::getPythonModulesDirectory() instead" )]]
36[[nodiscard]] MRMESH_API MR_BIND_IGNORE std::filesystem::path GetEmbeddedPythonDirectory();
37
38// return path to the folder with user config file(s)
39[[nodiscard]] MRMESH_API std::filesystem::path getUserConfigDir();
40
41// returns path of config file in APPDATA
42[[nodiscard]] MRMESH_API std::filesystem::path getUserConfigFilePath();
43
44// returns temp directory
45[[nodiscard]] MRMESH_API std::filesystem::path GetTempDirectory();
46
47// returns home directory
48[[nodiscard]] MRMESH_API std::filesystem::path GetHomeDirectory();
49
50#ifdef _WIN32
51// returns the folder where Windows installed, typically "C:\Windows"
52// This is removed from the bindings because it doesn't exist on all platforms.
53[[nodiscard]] MRMESH_API MR_BIND_IGNORE std::filesystem::path GetWindowsInstallDirectory();
54#endif //_WIN32
55
56// returns version of MR
57[[nodiscard]] MRMESH_API std::string GetMRVersionString();
58
59// Opens given link in default browser
60MRMESH_API void OpenLink( const std::string& url );
61
62// Opens given file (or directory) in associated application
63MRMESH_API bool OpenDocument( const std::filesystem::path& path );
64
65// returns string identification of the CPU
66[[nodiscard]] MRMESH_API std::string GetCpuId();
67
68// returns string with OS name with details
69[[nodiscard]] MRMESH_API std::string GetDetailedOSName();
70
71// returns string identification of the OS
72[[nodiscard]] MRMESH_API std::string getOSNoSpaces();
73
74// sets new handler for operator new if needed for some platforms
76
77using FileNamesStack = std::vector<std::filesystem::path>;
78
79#ifndef __EMSCRIPTEN__
81[[nodiscard]] MRMESH_API std::string getCurrentStacktrace();
82#endif
83
85{
87 size_t physicalTotal = 0;
88
91};
92
95
96#ifdef _WIN32
97// This is removed from the bindings because it's not cross-platform.
98struct MR_BIND_IGNORE ProccessMemoryInfo
99{
100 size_t currVirtual = 0, maxVirtual = 0;
101 size_t currPhysical = 0, maxPhysical = 0;
102};
103[[nodiscard]] MRMESH_API MR_BIND_IGNORE ProccessMemoryInfo getProccessMemoryInfo();
104#endif //_WIN32
105
113
114} // namespace MR
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:80
Definition MRCameraOrientationPlugin.h:8
MRMESH_API bool OpenDocument(const std::filesystem::path &path)
MRMESH_API std::filesystem::path GetHomeDirectory()
MRMESH_API SystemMemory getSystemMemory()
return information about memory available in the system
MRMESH_API std::string getOSNoSpaces()
MRMESH_API MR_BIND_IGNORE std::filesystem::path GetEmbeddedPythonDirectory()
MRMESH_API std::filesystem::path GetTempDirectory()
MRMESH_API MR_BIND_IGNORE std::filesystem::path GetLibsDirectory()
MRMESH_API MR_BIND_IGNORE std::filesystem::path GetFontsDirectory()
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 MR_BIND_IGNORE std::filesystem::path GetExeDirectory()
MRMESH_API void SetCurrentThreadName(const char *name)
std::vector< std::filesystem::path > FileNamesStack
Definition MRIOFilesMenuItems.h:14
MRMESH_API std::string GetMRVersionString()
std::array< Vector3f, 3 > MR_BIND_IGNORE
Definition MRMeshBuilderTypes.h:10
MRMESH_API std::filesystem::path getUserConfigDir()
MRMESH_API MR_BIND_IGNORE std::filesystem::path GetResourcesDirectory()
MRMESH_API void OpenLink(const std::string &url)
Definition MRSystem.h:85
size_t physicalTotal
total amount of physical memory in the system, in bytes (0 if no info)
Definition MRSystem.h:87
size_t physicalAvailable
available amount of physical memory in the system, in bytes (0 if no info)
Definition MRSystem.h:90