Impl: Config system - check env

This commit is contained in:
xiaozhou233 committed 2026-04-17 22:11:03 +08:00
1 parent 174197badb
commit 2f7eb532a7
1 file changed
+29
+29
View File
@@ -0,0 +1,29 @@
#pragma once
#include <filesystem>
#include <JuiceAgent/Logger.hpp>
namespace JuiceAgent::Config
{
class Config {
private:
std::filesystem::path config_dir;
public:
Config(std::filesystem::path config_dir) : config_dir(config_dir){
// Check if config_dir exists
if (!std::filesystem::exists(config_dir)){
PLOGE << "Config directory does not exist" << config_dir;
return;
}
std::filesystem::path config_file = config_dir / "config.toml";
// Check if config file exists
if (!std::filesystem::exists(config_file)){
PLOGE << "Config file does not exist" << config_file;
return;
}
}
};
} // namespace JuiceAgent::Config