Style: Config

This commit is contained in:
xiaozhou233 committed 2026-04-16 21:29:13 +08:00
1 parent 6d3e29db03
commit 11aaac0f0b
3 files changed
+8 -8

No files matched your search

+3 -3
View File
@@ -3,8 +3,8 @@
---
## 2026-04-16
- [ ] 把读取toml的库换成支持toml 1.0的库
- [ ] 在 `includes/JuiceAgent` 文件夹下实现 `Config.hpp` 配置系统
- [ ] 新建测试 读取配置文件
- [*] 把读取toml的库换成支持toml 1.0的库 (放弃)
- [x] 在 `includes/JuiceAgent` 文件夹下实现 `Config.hpp` 配置系统
- [*] 新建测试 读取配置文件 (放弃)
- [ ] 重构 `libloader` 的配置系统
@@ -7,7 +7,7 @@
#include <fstream>
#include <string>
namespace config {
namespace JuiceAgent::Config {
class Config {
private:
+4 -4
View File
@@ -1,6 +1,6 @@
#include <JuiceAgent/Logger.hpp>
#include <libloader.hpp>
#include <config.hpp>
#include <JuiceAgent/Config.hpp>
#include <jvm.hpp>
namespace libloader {
@@ -54,7 +54,7 @@ bool invoke_juiceagent_init(JNIEnv* env, const InjectionInfo& info) {
}
// Serialize InjectionInfo to string
std::string args = config::Config::serialize(info);
std::string args = JuiceAgent::Config::Config::serialize(info);
PLOGD << "Invoke args: " << args;
// Create Java string
@@ -83,14 +83,14 @@ void entrypoint(const char* runtime_dir) {
}
// Load configuration
config::Config cfg(runtime_dir);
JuiceAgent::Config::Config cfg(runtime_dir);
if (!cfg.is_valid()) {
PLOGW << "Invalid config, using default values";
}
// Get InjectionInfo
InjectionInfo info = cfg.get_injection_info();
config::print_injection_info(info);
JuiceAgent::Config::print_injection_info(info);
// Validate essential paths
if (info.JuiceAgentAPIJarPath.empty()) {