Kea 2.7.6
|
Represents the position of the data element within a configuration string. More...
#include <data.h>
Public Member Functions | |
Position () | |
Default constructor. | |
Position (const std::string &file, const uint32_t line, const uint32_t pos) | |
Constructor. | |
std::string | str () const |
Returns the position in the textual format. | |
Public Attributes | |
std::string | file_ |
File name. | |
uint32_t | line_ |
Line number. | |
uint32_t | pos_ |
Position within the line. | |
Represents the position of the data element within a configuration string.
Position comprises a file name, line number and an offset within this line where the element value starts. For example, if the JSON string is
the position of the element "bar" is: line_ = 2; pos_ = 9, because beginning of the value "123" is at offset 9 from the beginning of the second line, including whitespaces.
Note that the Position
structure is used as an argument to Element
constructors and factory functions to avoid ambiguity and so that the uint32_t arguments holding line number and position within the line are not confused with the Element
values passed to these functions.
|
inline |
|
inline |
std::string isc::data::Element::Position::str | ( | ) | const |
Returns the position in the textual format.
The returned position has the following format: file:line:pos.
Definition at line 41 of file data.cc.
References file_, line_, and pos_.
Referenced by isc::data::operator<<().
std::string isc::data::Element::Position::file_ |
uint32_t isc::data::Element::Position::line_ |
uint32_t isc::data::Element::Position::pos_ |