tetengo 1.8.2
A multipurpose library set
Loading...
Searching...
No Matches
file_location.hpp
Go to the documentation of this file.
1
7#if !defined(TETENGO_JSON_FILELOCATION_HPP)
8#define TETENGO_JSON_FILELOCATION_HPP
9
10#include <cstddef>
11#include <string>
12
13#include <boost/operators.hpp>
14
15
16namespace tetengo::json
17{
21 class file_location : public boost::equality_comparable<file_location>
22 {
23 public:
24 // constructors and destructor
25
35 file_location(std::string line, std::size_t line_index, std::size_t column_index);
36
37
38 // functions
39
49 friend bool operator==(const file_location& one, const file_location& another);
50
56 [[nodiscard]] const std::string& line() const;
57
63 [[nodiscard]] std::size_t line_index() const;
64
70 [[nodiscard]] std::size_t column_index() const;
71
79 void set_column_index(std::size_t index);
80
81
82 private:
83 // variables
84
85 std::string m_line;
86
87 std::size_t m_line_index;
88
89 std::size_t m_column_index;
90 };
91
92
93}
94
95
96#endif
A file location.
Definition file_location.hpp:22
std::size_t column_index() const
Returns the column index.
void set_column_index(std::size_t index)
Sets a column index.
file_location(std::string line, std::size_t line_index, std::size_t column_index)
Creates a file location.
std::size_t line_index() const
Returns the line index.
friend bool operator==(const file_location &one, const file_location &another)
Returns true when one file location is equal to another.
const std::string & line() const
Returns the line.
A JSON library.