cleanups of commented code

This commit is contained in:
2025-10-29 16:15:58 +03:00
parent bc300bb3de
commit 6a72ead855
7 changed files with 12 additions and 1094 deletions

View File

@@ -21,35 +21,7 @@ int main()
auto desc = std::make_tuple(rec_t{"A", 1}, rec_t{"B", 2.2}, rec_t{"C", std::string("EEE")}, rec_t{"D", 3.3},
rec_t{"E", std::vector<int>{1, 2, 3}});
asibfm700::ConfigHolder ch(desc);
// auto err = ch.parse(cfg_str, [](auto s, auto &v) {
// if constexpr (std::is_arithmetic_v<std::decay_t<decltype(v)>>) {
// v = 77;
// } else {
// v = std::string{s.begin(), s.end()};
// }
// return true;
// });
auto err = ch.parse(cfg_str);
auto v = ch.value<float>("A");
std::cout << v.value() << "\n";
// auto v2 = ch.value<std::string>("D");
auto v2 = ch.value<std::string>("C");
std::cout << v2.value_or("<no value>") << "\n";
auto v3 = ch.value<std::vector<int>>("E");
std::cout << "[";
for (auto& el : v3.value_or({0, 0, 0})) {
std::cout << el << " ";
}
std::cout << "]\n";
std::error_code err;
std::ofstream fst("/tmp/cfg.cfg");
fst << asibfm700::Asibfm700MountConfigString;
@@ -85,7 +57,7 @@ int main()
if (ec) {
std::cout << "EC = " << ec.message() << "\n";
} else {
v3 = kvh.getValue<std::vector<int>>("E");
auto v3 = kvh.getValue<std::vector<int>>("E");
std::cout << "[";
for (auto& el : v3.value_or({0, 0, 0})) {
std::cout << el << " ";