summaryrefslogtreecommitdiff
path: root/cpp/examples/read_conf.cpp
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2025-09-16 14:17:38 -0400
committerpommicket <pommicket@gmail.com>2025-09-16 14:17:38 -0400
commit76f68d6c93b55f9cd96a369bf2e5785ed16fa184 (patch)
treeddd657b9036fe80696e9c2e2f596ca91ce863680 /cpp/examples/read_conf.cpp
parent9f817b370e55c24db5dee3f6948d2d95df7c3207 (diff)
More work on C++ library
Diffstat (limited to 'cpp/examples/read_conf.cpp')
-rw-r--r--cpp/examples/read_conf.cpp15
1 files changed, 15 insertions, 0 deletions
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 <pom.hpp>
+#include <iostream>
+
+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";
+ }
+}