config_rw 2.2.1

配置文件读取与写入
Documentation
# 这是一个示例配置文件
# 支持注释,修改配置时注释会被保留

# 数据库配置
[database]
host = "不应该被保存"
port = 3306
enabled = true
# 数据库连接超时时间(秒)
timeout = 30.0

# 应用配置
[app]
name = "更新后的应用名"
version = "1.0.0"
debug = true

# 应用特性配置
[app.features]
logging = true
metrics = false
cache_enabled = true

# 交易配置
[trading]
max_position_size = 10000
stop_loss_percent = 0.03
take_profit_percent = 0.10

# 风控配置
[risk]
max_daily_loss = 50000.0
max_position_count = 20
blacklist_enabled = true

# 网络配置
[network]
server_port = 9090
api_timeout = 5000
max_connections = 100

# 日志配置
[logging]
level = "debug"
file_path = "logs/app.log"
max_size = "10MB"
rotate_daily = true 

[new_section]
new_key = "new_value"

[performance]
max_threads = 8

[complex]
array = ["item1", "item2", 42]

[complex.object]
key1 = "value1"
key2 = 123
key3 = true

[demo]
auto_save_test = "自动保存的值"
number = 12345
enabled = true

[complex_demo]
test_array = ["item1", "item2", 42]

[complex_demo.nested]
key = "nested_value"

[complex_demo.test_object]
name = "test_object"
count = 99
enabled = true