|
StormByte C++ Library 1.2.0
StormByte is a comprehensive, cross-platform C++ library aimed at easing system programming, configuration management, logging, and database handling tasks. This library provides a unified API that abstracts away the complexities and inconsistencies of different platforms (Windows, Linux).
|
Path and timing helpers that hide OS differences. More...
Functions | |
| std::filesystem::path | TempFileName (const std::string &prefix="TMP") |
| Creates a unique temporary file and returns its path. | |
| std::filesystem::path | CurrentPath () |
| Current working directory. | |
| std::filesystem::path | ExecutablePath () |
| Directory that contains the running executable. | |
| template<typename Rep , typename Period > | |
| void | Sleep (const std::chrono::duration< Rep, Period > &duration) |
| Suspends the calling thread. | |
Path and timing helpers that hide OS differences.
| std::filesystem::path StormByte::System::CurrentPath | ( | ) |
Current working directory.
| StormByte::SystemError | If the cwd cannot be obtained. |
| std::filesystem::path StormByte::System::ExecutablePath | ( | ) |
Directory that contains the running executable.
| StormByte::SystemError | If the executable path cannot be resolved. |
| void StormByte::System::Sleep | ( | const std::chrono::duration< Rep, Period > & | duration | ) |
Suspends the calling thread.
| Rep | Duration representation. |
| Period | Duration period. |
| duration | Sleep interval. |
| std::filesystem::path StormByte::System::TempFileName | ( | const std::string & | prefix = "TMP" | ) |
Creates a unique temporary file and returns its path.
| prefix | File-name prefix. Default "TMP". On Windows, GetTempFileNameW only uses the first three characters. |
| StormByte::SystemError | If the path cannot be obtained or the file cannot be created. |
The file is created (POSIX: mkstemp, Windows: GetTempFileNameW) and left on disk. The caller owns the unlink.