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
15[[nodiscard]] MRMESH_API MR_BIND_IGNORE std::string getProductName();
16
18MRMESH_API void SetCurrentThreadName( const char * name );
19
21[[deprecated( "Use SystemPath::getExecutableDirectory() instead" )]]
22[[nodiscard]] MRMESH_API MR_BIND_IGNORE std::filesystem::path GetExeDirectory();
23
26[[deprecated( "Use SystemPath::getResourcesDirectory() instead" )]]
27[[nodiscard]] MRMESH_API MR_BIND_IGNORE std::filesystem::path GetResourcesDirectory();
28
31[[deprecated( "Use SystemPath::getFontsDirectory() instead" )]]
32[[nodiscard]] MRMESH_API MR_BIND_IGNORE std::filesystem::path GetFontsDirectory();
33
36[[deprecated( "Use SystemPath::getPluginsDirectory() instead" )]]
37[[nodiscard]] MRMESH_API MR_BIND_IGNORE std::filesystem::path GetLibsDirectory();
38
41[[deprecated( "Use SystemPath::getPythonModulesDirectory() instead" )]]
42[[nodiscard]] MRMESH_API MR_BIND_IGNORE std::filesystem::path GetEmbeddedPythonDirectory();
43
45[[nodiscard]] MRMESH_API std::filesystem::path getUserConfigDir();
46
48[[nodiscard]] MRMESH_API std::filesystem::path getUserConfigFilePath();
49
51[[nodiscard]] MRMESH_API std::filesystem::path GetTempDirectory();
52
54[[nodiscard]] MRMESH_API std::filesystem::path GetHomeDirectory();
55
56#ifdef _WIN32
59[[nodiscard]] MRMESH_API MR_BIND_IGNORE std::filesystem::path GetWindowsInstallDirectory();
60#endif //_WIN32
61
63[[nodiscard]] MRMESH_API const char * GetMRVersionString();
64
66MRMESH_API void OpenLink( const std::string& url );
67
69MRMESH_API bool OpenDocument( const std::filesystem::path& path );
70
72[[nodiscard]] MRMESH_API std::string GetCpuId();
73
75[[nodiscard]] MRMESH_API std::string GetDetailedOSName();
76
78[[nodiscard]] MRMESH_API std::string getOSNoSpaces();
79
82
83using FileNamesStack = std::vector<std::filesystem::path>;
84
85#ifndef __EMSCRIPTEN__
87[[nodiscard]] MRMESH_API std::string getCurrentStacktrace();
88
94MR_BIND_IGNORE MRMESH_API void setStacktraceProvider( std::string (*provider)() );
95#endif
96
98{
100 size_t physicalTotal = 0;
101
104};
105
108
109#ifdef _WIN32
111struct MR_BIND_IGNORE ProccessMemoryInfo
112{
113 size_t currVirtual = 0, maxVirtual = 0;
114 size_t currPhysical = 0, maxPhysical = 0;
115};
116[[nodiscard]] MRMESH_API MR_BIND_IGNORE ProccessMemoryInfo getProccessMemoryInfo();
117#endif //_WIN32
118
121
123[[nodiscard]] MRMESH_API std::string getLocalTimeZone();
124
132MRMESH_API void setupLoggerByDefault( const std::function<void()>& customLogSinkAdder = {} );
133
134}
#define MRMESH_API
Definition MRMeshFwd.h:85
std::filesystem::path getUserConfigDir()
return path to the folder with user config file(s)
std::filesystem::path getUserConfigFilePath()
returns path of config file in APPDATA
void SetCurrentThreadName(const char *name)
sets debug name for the current thread
void OpenLink(const std::string &url)
Opens given link in default browser.
size_t physicalTotal
total amount of physical memory in the system, in bytes (0 if no info)
Definition MRSystem.h:100
const char * GetMRVersionString()
returns version of MR
void setupLoggerByDefault(const std::function< void()> &customLogSinkAdder={})
std::filesystem::path GetTempDirectory()
returns temp directory
std::filesystem::path GetExeDirectory()
returns path of current exe directory
size_t physicalAvailable
available amount of physical memory in the system, in bytes (0 if no info)
Definition MRSystem.h:103
SystemMemory getSystemMemory()
return information about memory available in the system
std::filesystem::path GetEmbeddedPythonDirectory()
std::filesystem::path GetLibsDirectory()
std::string getProductName()
The name of the current application.
std::string GetDetailedOSName()
returns string with OS name with details
std::string getCurrentStacktrace()
returns string representation of the current stacktrace
std::filesystem::path GetResourcesDirectory()
std::string GetCpuId()
returns string identification of the CPU
std::vector< std::filesystem::path > FileNamesStack
Definition MRIOFilesMenuItems.h:17
bool OpenDocument(const std::filesystem::path &path)
Opens given file (or directory) in associated application.
void setNewHandlerIfNeeded()
sets new handler for operator new if needed for some platforms
std::filesystem::path GetFontsDirectory()
void setStacktraceProvider(std::string(*provider)())
std::string getLocalTimeZone()
returns the current offset of the local time zone from UTC, e.g. "UTC+03:00", or an empty string if i...
std::filesystem::path GetHomeDirectory()
returns home directory
std::uint32_t getCurrentProcessId()
return the current process's id (or 0 for Wasm)
std::string getOSNoSpaces()
returns string identification of the OS and, on Arm (or any macOS), of the CPU architecture,...
Only strictly necessary for the bindings (to make MR::MeshIntersectionResult a complete type).
Definition MRCameraOrientationPlugin.h:8
Definition MRSystem.h:98