cpp-hocon 0.3.0
Loading...
Searching...
No Matches
config_include_context.hpp
1#pragma once
2
3#include "types.hpp"
4#include "config_parse_options.hpp"
5#include "export.h"
6
7namespace hocon {
8
21 class LIBCPP_HOCON_EXPORT config_include_context {
22 public:
23 config_include_context() : _cur_dir(new std::string("")) {}
40 virtual shared_parseable relative_to(std::string file_name) const = 0;
41
50
51 void set_cur_dir(std::string dir) const {
52 _cur_dir->assign(dir);
53 }
54
55 std::string get_cur_dir() const {
56 return *_cur_dir;
57 }
58
59 protected:
60 std::shared_ptr<std::string> _cur_dir;
61 };
62
63} // namespace hocon
Context provided to a config_includer; this interface is only useful inside a config_includer impleme...
virtual config_parse_options parse_options() const =0
Parse options to use (if you use another method to get a config_parseable then use config_parseable#o...
virtual shared_parseable relative_to(std::string file_name) const =0
Tries to find a name relative to whatever is doing the including, for example in the same directory a...
A set of options related to parsing.
Factory for creating config_document instances.
Definition: config.hpp:18