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

#include <cTextPos.h>

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

Public Member Functions

 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
 

Static Public Attributes

static const cTextPos k_Invalid
 Set to invalid values. More...
 
static const cTextPos k_Zero
 Top of file. More...
 

Protected Attributes

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...
 

Detailed Description

Where inside of a cFileText, cFileTextReader (or other type of text buffer) are we ? Text files have line numbers that won't always correspond to offset when newlines have been transformed. ASSUME: we know which file it is in. We have no idea how long the file is.

Constructor & Destructor Documentation

◆ cTextPos()

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 
)
inlinenoexcept

Member Function Documentation

◆ get_Column1()

StrLen_t Gray::cTextPos::get_Column1 ( ) const
inlinenoexcept

< Get 1 based column.

◆ get_Line1()

ITERATE_t Gray::cTextPos::get_Line1 ( ) const
inlinenoexcept

< Get 1 based line.

◆ get_LineNum()

ITERATE_t Gray::cTextPos::get_LineNum ( ) const
inlinenoexcept

< Get 0 based line.

◆ get_Offset()

STREAM_POS_t Gray::cTextPos::get_Offset ( ) const
inlinenoexcept

Offset in bytes into the stream.

◆ GetStr2()

StrLen_t Gray::cTextPos::GetStr2 ( OUT char *  pszOut,
StrLen_t  nLenOut 
) const

◆ IncChar()

void Gray::cTextPos::IncChar ( StrLen_t  nLenChar = 1)
inlinenoexcept

◆ IncLine()

void Gray::cTextPos::IncLine ( StrLen_t  nLenChar = 1)
inlinenoexcept

◆ IncOffset() [1/2]

void Gray::cTextPos::IncOffset ( StrLen_t  nLenOffsetSrc)
inlinenoexcept

◆ IncOffset() [2/2]

void Gray::cTextPos::IncOffset ( StrLen_t  nLenOffsetSrc,
StrLen_t  nLenCol 
)
inlinenoexcept

◆ InitTop()

void Gray::cTextPos::InitTop ( )
inlinenoexcept

◆ isTopLine()

bool Gray::cTextPos::isTopLine ( ) const
inlinenoexcept

is it on the top line? k_Zero

◆ isValidPos()

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

is invalid values? Not k_Invalid

Member Data Documentation

◆ k_Invalid

const cTextPos Gray::cTextPos::k_Invalid
static

Set to invalid values.

◆ k_Zero

const cTextPos Gray::cTextPos::k_Zero
static

Top of file.

◆ m_iColNum

StrLen_t Gray::cTextPos::m_iColNum
protected

0 based column number. if used. # of characters, not bytes. UTF can have multi bytes per char.

◆ m_iLineNum

ITERATE_t Gray::cTextPos::m_iLineNum
protected

0 based row/line, for debug purposes if there is an error.

◆ m_lOffset

STREAM_POS_t Gray::cTextPos::m_lOffset
protected

byte offset into the file. 0 based


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