tetengo 1.8.1
A multipurpose library set
Loading...
Searching...
No Matches
tetengo::json::file_location Class Reference

A file location. More...

#include <file_location.hpp>

+ Inheritance diagram for tetengo::json::file_location:
+ Collaboration diagram for tetengo::json::file_location:

Public Member Functions

 file_location (std::string line, std::size_t line_index, std::size_t column_index)
 Creates a file location.
 
const std::string & line () const
 Returns the line.
 
std::size_t line_index () const
 Returns the line index.
 
std::size_t column_index () const
 Returns the column index.
 
void set_column_index (std::size_t index)
 Sets a column index.
 

Friends

bool operator== (const file_location &one, const file_location &another)
 Returns true when one file location is equal to another.
 

Detailed Description

A file location.

Constructor & Destructor Documentation

◆ file_location()

tetengo::json::file_location::file_location ( std::string  line,
std::size_t  line_index,
std::size_t  column_index 
)

Creates a file location.

Parameters
lineA line.
line_indexA line index.
column_indexA column index.
Exceptions
std::out_of_rangeWhen column_index is larger than the line length.

Member Function Documentation

◆ column_index()

std::size_t tetengo::json::file_location::column_index ( ) const

Returns the column index.

Returns
The column index.

◆ line()

const std::string & tetengo::json::file_location::line ( ) const

Returns the line.

Returns
The line.

◆ line_index()

std::size_t tetengo::json::file_location::line_index ( ) const

Returns the line index.

Returns
The line index.

◆ set_column_index()

void tetengo::json::file_location::set_column_index ( std::size_t  index)

Sets a column index.

Parameters
indexA column index.
Exceptions
std::out_of_rangeWhen index is larger than the line length.

Friends And Related Symbol Documentation

◆ operator==

bool operator== ( const file_location one,
const file_location another 
)
friend

Returns true when one file location is equal to another.

Parameters
oneOne file location.
anotherAnother file location.
Return values
trueWhen one is equal to another.
falseOtherwise.

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