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[[nodiscard]] MRMESH_API std::filesystem::path GetExeDirectory();
15
16// returns path of resource files directory
17// .json and .png files
18[[nodiscard]] MRMESH_API std::filesystem::path GetResourcesDirectory();
19
20// returns path of font files directory
21// .ttf files
22[[nodiscard]] MRMESH_API std::filesystem::path GetFontsDirectory();
23
24// returns path of lib files directory
25// .dll .so files
26[[nodiscard]] MRMESH_API std::filesystem::path GetLibsDirectory();
27
28// returns path of embedded python modules files directory
29// .dll .so files
30[[nodiscard]] MRMESH_API std::filesystem::path GetEmbeddedPythonDirectory();
31
32// return path to the folder with user config file(s)
33[[nodiscard]] MRMESH_API std::filesystem::path getUserConfigDir();
34
35// returns path of config file in APPDATA
36[[nodiscard]] MRMESH_API std::filesystem::path getUserConfigFilePath();
37
38// returns temp directory
39[[nodiscard]] MRMESH_API std::filesystem::path GetTempDirectory();
40
41// returns home directory
42[[nodiscard]] MRMESH_API std::filesystem::path GetHomeDirectory();
43
44#ifdef _WIN32
45// returns the folder where Windows installed, typically "C:\Windows"
46[[nodiscard]] MRMESH_API std::filesystem::path GetWindowsInstallDirectory();
47#endif //_WIN32
48
49// returns version of MR
50[[nodiscard]] MRMESH_API std::string GetMRVersionString();
51
52// Opens given link in default browser
53MRMESH_API void OpenLink( const std::string& url );
54
55// Opens given file (or directory) in associated application
56MRMESH_API bool OpenDocument( const std::filesystem::path& path );
57
58// returns string identification of the CPU
59[[nodiscard]] MRMESH_API std::string GetCpuId();
60
61// returns string with OS name with details
62[[nodiscard]] MRMESH_API std::string GetDetailedOSName();
63
64// returns string identification of the OS
65[[nodiscard]] MRMESH_API std::string getOSNoSpaces();
66
67// sets new handler for operator new if needed for some platforms
69
70using FileNamesStack = std::vector<std::filesystem::path>;
71
72#ifndef __EMSCRIPTEN__
74[[nodiscard]] MRMESH_API std::string getCurrentStacktrace();
75#endif
76
77#ifdef _WIN32
78struct ProccessMemoryInfo
79{
80 size_t currVirtual = 0, maxVirtual = 0;
81 size_t currPhysical = 0, maxPhysical = 0;
82};
83[[nodiscard]] MRMESH_API ProccessMemoryInfo getProccessMemoryInfo();
84#endif //_WIN32
85
93
94} // namespace MR
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:46
Definition MRCameraOrientationPlugin.h:7
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:10
MRMESH_API std::string GetMRVersionString()
MRMESH_API std::filesystem::path getUserConfigDir()
MRMESH_API void OpenLink(const std::string &url)