31 lines
969 B
C++
31 lines
969 B
C++
#pragma once
|
|
|
|
#include <echoion/api.hpp>
|
|
#include <filesystem>
|
|
#include <string>
|
|
|
|
namespace Echoion::Core {
|
|
|
|
// Configuration loader for JSON config files (internal to Core)
|
|
class ConfigLoader {
|
|
public:
|
|
// Load configuration from JSON file
|
|
[[nodiscard]] static Api::Result<Api::AppConfig> loadFromFile(const std::filesystem::path& path);
|
|
|
|
// Save configuration to JSON file
|
|
[[nodiscard]] static Api::Result<void> saveToFile(const std::filesystem::path& path, const Api::AppConfig& config);
|
|
|
|
// Get default configuration path
|
|
[[nodiscard]] static std::filesystem::path getDefaultConfigPath();
|
|
|
|
// Create default configuration
|
|
[[nodiscard]] static Api::AppConfig createDefaultConfig();
|
|
|
|
private:
|
|
// Parse quality string to enum
|
|
[[nodiscard]] static Api::AudioQuality parseQuality(const std::string& str);
|
|
[[nodiscard]] static std::string qualityToString(Api::AudioQuality quality);
|
|
};
|
|
|
|
} // namespace Echoion::Core
|