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{
12
13
15MRMESH_API void SetCurrentThreadName( const char * name );
16
18[[deprecated( "Use SystemPath::getExecutableDirectory() instead" )]]
19[[nodiscard]] MRMESH_API MR_BIND_IGNORE std::filesystem::path GetExeDirectory();
20
23[[deprecated( "Use SystemPath::getResourcesDirectory() instead" )]]
24[[nodiscard]] MRMESH_API MR_BIND_IGNORE std::filesystem::path GetResourcesDirectory();
25
28[[deprecated( "Use SystemPath::getFontsDirectory() instead" )]]
29[[nodiscard]] MRMESH_API MR_BIND_IGNORE std::filesystem::path GetFontsDirectory();
30
33[[deprecated( "Use SystemPath::getPluginsDirectory() instead" )]]
34[[nodiscard]] MRMESH_API MR_BIND_IGNORE std::filesystem::path GetLibsDirectory();
35
38[[deprecated( "Use SystemPath::getPythonModulesDirectory() instead" )]]
39[[nodiscard]] MRMESH_API MR_BIND_IGNORE std::filesystem::path GetEmbeddedPythonDirectory();
40
42[[nodiscard]] MRMESH_API std::filesystem::path getUserConfigDir();
43
45[[nodiscard]] MRMESH_API std::filesystem::path getUserConfigFilePath();
46
48[[nodiscard]] MRMESH_API std::filesystem::path GetTempDirectory();
49
51[[nodiscard]] MRMESH_API std::filesystem::path GetHomeDirectory();
52
53#ifdef _WIN32
56[[nodiscard]] MRMESH_API MR_BIND_IGNORE std::filesystem::path GetWindowsInstallDirectory();
57#endif
58
60[[nodiscard]] MRMESH_API const char * GetMRVersionString();
61
63MRMESH_API void OpenLink( const std::string& url );
64
66MRMESH_API bool OpenDocument( const std::filesystem::path& path );
67
69[[nodiscard]] MRMESH_API std::string GetCpuId();
70
72[[nodiscard]] MRMESH_API std::string GetDetailedOSName();
73
75[[nodiscard]] MRMESH_API std::string getOSNoSpaces();
76
78MRMESH_API void setNewHandlerIfNeeded();
79
80using FileNamesStack = std::vector<std::filesystem::path>;
81
82#ifndef __EMSCRIPTEN__
84[[nodiscard]] MRMESH_API std::string getCurrentStacktrace();
85#endif
86
88{
90 size_t physicalTotal = 0;
91
94};
95
97[[nodiscard]] MRMESH_API SystemMemory getSystemMemory();
98
99#ifdef _WIN32
101struct MR_BIND_IGNORE ProccessMemoryInfo
102{
103 size_t currVirtual = 0, maxVirtual = 0;
104 size_t currPhysical = 0, maxPhysical = 0;
105};
106[[nodiscard]] MRMESH_API MR_BIND_IGNORE ProccessMemoryInfo getProccessMemoryInfo();
107#endif
108
116MRMESH_API void setupLoggerByDefault( const std::function<void()>& customLogSinkAdder = {} );
117
118}
MRMESH_API void setupLoggerByDefault(const std::function< void()> &customLogSinkAdder={})
_WIN32
MRMESH_API bool OpenDocument(const std::filesystem::path &path)
Opens given file (or directory) in associated application.
MRMESH_API std::filesystem::path GetHomeDirectory()
returns home directory
size_t physicalTotal
total amount of physical memory in the system, in bytes (0 if no info)
Definition MRSystem.h:90
MRMESH_API const char * GetMRVersionString()
_WIN32
MRMESH_API SystemMemory getSystemMemory()
return information about memory available in the system
MRMESH_API std::string getOSNoSpaces()
returns string identification of the OS
MRMESH_API MR_BIND_IGNORE std::filesystem::path GetEmbeddedPythonDirectory()
MRMESH_API std::filesystem::path GetTempDirectory()
returns temp directory
MRMESH_API MR_BIND_IGNORE std::filesystem::path GetLibsDirectory()
MRMESH_API MR_BIND_IGNORE std::filesystem::path GetFontsDirectory()
MRMESH_API std::string getCurrentStacktrace()
returns string representation of the current stacktrace
MRMESH_API void setNewHandlerIfNeeded()
sets new handler for operator new if needed for some platforms
size_t physicalAvailable
available amount of physical memory in the system, in bytes (0 if no info)
Definition MRSystem.h:93
MRMESH_API std::filesystem::path getUserConfigFilePath()
returns path of config file in APPDATA
MRMESH_API std::string GetCpuId()
returns string identification of the CPU
MRMESH_API std::string GetDetailedOSName()
returns string with OS name with details
MRMESH_API MR_BIND_IGNORE std::filesystem::path GetExeDirectory()
returns path of current exe directory
MRMESH_API void SetCurrentThreadName(const char *name)
sets debug name for the current thread
std::vector< std::filesystem::path > FileNamesStack
Definition MRIOFilesMenuItems.h:17
std::array< Vector3f, 3 > MR_BIND_IGNORE
Definition MRMeshBuilderTypes.h:13
MRMESH_API std::filesystem::path getUserConfigDir()
return path to the folder with user config file(s)
MRMESH_API MR_BIND_IGNORE std::filesystem::path GetResourcesDirectory()
MRMESH_API void OpenLink(const std::string &url)
Opens given link in default browser.
only for bindings generation
Definition MRCameraOrientationPlugin.h:8
Definition MRSystem.h:88