Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
Gray::cTextReader Class Reference

#include <cTextPos.h>

Inheritance diagram for Gray::cTextReader:
Gray::cTextPos GrayLib::cJSONReader GrayLib::cXmlReader

Public Member Functions

 cTextReader (const char *pszStart, StrLen_t nLenMax=StrT::k_LEN_MAX, StrLen_t nTabSize=cStrConst::k_TabSize)
 
StrLen_t get_LenMax () const noexcept
 
StrLen_t get_LenRemaining () const noexcept
 
bool isValidIndex () const noexcept
 
bool isValidPos () const noexcept
 
const char * get_CursorPtr () const noexcept
 
char get_CursorChar () const noexcept
 
void IncToks (StrLen_t nLen=1)
 
void IncTab (StrLen_t nLenChar=1)
 
StrLen_t IncLineCR (StrLen_t nLenChar=1)
 
bool isEOF () const
 
void SetStartPtr (const char *pszStart, StrLen_t nLenMax=StrT::k_LEN_MAX)
 
- Public Member Functions inherited from Gray::cTextPos
 cTextPos (STREAM_POS_t lOffset=(STREAM_POS_t) k_ITERATE_BAD, ITERATE_t iLineNum=k_ITERATE_BAD, StrLen_t iColNum=k_StrLen_UNK) noexcept
 
void InitTop () noexcept
 
bool isTopLine () const noexcept
 
bool isValidPos () const noexcept
 
STREAM_POS_t get_Offset () const noexcept
 
ITERATE_t get_LineNum () const noexcept
 < Get 0 based line. More...
 
ITERATE_t get_Line1 () const noexcept
 < Get 1 based line. More...
 
StrLen_t get_Column1 () const noexcept
 < Get 1 based column. More...
 
void IncOffset (StrLen_t nLenOffsetSrc) noexcept
 
void IncOffset (StrLen_t nLenOffsetSrc, StrLen_t nLenCol) noexcept
 
void IncChar (StrLen_t nLenChar=1) noexcept
 
void IncLine (StrLen_t nLenChar=1) noexcept
 
StrLen_t GetStr2 (OUT char *pszOut, StrLen_t nLenOut) const
 

Public Attributes

const StrLen_t m_iTabSize
 for proper tracking of the column number on errors. and m_CursorPos. 0 = not used/don't care. More...
 

Protected Attributes

const char * m_pszStart
 starting read position in the data parsing stream/buffer. cTextPos cursor = m_pszStart + m_lOffset. More...
 
StrLen_t m_nLenMax
 don't advance cTextPos::m_lOffset past this. More...
 
- Protected Attributes inherited from Gray::cTextPos
STREAM_POS_t m_lOffset
 byte offset into the file. 0 based More...
 
ITERATE_t m_iLineNum
 0 based row/line, for debug purposes if there is an error. More...
 
StrLen_t m_iColNum
 0 based column number. if used. # of characters, not bytes. UTF can have multi bytes per char. More...
 

Additional Inherited Members

- Static Public Attributes inherited from Gray::cTextPos
static const cTextPos k_Invalid
 Set to invalid values. More...
 
static const cTextPos k_Zero
 Top of file. More...
 

Detailed Description

current File/cXmlReader/cJSONReader/Etc parsing position. include cTextPos similar to cStreamInput but for a memory buffer. cTextPos = Current cursor position for m_pszCursor in the file. used for error messages, etc.

Constructor & Destructor Documentation

◆ cTextReader()

Gray::cTextReader::cTextReader ( const char *  pszStart,
StrLen_t  nLenMax = StrT::k_LEN_MAX,
StrLen_t  nTabSize = cStrConst::k_TabSize 
)
inline

Member Function Documentation

◆ get_CursorChar()

char Gray::cTextReader::get_CursorChar ( ) const
inlinenoexcept

◆ get_CursorPtr()

const char* Gray::cTextReader::get_CursorPtr ( ) const
inlinenoexcept

◆ get_LenMax()

StrLen_t Gray::cTextReader::get_LenMax ( ) const
inlinenoexcept

◆ get_LenRemaining()

StrLen_t Gray::cTextReader::get_LenRemaining ( ) const
inlinenoexcept

◆ IncLineCR()

StrLen_t Gray::cTextReader::IncLineCR ( StrLen_t  nLenChar = 1)
inline

◆ IncTab()

void Gray::cTextReader::IncTab ( StrLen_t  nLenChar = 1)
inline

◆ IncToks()

void Gray::cTextReader::IncToks ( StrLen_t  nLen = 1)
inline

◆ isEOF()

bool Gray::cTextReader::isEOF ( ) const
inline

◆ isValidIndex()

bool Gray::cTextReader::isValidIndex ( ) const
inlinenoexcept

◆ isValidPos()

bool Gray::cTextReader::isValidPos ( ) const
inlinenoexcept

is invalid values? Not k_Invalid

◆ SetStartPtr()

void Gray::cTextReader::SetStartPtr ( const char *  pszStart,
StrLen_t  nLenMax = StrT::k_LEN_MAX 
)
inline

Member Data Documentation

◆ m_iTabSize

const StrLen_t Gray::cTextReader::m_iTabSize

for proper tracking of the column number on errors. and m_CursorPos. 0 = not used/don't care.

◆ m_nLenMax

StrLen_t Gray::cTextReader::m_nLenMax
protected

don't advance cTextPos::m_lOffset past this.

◆ m_pszStart

const char* Gray::cTextReader::m_pszStart
protected

starting read position in the data parsing stream/buffer. cTextPos cursor = m_pszStart + m_lOffset.


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