DotNameLib
Loading...
Searching...
No Matches
IPlatformInfo.hpp
Go to the documentation of this file.
1#pragma once
2
4#include <cstdint>
5#include <filesystem>
6#include <string>
7
8namespace dotnamecpp::utils {
9
10 enum class Platform : std::uint8_t { Windows, Linux, macOS, Emscripten, Unknown };
11
13 public:
14 virtual ~IPlatformInfo() = default;
15
21 [[nodiscard]]
22 virtual Platform getPlatform() const = 0;
23
29 [[nodiscard]]
30 virtual std::string getPlatformName() const = 0;
31
37 [[nodiscard]]
39
45 [[nodiscard]]
47
54 [[nodiscard]]
55 virtual bool isWindows() const = 0;
56
63 [[nodiscard]]
64 virtual bool isLinux() const = 0;
65
72 [[nodiscard]]
73 virtual bool isMacOS() const = 0;
74
81 [[nodiscard]]
82 virtual bool isEmscripten() const = 0;
83 };
84
85} // namespace dotnamecpp::utils
Definition IPlatformInfo.hpp:12
virtual Platform getPlatform() const =0
Get the Platform object.
virtual Result< std::filesystem::path, FileError > getExecutableDirectory() const =0
Get the Executable Directory object.
virtual bool isMacOS() const =0
Check if the platform is macOS.
virtual std::string getPlatformName() const =0
Get the Platform Name object.
virtual ~IPlatformInfo()=default
virtual bool isEmscripten() const =0
Check if the platform is Emscripten.
virtual Result< std::filesystem::path, FileError > getExecutablePath() const =0
Get the Executable Path object.
virtual bool isWindows() const =0
Check if the platform is Windows.
virtual bool isLinux() const =0
Check if the platform is Linux.
Definition UtilsError.hpp:93
Definition DirectoryManager.cpp:5
Platform
Definition IPlatformInfo.hpp:10
@ Emscripten
Definition IPlatformInfo.hpp:10
@ Unknown
Definition IPlatformInfo.hpp:10
@ macOS
Definition IPlatformInfo.hpp:10
@ Windows
Definition IPlatformInfo.hpp:10
@ Linux
Definition IPlatformInfo.hpp:10