GL Studio C++ Runtime API
VPFTableHeader Class Reference

#include <vpf_table_header.h>

Classes

class  ColumnDefinition
 

Public Types

typedef VPFUtil::PointerArray< ColumnDefinitionColumnDefinitionArray
 

Public Member Functions

 VPFTableHeader (VPFFile &infile)
 
VPFUtil::EndianMode GetEndianMode (void) const
 
const char * GetDescription (void) const
 
const char * GetNarrativeFilename (void) const
 
unsigned int GetColumnCount (void) const
 
const ColumnDefinitionGetColumnDefinition (unsigned int index) const
 
bool FindColumn (const char *const colName, unsigned int &colIndex) const
 
bool IsValid (void) const
 

Protected Attributes

VPFUtil::WarningBool _isValid
 
VPFUtil::EndianMode _endianMode
 
char _description [DESCRIPTION_LENGTH+1u]
 
char _narrativeFile [NARRATIVE_FILE_LENGTH+1u]
 
ColumnDefinitionArray _columnDefs
 

Detailed Description

reads and encapsulates a VPF table header

Member Typedef Documentation

array of column definition pointers

Constructor & Destructor Documentation

VPFTableHeader ( VPFFile &  infile)

Read the table header from the given VPF file. Infile will be "seeked" to just past the header on success.

Parameters
infileVPF file to read header from (must be "seeked" to start of file)

Member Function Documentation

bool FindColumn ( const char *const  colName,
unsigned int &  colIndex 
) const

Find the column index to the column in the table header with the given column name

Parameters
colNamename of desired column
colIndex[out] receives zero based column index on success
Returns
true if column found else false
unsigned int GetColumnCount ( void  ) const
inline

Get the number of columns in the table

Returns
number of columns in the table
const ColumnDefinition* GetColumnDefinition ( unsigned int  index) const
inline

Get a column definition for a given column in the table

Parameters
indexzero based index into columns
Returns
column definition at index else NULL
const char* GetDescription ( void  ) const
inline

Get the description from the table header /return description from the table header

VPFUtil::EndianMode GetEndianMode ( void  ) const
inline

Get the endian mode read from the table header

Returns
the endian mode from the table header
const char* GetNarrativeFilename ( void  ) const
inline

Get the filename of a narrative file associated with the table header

Returns
narrative filename
bool IsValid ( void  ) const
inline
Returns
True if the header was read successfully from the file

Member Data Documentation

ColumnDefinitionArray _columnDefs
protected

column definitions in header

char _description[DESCRIPTION_LENGTH+1u]
protected

table description plus terminator

VPFUtil::EndianMode _endianMode
protected

endian mode of data in table

VPFUtil::WarningBool _isValid
protected

true if header was read successfully else false

char _narrativeFile[NARRATIVE_FILE_LENGTH+1u]
protected

narrative file name plus terminator


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