ReleaseButler 1.0
😙 package manager on GitHub 😙
Loading...
Searching...
No Matches
os-detect.h
Go to the documentation of this file.
1#pragma once
2#include <array>
3#include <cstdint>
4#include <optional>
5#include <string_view>
6
7namespace os_detect {
8
12constexpr int OS_KIND = 4;
13
14enum OS_KIND : std::uint8_t {
19};
20
24using packinfo = struct Packinfo {
25 std::string_view pack_name_;
26 std::string_view pack_install_name_;
27 std::string_view os_kind_;
28};
29
33constexpr std::array<packinfo, OS_KIND> OS_PACKAGE = {{
34 {"deb", "dpkg", "debian"},
35 {"deb", "dpkg", "ubuntu"},
36 {"rpm", "dnf", "fedora"},
37 {"deb", "dpkg", "deepin"},
38}};
39
46auto OsDetect(const bool vmode) -> std::optional<enum OS_KIND>;
47} // namespace os_detect
Definition os-detect.h:7
OS_KIND
Definition os-detect.h:14
@ deepin
Definition os-detect.h:18
@ ubuntu
Definition os-detect.h:16
@ fedora
Definition os-detect.h:17
@ debian
Definition os-detect.h:15
auto OsDetect(const bool vmode) -> std::optional< enum OS_KIND >
Used to detect the current Linux distributions.
Definition os-detect.cpp:10
constexpr std::array< packinfo, OS_KIND > OS_PACKAGE
Information about currently supported Linux distributions.
Definition os-detect.h:33
struct Packinfo { std::string_view pack_name_; std::string_view pack_install_name_; std::string_view os_kind_;} packinfo
Linux distribution related information.
Definition os-detect.h:24