summaryrefslogtreecommitdiff
path: root/cpp/examples/read_conf.cpp
blob: df5d3aa6b224989f2e5aab0d0c77cdf99143f848 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <pom.hpp>
#include <iostream>

int main(void) {
	try {
		pom::Configuration conf = pom::Configuration("conf.pom", nullptr);
		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 << "\n";
	}
}