stellarlib 0.1.0
Loading...
Searching...
No Matches
metadata.hpp
1/* clang-format off */
2
3/*
4 stellarlib
5 Copyright (C) 2025-2026 Domán Zana
6
7 This software is provided 'as-is', without any express or implied
8 warranty. In no event will the authors be held liable for any damages
9 arising from the use of this software.
10
11 Permission is granted to anyone to use this software for any purpose,
12 including commercial applications, and to alter it and redistribute it
13 freely, subject to the following restrictions:
14
15 1. The origin of this software must not be misrepresented; you must not
16 claim that you wrote the original software. If you use this software
17 in a product, an acknowledgment in the product documentation would be
18 appreciated but is not required.
19 2. Altered source versions must be plainly marked as such, and must not be
20 misrepresented as being the original software.
21 3. This notice may not be removed or altered from any source distribution.
22*/
23
24#ifndef STELLARLIB_APP_METADATA_HPP
25#define STELLARLIB_APP_METADATA_HPP
26
27#include <stellarlib/app/lifecycle.hpp>
28
29#include <string>
30
31/**
32 * @brief Application runtime
33 */
34namespace stellarlib::app
35{
36/**
37 * @brief Metadata subsystem
38 */
39class metadata final
40{
41friend internal::lifecycle<class context>;
42
43public:
44 /**
45 * @brief Metadata initialization descriptor
46 */
47 struct info final
48 {
49 /**
50 * @brief Name of the application
51 */
52 std::string name;
53
54 /**
55 * @brief Version of the application
56 */
57 std::string version;
58
59 /**
60 * @brief Reverse-domain identifier of the application
61 */
62 std::string identifier;
63
64 /**
65 * @brief Creator of the application
66 */
67 std::string creator;
68
69 /**
70 * @brief Copyright notice of the application
71 */
72 std::string copyright;
73
74 /**
75 * @brief URL of the application's website
76 */
77 std::string url;
78
79 /**
80 * @brief Type of the application (e.g., "application", "game")
81 */
82 std::string type;
83 };
84
85 /**
86 * @brief Deleted copy constructor
87 */
88 [[nodiscard]]
89 constexpr metadata(const metadata &) noexcept = delete;
90
91 /**
92 * @brief Deleted move constructor
93 */
94 [[nodiscard]]
95 constexpr metadata(metadata &&) noexcept = delete;
96
97 /**
98 * @brief Deleted copy assignment operator
99 */
100 constexpr auto operator=(const metadata &) noexcept
101 -> metadata & = delete;
102
103 /**
104 * @brief Deleted move assignment operator
105 */
106 constexpr auto operator=(metadata &&) noexcept
107 -> metadata & = delete;
108
109 /**
110 * @brief Destructor
111 */
113
114 /**
115 * @brief Returns the name of the application
116 * @return Name of the application
117 */
118 [[nodiscard]]
119 auto name() const
120 -> std::string;
121
122 /**
123 * @brief Returns the version of the application
124 * @return Version of the application
125 */
126 [[nodiscard]]
127 auto version() const
128 -> std::string;
129
130 /**
131 * @brief Returns the reverse-domain identifier of the application
132 * @return Reverse-domain identifier of the application
133 */
134 [[nodiscard]]
135 auto identifier() const
136 -> std::string;
137
138 /**
139 * @brief Returns the creator of the application
140 * @return Creator of the application
141 */
142 [[nodiscard]]
143 auto creator() const
144 -> std::string;
145
146 /**
147 * @brief Returns the copyright notice of the application
148 * @return Copyright notice of the application
149 */
150 [[nodiscard]]
151 auto copyright() const
152 -> std::string;
153
154 /**
155 * @brief Returns the URL of the application's website
156 * @return URL of the application's website
157 */
158 [[nodiscard]]
159 auto url() const
160 -> std::string;
161
162 /**
163 * @brief Returns the type of the application (e.g., "application", "game")
164 * @return Type of the application (e.g., "application", "game")
165 */
166 [[nodiscard]]
167 auto type() const
168 -> std::string;
169
170private:
171 [[nodiscard]]
172 explicit metadata(const info &info);
173};
174}
175
176#endif
auto url() const -> std::string
Returns the URL of the application's website.
auto copyright() const -> std::string
Returns the copyright notice of the application.
auto type() const -> std::string
Returns the type of the application (e.g., "application", "game").
constexpr metadata(metadata &&) noexcept=delete
Deleted move constructor.
auto version() const -> std::string
Returns the version of the application.
auto identifier() const -> std::string
Returns the reverse-domain identifier of the application.
auto creator() const -> std::string
Returns the creator of the application.
constexpr metadata(const metadata &) noexcept=delete
Deleted copy constructor.
auto name() const -> std::string
Returns the name of the application.
Application runtime.
Definition clock.hpp:33
Metadata initialization descriptor.
Definition metadata.hpp:48
std::string name
Name of the application.
Definition metadata.hpp:52
std::string type
Type of the application (e.g., "application", "game").
Definition metadata.hpp:82
std::string identifier
Reverse-domain identifier of the application.
Definition metadata.hpp:62
std::string version
Version of the application.
Definition metadata.hpp:57
std::string url
URL of the application's website.
Definition metadata.hpp:77
std::string copyright
Copyright notice of the application.
Definition metadata.hpp:72
std::string creator
Creator of the application.
Definition metadata.hpp:67