From 76f68d6c93b55f9cd96a369bf2e5785ed16fa184 Mon Sep 17 00:00:00 2001 From: pommicket Date: Tue, 16 Sep 2025 14:17:38 -0400 Subject: More work on C++ library --- cpp/examples/read_conf.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 cpp/examples/read_conf.cpp (limited to 'cpp/examples/read_conf.cpp') diff --git a/cpp/examples/read_conf.cpp b/cpp/examples/read_conf.cpp new file mode 100644 index 0000000..0a7ef51 --- /dev/null +++ b/cpp/examples/read_conf.cpp @@ -0,0 +1,15 @@ +#include +#include + +int main(void) { + try { + pom::Configuration conf = pom::Configuration("conf.pom"); + auto indentation_type = conf.get("indentation-type"); + if (indentation_type.has_value()) + std::cout << "Indenting with " << indentation_type.value() << "\n"; + else + std::cout << "No indentation type set!\n"; + } catch (pom::Error &error) { + std::cerr << error.what() << "\n"; + } +} -- cgit v1.2.3