refactor: error handling with err objects

This commit is contained in:
2025-12-17 02:25:21 +03:00
parent f7c290110e
commit d4c563f585
17 changed files with 489 additions and 245 deletions

View File

@@ -3,6 +3,7 @@
#include <core/io/file.hpp>
#include <core/theme/theme_template.hpp>
#include <core/error.hpp>
#include <filesystem>
#include <memory>
#include <string>
@@ -14,23 +15,23 @@ class config
public:
static config &instance();
void initialize(std::unique_ptr<clrsync::core::io::file> file);
Result<void> initialize(std::unique_ptr<clrsync::core::io::file> file);
const std::string font() const;
const uint32_t font_size() const;
const std::string &palettes_path();
const std::string default_theme() const;
const std::unordered_map<std::string, clrsync::core::theme_template> templates();
const clrsync::core::theme_template &template_by_name(const std::string &name) const;
Result<const clrsync::core::theme_template*> template_by_name(const std::string &name) const;
std::filesystem::path get_user_config_dir();
void set_default_theme(const std::string &theme);
void set_palettes_path(const std::string &path);
void set_font(const std::string &font);
void set_font_size(int font_size);
Result<void> set_default_theme(const std::string &theme);
Result<void> set_palettes_path(const std::string &path);
Result<void> set_font(const std::string &font);
Result<void> set_font_size(int font_size);
void update_template(const std::string &key,
Result<void> update_template(const std::string &key,
const clrsync::core::theme_template &theme_template);
static std::filesystem::path get_data_dir();