cpp-hocon  0.3.0
Public Member Functions | Protected Attributes | List of all members
hocon::config_include_context Class Referenceabstract

Context provided to a config_includer; this interface is only useful inside a. More...

Inheritance diagram for hocon::config_include_context:
hocon::simple_include_context

Public Member Functions

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 as the file doing the including. More...
 
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#options() instead though). More...
 
void set_cur_dir (std::string dir) const
 
std::string get_cur_dir () const
 

Protected Attributes

std::shared_ptr< std::string > _cur_dir
 

Detailed Description

Context provided to a config_includer; this interface is only useful inside a.

config_includer

implementation, and is not intended for apps to implement.

Do not implement this interface; it should only be implemented by the config library. Arbitrary implementations will not work because the library internals assume a specific concrete implementation. Also, this interface is likely to grow new methods over time, so third-party implementations will break.

Definition at line 21 of file config_include_context.hpp.

Member Function Documentation

◆ parse_options()

virtual config_parse_options hocon::config_include_context::parse_options ( ) const
pure virtual

Parse options to use (if you use another method to get a config_parseable then use config_parseable#options() instead though).

Returns
the parse options

Implemented in hocon::simple_include_context.

◆ relative_to()

virtual shared_parseable hocon::config_include_context::relative_to ( std::string  file_name) const
pure virtual

Tries to find a name relative to whatever is doing the including, for example in the same directory as the file doing the including.

Returns null if it can't meaningfully create a relative name. The returned parseable may not exist; this function is not required to do any IO, just compute what the name would be.

The passed-in filename has to be a complete name (with extension), not just a basename. (Include statements in config files are allowed to give just a basename.)

Parameters
filenamethe name to make relative to the resource doing the including
Returns
parseable item relative to the resource doing the including, or null

Implemented in hocon::simple_include_context.


The documentation for this class was generated from the following file: