From 9724ab3be8ccac787196036ebcd24d55243eec7b Mon Sep 17 00:00:00 2001 From: fantasy-peak <82742316+fantasy-peak@users.noreply.github.com> Date: Fri, 22 Dec 2023 09:21:49 +0800 Subject: [PATCH] Update README.md (#4) --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 29ae69a..74ac521 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,7 @@ account_info: vec: ["fantasy-001", "fantasy-002"] set_vec: [9, 5, 7] account_type: "Personal" +ips: ["127.0.0.1"] ``` ```cpp @@ -77,13 +78,16 @@ struct AccountInfo { std::tuple tuple; std::unordered_map> map_tuple; std::string default_str{"hello default"}; + std::vector ips; }; -YCS_ADD_STRUCT(AccountInfo, flag, name, address, num, msec, tuple, map_tuple, default_str) +YCS_ADD_STRUCT(AccountInfo, flag, name, address, num, msec, tuple, map_tuple, default_str, ips) int main(int, char** argv) { auto [cfg, error] = yaml_cpp_struct::from_yaml(argv[1]); auto [str, e] = yaml_cpp_struct::to_yaml(cfg.value()); + // Load values from environment variables + // export YCS_ENV_IPS=["Google","Runoob","Taobao"] + // auto [cfg, error] = yaml_cpp_struct::from_yaml_env(argv[1], "YCS_ENV_"); return 0; } - ```