// SPDX-FileCopyrightText: 2024 Yury Gubich // SPDX-License-Identifier: GPL-3.0-or-later #pragma once #include #include #include #include #include #include "gloox/gloox.h" #include "yaml-cpp/yaml.h" #include "shared/definitions.h" #include "shared/result.h" #include "shared/logger.h" class Config { public: struct Module { bool enabled; std::string type; std::string alias; Shared::Permissions permissions; }; public: Config(const std::filesystem::path& path); bool isValid() const; std::string getBareJID() const; std::string getFullJID() const; std::string getPassword() const; std::string getResource() const; std::map getActors() const; Shared::Logger::Level getLogLevel() const; gloox::TLSPolicy getTLSPolicy() const; std::vector getModules() const; Shared::Responses getResponses() const; void setActors(const std::map& actors); private: std::filesystem::path path; YAML::Node root; };