cpp-hocon
0.3.0
|
Public Member Functions | |
simple_config_origin (std::string description, int line_number, int end_line_number, origin_type org_type, std::string resource_or_null, std::vector< std::string > comments_or_null) | |
simple_config_origin (std::string description, int line_number=-1, int end_line_number=-1, origin_type org_type=origin_type::GENERIC) | |
This constructor replaces the new_simple method in the original library. More... | |
int | line_number () const override |
Returns a line number where the value or exception originated. More... | |
std::string const & | description () const override |
Returns a string describing the origin of a value or exception. More... | |
std::vector< std::string > const & | comments () const override |
Returns any comments that appeared to "go with" this place in the file. More... | |
shared_origin | with_line_number (int line_number) const override |
Returns a pointer to a copy of this origin with the specified line number as both starting and ending line. More... | |
shared_origin | with_comments (std::vector< std::string > comments) const override |
Returns a. More... | |
std::shared_ptr< const simple_config_origin > | append_comments (std::vector< std::string > comments) const |
std::shared_ptr< const simple_config_origin > | prepend_comments (std::vector< std::string > comments) const |
bool | operator== (const simple_config_origin &other) const |
bool | operator!= (const simple_config_origin &other) const |
Definition at line 13 of file simple_config_origin.hpp.
hocon::simple_config_origin::simple_config_origin | ( | std::string | description, |
int | line_number = -1 , |
||
int | end_line_number = -1 , |
||
origin_type | org_type = origin_type::GENERIC |
||
) |
This constructor replaces the new_simple method in the original library.
|
overridevirtual |
Returns any comments that appeared to "go with" this place in the file.
Often an empty list, but never null. The details of this are subject to change, but at the moment comments that are immediately before an array element or object field, with no blank line after the comment, "go with" that element or field.
Implements hocon::config_origin.
|
overridevirtual |
Returns a string describing the origin of a value or exception.
This will never return null.
Implements hocon::config_origin.
|
overridevirtual |
Returns a line number where the value or exception originated.
This will return -1 if there's no meaningful line number.
Implements hocon::config_origin.
|
overridevirtual |
Returns a.
based on this one, but with the given comments. Does not modify this instance or any
s with this origin (since they are immutable). To set the returned origin to a
, use config_value#with_origin.
Note that when the given comments are equal to the comments on this object, a new instance may not be created and
is returned directly.
comments | the comments used on the returned origin |
Implements hocon::config_origin.
|
overridevirtual |
Returns a pointer to a copy of this origin with the specified line number as both starting and ending line.
Implements hocon::config_origin.