GL Studio C++ Runtime API
GlsGloFile::Reader Class Reference

#include <gls_glo_file.h>

Public Member Functions

 Reader (const std::string &filename, const bool open)
 
 ~Reader ()
 Destroy the reader.
 
bool OpenForReading ()
 
unsigned int GetNumberOfObjectRecords ()
 
unsigned int GetGLStudioVersionMajor ()
 
unsigned int GetGLStudioVersionMinor ()
 
unsigned int GetGLStudioBuildNumber ()
 
unsigned char * GetTimestamp ()
 
void Close ()
 Close the file.
 
std::string GetString (const unsigned int size)
 
bool GetBoolean ()
 
char GetByte ()
 
unsigned char GetUnsignedByte ()
 
short GetShort ()
 
unsigned short GetUnsignedShort ()
 
int GetInt ()
 
unsigned int GetUnsignedInt ()
 
float GetFloat ()
 
double GetDouble ()
 
void GetBytes (const unsigned int size, char **data)
 
glsColor GetColor ()
 
DynamicArray< int > GetMaterialIndices ()
 
bool IsInitialized ()
 
const std::string & GetFilename ()
 

Static Public Attributes

static const unsigned int GLO_SIZE_CACHING_LIMIT = 1024 * 1024
 

Protected Attributes

std::string _filename
 The file name of this GLO file.
 
bool _initialized
 If true, the file is ready for reading.
 
FILE * _in
 The OS file handle for this GLO file.
 
unsigned int _numberOfObjectRecords
 The number of objects described by this GLO file.
 
unsigned int _glsMajor
 The major version of GL Studio that generated this GLO file.
 
unsigned int _glsMinor
 The minor version of GL Studio that generated this GLO file.
 
unsigned int _glsBuild
 The build version of GL Studio that generated this GLO file.
 
unsigned char _timestamp [GLO_FILE_TIMESTAMP_SIZE]
 The timestamp when this file was generated.
 
GloFileHeader _header
 The parsed file header data.
 
char * _fileData
 Pointer holding the all data read in.
 
const char * _fileDataPointer
 Current read position within the GLO data.
 

Detailed Description

The Reader class. Handles input of GLS property values from the GLO file format to the application.

Constructor & Destructor Documentation

◆ Reader()

Reader ( const std::string &  filename,
const bool  open 
)

Create a GLO file reader for the given file.

Parameters
filenameThe file name to read from.
openIf true, the file will be opened on construction.

Member Function Documentation

◆ GetBoolean()

bool GetBoolean ( )
inline
Returns
A boolean value read from the GLO file.

◆ GetByte()

char GetByte ( )
inline
Returns
A single byte read from the GLO file.

◆ GetBytes()

void GetBytes ( const unsigned int  size,
char **  data 
)
inline

Read the specified number of bytes from the GLO file.

Parameters
sizeThe number of bytes to read.
dataA pointer to a valid memory region where the bytes will be copied.

◆ GetColor()

glsColor GetColor ( )
inline
Returns
A color read from the GLO file.

◆ GetDouble()

double GetDouble ( )
inline
Returns
A double read from the GLO file.

◆ GetFilename()

const std::string & GetFilename ( )
inline
Returns
The file name of this GLO file.

◆ GetFloat()

float GetFloat ( )
inline
Returns
A float read from the GLO file.

◆ GetGLStudioBuildNumber()

unsigned int GetGLStudioBuildNumber ( )
inline
Returns
The build version of the editor that generated this file.

◆ GetGLStudioVersionMajor()

unsigned int GetGLStudioVersionMajor ( )
inline
Returns
The major version of the editor that generated this file.

◆ GetGLStudioVersionMinor()

unsigned int GetGLStudioVersionMinor ( )
inline
Returns
The minor version of the editor that generated this file.

◆ GetInt()

int GetInt ( )
inline
Returns
An int read from the GLO file.

◆ GetMaterialIndices()

DynamicArray< int > GetMaterialIndices ( )
inline
Returns
A list of material indices read from the GLO file.

◆ GetNumberOfObjectRecords()

unsigned int GetNumberOfObjectRecords ( )
inline
Returns
The number of object records in this file.

◆ GetShort()

short GetShort ( )
inline
Returns
A short read from the GLO file.

◆ GetString()

std::string GetString ( const unsigned int  size)
inline

Read a string of the specified size from the file.

Parameters
sizeThe length in bytes to read.
Returns
The string that was read.

◆ GetTimestamp()

unsigned char * GetTimestamp ( )
inline
Returns
The timestamp of this file's creation.

◆ GetUnsignedByte()

unsigned char GetUnsignedByte ( )
inline
Returns
A single unsigned byte read from the GLO file.

◆ GetUnsignedInt()

unsigned int GetUnsignedInt ( )
inline
Returns
An unsigned int read from the GLO file.

◆ GetUnsignedShort()

unsigned short GetUnsignedShort ( )
inline
Returns
An unsigned short read from the GLO file.

◆ IsInitialized()

bool IsInitialized ( )
inline
Returns
True if the file is ready to be read.

◆ OpenForReading()

bool OpenForReading ( )

Open file and prepare to read.

Returns
True if the operation was successful.

Member Data Documentation

◆ GLO_SIZE_CACHING_LIMIT

const unsigned int GLO_SIZE_CACHING_LIMIT = 1024 * 1024
static

Do not bother caching GLO files that are larger than 1 MB.


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