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).
Loading...
Searching...
No Matches
system.hxx
Go to the documentation of this file.
1/*
2 * Copyright (C) 2024-2026 David C. Manuelda (StormBytePP)
3 *
4 * This file is part of StormByte.
5 *
6 * StormByte is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License version 3
8 * or later, as published by the Free Software Foundation.
9 *
10 * StormByte is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with StormByte. If not, see
17 * <https://www.gnu.org/licenses/lgpl-3.0.html>.
18 */
19
20#pragma once
21
23
24#include <chrono>
25#include <filesystem>
26#include <string>
27
36namespace StormByte::System {
47 STORMBYTE_PUBLIC std::filesystem::path TempFileName(const std::string& prefix = "TMP");
48
54 STORMBYTE_PUBLIC std::filesystem::path CurrentPath();
55
61 STORMBYTE_PUBLIC std::filesystem::path ExecutablePath();
62
69 template <typename Rep, typename Period>
70 STORMBYTE_PUBLIC void Sleep(const std::chrono::duration<Rep, Period>& duration);
71}
Path and timing helpers that hide OS differences.
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.
void Sleep(const std::chrono::duration< Rep, Period > &duration)
Suspends the calling thread.
std::filesystem::path ExecutablePath()
Directory that contains the running executable.
#define STORMBYTE_PUBLIC
Definition visibility.h:28