platformdirs 0.1.0
📂 Python's platformdirs module for C++
Loading...
Searching...
No Matches
unix.h
Go to the documentation of this file.
1#pragma once
2#undef unix
3#include "api.h"
4#include <filesystem>
5#include <optional>
6#include <string>
7#include <variant>
8
9namespace platformdirs {
10namespace unix {
11
22public:
23 unix(const std::optional<std::string> &appname = std::nullopt,
24 const std::variant<std::string, std::nullopt_t, bool> &appauthor =
25 std::nullopt,
26 const std::optional<std::string> &version = std::nullopt,
27 bool roaming = false, bool multipath = false, bool opinion = true,
28 bool ensure_exists = false);
29
32 std::string user_data_dir() const override;
33
34private:
35 auto site_data_dirs() const -> std::vector<std::string>;
36
37public:
44 std::string site_data_dir() const override;
45
48 std::string user_config_dir() const override;
49
50private:
51 auto site_config_dirs() const -> std::vector<std::string>;
52
53public:
58 std::string site_config_dir() const override;
59
63 std::string user_cache_dir() const override;
64
67 std::string site_cache_dir() const override;
68
69 std::string user_state_dir() const override;
70
71 std::string user_log_dir() const override;
72
73 std::string user_documents_dir() const override;
74
75 std::string user_downloads_dir() const override;
76
77 std::string user_pictures_dir() const override;
78
79 std::string user_videos_dir() const override;
80
81 std::string user_music_dir() const override;
82
83 std::string user_desktop_dir() const override;
84
85 std::string user_runtime_dir() const override;
86
87 std::string site_runtime_dir() const override;
88
89 std::filesystem::path site_data_path() const override;
90
91 std::filesystem::path site_config_path() const override;
92
93 std::filesystem::path site_cache_path() const override;
94
95private:
96 std::filesystem::path
97 first_item_as_path_if_multipath(const std::string &directory) const;
98};
99
100} // namespace unix
101} // namespace platformdirs
std::optional< std::string > version
Definition api.h:15
bool multipath
Definition api.h:17
std::variant< std::string, std::nullopt_t, bool > appauthor
Definition api.h:14
bool ensure_exists
Definition api.h:19
bool roaming
Definition api.h:16
bool opinion
Definition api.h:18
std::optional< std::string > appname
Definition api.h:13
Definition unix.h:21
std::filesystem::path site_cache_path() const override
Definition unix.cpp:218
std::filesystem::path site_data_path() const override
Definition unix.cpp:209
std::string user_runtime_dir() const override
Definition unix.cpp:156
std::string site_runtime_dir() const override
Definition unix.cpp:188
std::string user_state_dir() const override
Definition unix.cpp:112
std::string user_data_dir() const override
Definition unix.cpp:24
std::string user_downloads_dir() const override
Definition unix.cpp:136
std::string site_data_dir() const override
Definition unix.cpp:53
std::string site_cache_dir() const override
Definition unix.cpp:108
std::string user_cache_dir() const override
Definition unix.cpp:97
std::string user_videos_dir() const override
Definition unix.cpp:144
std::string user_music_dir() const override
Definition unix.cpp:148
std::string user_log_dir() const override
Definition unix.cpp:123
std::string site_config_dir() const override
Definition unix.cpp:89
std::filesystem::path site_config_path() const override
Definition unix.cpp:213
std::string user_config_dir() const override
Definition unix.cpp:61
std::string user_pictures_dir() const override
Definition unix.cpp:140
std::string user_desktop_dir() const override
Definition unix.cpp:152
std::string user_documents_dir() const override
Definition unix.cpp:132
Definition platformdirs.h:27