Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
CursorStreamWrapper< InputStream, Encoding > Class Template Reference

Cursor stream wrapper for counting line and column number if error exists. More...

#include <cursorstreamwrapper.h>

Inheritance diagram for CursorStreamWrapper< InputStream, Encoding >:
Collaboration diagram for CursorStreamWrapper< InputStream, Encoding >:

Public Types

typedef Encoding::Ch Ch
 
- Public Types inherited from GenericStreamWrapper< InputStream, UTF8<> >
typedef UTF8<>::Ch Ch
 

Public Member Functions

 CursorStreamWrapper (InputStream &is)
 
Ch Take ()
 
size_t GetLine () const
 Get the error line number, if error exists.
 
size_t GetColumn () const
 Get the error column number, if error exists.
 
- Public Member Functions inherited from GenericStreamWrapper< InputStream, UTF8<> >
 GenericStreamWrapper (InputStream &is)
 
Ch Peek () const
 
Ch Take ()
 
size_t Tell ()
 
ChPutBegin ()
 
void Put (Ch ch)
 
void Flush ()
 
size_t PutEnd (Ch *ch)
 
const ChPeek4 () const
 
UTFType GetType () const
 
bool HasBOM () const
 

Additional Inherited Members

- Protected Attributes inherited from GenericStreamWrapper< InputStream, UTF8<> >
InputStream & is_
 

Detailed Description

template<typename InputStream, typename Encoding = UTF8<>>
class CursorStreamWrapper< InputStream, Encoding >
Template Parameters
InputStreamAny stream that implements Stream Concept

Definition at line 39 of file cursorstreamwrapper.h.

Member Typedef Documentation

◆ Ch

template<typename InputStream , typename Encoding = UTF8<>>
Encoding::Ch CursorStreamWrapper< InputStream, Encoding >::Ch

Definition at line 41 of file cursorstreamwrapper.h.

Constructor & Destructor Documentation

◆ CursorStreamWrapper()

template<typename InputStream , typename Encoding = UTF8<>>
CursorStreamWrapper< InputStream, Encoding >::CursorStreamWrapper ( InputStream & is)
inline

Definition at line 43 of file cursorstreamwrapper.h.

43 :
44 GenericStreamWrapper<InputStream, Encoding>(is), line_(1), col_(0) {}

Member Function Documentation

◆ GetColumn()

template<typename InputStream , typename Encoding = UTF8<>>
size_t CursorStreamWrapper< InputStream, Encoding >::GetColumn ( ) const
inline

Definition at line 61 of file cursorstreamwrapper.h.

61{ return col_; }
Here is the caller graph for this function:

◆ GetLine()

template<typename InputStream , typename Encoding = UTF8<>>
size_t CursorStreamWrapper< InputStream, Encoding >::GetLine ( ) const
inline

Definition at line 59 of file cursorstreamwrapper.h.

59{ return line_; }
Here is the caller graph for this function:

◆ Take()

template<typename InputStream , typename Encoding = UTF8<>>
Ch CursorStreamWrapper< InputStream, Encoding >::Take ( )
inline

Definition at line 47 of file cursorstreamwrapper.h.

47 {
48 Ch ch = this->is_.Take();
49 if(ch == '\n') {
50 line_ ++;
51 col_ = 0;
52 } else {
53 col_ ++;
54 }
55 return ch;
56 }
static const Reg8 ch(Operand::CH)

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