GL Studio Safety Critical Embedded C++ Runtime Library
GlsUtil::InlineReader Class Reference

#include <gls_util.h>

Public Member Functions

 InlineReader (const GlsUChar *const inlineData[], const GlsUInt32 inlineDataLength, const GlsUInt32 lineLength)
 
 ~InlineReader ()
 
GlsUChar ReadByte (void)
 
GlsBool IsDone (void) const
 

Protected Attributes

const GlsUChar *const * _inlineData
 
const GlsUInt32 _inlineDataLength
 
const GlsUInt32 _lineLength
 
GlsUInt32 _curLine
 
GlsUInt32 _curLineIndex
 
GlsUInt32 _numBytesRead
 

Detailed Description

helper class for reading data in inline format

Invariant
_inlineData != GLS_NULL, _inlineDataLength > 0u, _lineLength > 0u, _curLineIndex < _lineLength, _numBytesRead <= _inlineDataLength

Constructor & Destructor Documentation

◆ InlineReader()

GlsUtil::InlineReader::InlineReader ( const GlsUChar *const  inlineData[],
const GlsUInt32  inlineDataLength,
const GlsUInt32  lineLength 
)

Constructor

Parameters
inlineDatainline data
inlineDataLengthnumber of bytes in inline data (not including NULL terminators)
lineLengthlength (in bytes) of one line of data in the inline data (not including NULL terminator)
Precondition
inlineData != GLS_NULL, inlineDataLength > 0, lineLength > 0
Postcondition
instance constructed

◆ ~InlineReader()

GlsUtil::InlineReader::~InlineReader ( )

Destructor

Precondition
none
Postcondition
instance destroyed

Member Function Documentation

◆ IsDone()

GlsBool GlsUtil::InlineReader::IsDone ( void  ) const

Determine if the reader has read all of its inline data

Returns
GLS_TRUE if reader has read all of its inline data else GLS_FALSE
Precondition
none
Postcondition
none

◆ ReadByte()

GlsUChar GlsUtil::InlineReader::ReadByte ( void  )

Read a byte from the inline data

Returns
one byte read from inline data
Precondition
there must be at least one byte of inline data left to read
Postcondition
one byte is read from the inline data

Member Data Documentation

◆ _curLine

GlsUInt32 GlsUtil::InlineReader::_curLine
protected

index to current line of inline data

◆ _curLineIndex

GlsUInt32 GlsUtil::InlineReader::_curLineIndex
protected

index to current byte of current line

◆ _inlineData

const GlsUChar* const* GlsUtil::InlineReader::_inlineData
protected

inline data to read

◆ _inlineDataLength

const GlsUInt32 GlsUtil::InlineReader::_inlineDataLength
protected

number of bytes in inline data (not including NULL terminators)

◆ _lineLength

const GlsUInt32 GlsUtil::InlineReader::_lineLength
protected

length (in bytes) of one line of data in the inline data (not including NULL terminator)

◆ _numBytesRead

GlsUInt32 GlsUtil::InlineReader::_numBytesRead
protected

number of bytes read from inline data