FilePos.hpp
Go to the documentation of this file.
1 
6 #pragma once
7 
8 #include <etk/types.hpp>
9 
10 namespace exml {
14  class FilePos {
15  private:
16  size_t m_col;
17  size_t m_line;
18  public:
22  FilePos();
28  FilePos(size_t _line, size_t _col);
44  FilePos& operator +=(const FilePos& _obj);
50  FilePos& operator +=(size_t _col);
56  FilePos& operator= (const FilePos& _obj);
60  void newLine();
67  bool check(char32_t _val);
73  void set(size_t _line, size_t _col);
77  void clear();
82  size_t getCol() const;
87  size_t getLine() const;
88  };
90  std::ostream& operator <<(std::ostream& _os, const FilePos& _obj);
91 
92 }
93 
FilePos & operator++()
Increment the colomn position.
bool check(char32_t _val)
Check if the value is a new line and update internal property.
size_t getCol() const
Get the colomn position.
exml namespace containing all function for XML interpretor
Definition: Attribute.hpp:11
void newLine()
Find a new line & reset colomn at 0.
FilePos & operator--()
Decrement the colomn position.
FilePos & operator=(const FilePos &_obj)
Asignment operator.
Position in the file of the original data.
Definition: FilePos.hpp:14
void clear()
Reset position at 0,0.
FilePos()
default contructor (set line and col at 0)
size_t getLine() const
Get the line number position.
FilePos & operator+=(const FilePos &_obj)
Addition operator.