ejson::FilePos Class Reference

#include <FilePos.hpp>

Public Member Functions

 FilePos ()
 
 FilePos (size_t _line, size_t _col)
 
FilePosoperator++ ()
 
FilePosoperator-- ()
 
FilePosoperator+= (const FilePos &_obj)
 
FilePosoperator+= (size_t _col)
 
FilePosoperator= (const FilePos &_obj)
 
void newLine ()
 
bool check (char32_t _val)
 
void set (size_t _line, size_t _col)
 
void clear ()
 
size_t getCol () const
 
size_t getLine () const
 

Detailed Description

Position in the file of the original data.

Constructor & Destructor Documentation

§ FilePos() [1/2]

ejson::FilePos::FilePos ( )

default contructor (set line and col at 0)

§ FilePos() [2/2]

ejson::FilePos::FilePos ( size_t  _line,
size_t  _col 
)

initialize constructor

Parameters
[in]_lineLine in the file
[in]_colColomn in the file

Member Function Documentation

§ check()

bool ejson::FilePos::check ( char32_t  _val)

Check if the value is a new line and update internal property.

Parameters
[in]_valChar value to check
Returns
true We find a new line
false We NOT find a new line

§ clear()

void ejson::FilePos::clear ( )

Reset position at 0,0.

§ getCol()

size_t ejson::FilePos::getCol ( ) const

Get the colomn position.

Returns
Colomn in number of utf8-char

§ getLine()

size_t ejson::FilePos::getLine ( ) const

Get the line number position.

Returns
line ID (start at 0)

§ newLine()

void ejson::FilePos::newLine ( )

Find a new line & reset colomn at 0.

§ operator++()

FilePos& ejson::FilePos::operator++ ( )

Increment the colomn position.

Returns
Reference on this

§ operator+=() [1/2]

FilePos& ejson::FilePos::operator+= ( const FilePos _obj)

Addition operator.

Parameters
[in]_objAddition object..
Returns
Reference on this

§ operator+=() [2/2]

FilePos& ejson::FilePos::operator+= ( size_t  _col)

Colomn addition operator.

Parameters
[in]_colNumber of colomn to add
Returns
Reference on this

§ operator--()

FilePos& ejson::FilePos::operator-- ( )

Decrement the colomn position.

Returns
Reference on this

§ operator=()

FilePos& ejson::FilePos::operator= ( const FilePos _obj)

Asignment operator.

Parameters
[in]_objObject to copy
Returns
Reference on this

§ set()

void ejson::FilePos::set ( size_t  _line,
size_t  _col 
)

Setter of specific data.

Parameters
[in]_lineLine in the file
[in]_colColomn in the file

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