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

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
GlsUtil::InlineReader::~InlineReader ( )

Destructor

Precondition
none
Postcondition
instance destroyed

Member Function Documentation

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

GlsUInt32 GlsUtil::InlineReader::_curLine
protected

index to current line of inline data

GlsUInt32 GlsUtil::InlineReader::_curLineIndex
protected

index to current byte of current line

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

inline data to read

const GlsUInt32 GlsUtil::InlineReader::_inlineDataLength
protected

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

const GlsUInt32 GlsUtil::InlineReader::_lineLength
protected

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

GlsUInt32 GlsUtil::InlineReader::_numBytesRead
protected

number of bytes read from inline data