summaryrefslogtreecommitdiffstats
path: root/src/utl_yaml.h
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2016-07-03 15:38:59 +0300
committerimarom <imarom@cisco.com>2016-07-03 15:38:59 +0300
commit483dfb7c5021d7dc9e2c7f10c9b76101441c7203 (patch)
tree6173a4256c01cba003b1886078c4e8557173bc7e /src/utl_yaml.h
parent4960031835b92ae34c7b2e1f1512fe2b34c0d8a6 (diff)
slowpath features bit to avoid multiple IFs
Diffstat (limited to 'src/utl_yaml.h')
-rwxr-xr-xsrc/utl_yaml.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/utl_yaml.h b/src/utl_yaml.h
index 2547b666..59104b21 100755
--- a/src/utl_yaml.h
+++ b/src/utl_yaml.h
@@ -39,14 +39,19 @@ bool utl_yaml_read_uint16(const YAML::Node& node,
const std::string &name,
uint16_t & val);
-
/* a thin wrapper to customize errors */
class YAMLParserWrapper {
public:
/* a header that will start every error message */
- YAMLParserWrapper(const std::string &header) : m_header(header) {
+ YAMLParserWrapper(const std::string &filename) : m_filename(filename) {
}
+ /**
+ * loads the file (while parsing it)
+ *
+ */
+ void load(YAML::Node &root);
+
/* bool */
bool parse_bool(const YAML::Node &node, const std::string &name);
bool parse_bool(const YAML::Node &node, const std::string &name, bool def);
@@ -69,6 +74,6 @@ public:
private:
- std::string m_header;
+ std::string m_filename;
};
#endif