33 std::string m_description;
34 std::vector<std::string> m_packages;
35 std::vector<std::string> m_dependencies;
39 [[maybe_unused]] std::string
const& get_description()
const {
return m_description; }
40 [[maybe_unused]] std::vector<std::string>
const& get_packages()
const {
return m_packages; }
41 [[maybe_unused]] std::vector<std::string>
const& get_dependencies()
const {
return m_dependencies; }
43 [[maybe_unused]]
void set_description(std::string_view str_description) { m_description = str_description; }
44 [[maybe_unused]]
void set_packages(std::vector<std::string>
const& vec_packages) { m_packages = vec_packages; }
45 [[maybe_unused]]
void set_dependencies(std::vector<std::string>
const& vec_dependencies) { m_dependencies = vec_dependencies; }
58 , m_desktop(std::unexpected(
"m_desktop is undefined"))
70 return_if(str_raw_json.empty(), Error(
"D::Empty json data"));
74 recipe.m_description = Pop(db(
"description").
template value<std::string>(),
"E::Missing 'description' field");
76 recipe.m_packages = Pop(db(
"packages").value<std::vector<std::string>>(),
"E::Missing 'packages' field");
78 recipe.m_dependencies = db(
"dependencies").value<std::vector<std::string>>().or_default();
80 if(
auto desktop_json = db(
"desktop").dump(); desktop_json)
96 db(
"description") = recipe.m_description;
97 db(
"packages") = recipe.m_packages;
98 if (!recipe.m_dependencies.empty())
100 db(
"dependencies") = recipe.m_dependencies;
102 if (recipe.m_desktop)
106 db(
"desktop") = desktop_db.data();
A type-safe wrapper around nlohmann::json for database operations.
Recipe()
Construct a new Recipe:: Recipe object.
friend Value< std::string > serialize(Recipe const &recipe) noexcept
Serializes a Recipe class into a json string.
friend Value< Recipe > deserialize(std::string_view raw_json) noexcept
Deserializes JSON string into a Binds object.
Defines a class that manages FlatImage's desktop integration.
A database that interfaces with nlohmann json.
Enhanced error handling framework built on std::expected.
Value< std::string > serialize(Desktop const &desktop) noexcept
Serializes a Desktop class into a json string.
Value< Desktop > deserialize(std::string_view str_raw_json) noexcept
Deserializes a string into a Desktop class.
Package recipe configuration management.
Value< Recipe > deserialize(std::string_view str_raw_json) noexcept
Deserializes a string into a Recipe class.
Value< std::string > serialize(Recipe const &recipe) noexcept
Serializes a Recipe class into a json string.
Value< Db > from_string(S &&s)
Parses a JSON string and creates a Db object.
Enhanced expected type with integrated logging capabilities.