Line data Source code
1 : #ifndef CURSOR_H 2 : #define CURSOR_H 3 : 4 : #include <iostream> 5 : 6 : class Cursor { 7 : char c; 8 : public: 9 : int pos; 10 : int line; 11 51 : Cursor(int l = 1): c('\0'), pos(0), line(l) { std::cout << std::boolalpha; }; 12 : // Чтение с пропуском пробелов и переносов строки 13 : friend std::ifstream & operator>>(std::ifstream & s, Cursor & x); 14 : // Чтение один в один 15 : friend std::ifstream & operator>>=(std::ifstream & s, Cursor & x); 16 : bool operator==(char x) const; 17 : bool operator!=(char x) const; 18 : bool operator<=(char x) const; 19 : bool operator>=(char x) const; 20 : 21 : void where(void) const; 22 : void cite(std::ifstream & s); 23 : char symbol(void) const; 24 : }; 25 : 26 : #endif