Alientech 0.01
An extendable game engine
alien::utils Namespace Reference

Classes

class  ACHDirectory
 Describes a directory in a CargoHold object. More...
class  ACHFile
 Describes a file in a CargoHold object. More...
class  AlienCargoHold
 Main class containing everything needed to load and read from a Cargo Hold Packed file. More...

Functions

string ACHreadName (ifstream *file)
 Reads a name from a CargoHold file A name is defined as an unsigned character determining the length of the string followed by a null terminated string of characters.
int ACHreadInt (ifstream *file)
 Reads an integer from a CargoHold file.
unsigned ACHreadUnsigned (ifstream *file)
 Reads an unsigned integer from a CargoHold file.
bool ACHisAFile (string path)
 Checks if the provided internal path has subdirectories or not.
string ACHgrabFirstSubdir (string path)
 Returns the first subdirectory or file name in a path.
string ACHstripFirstSubdir (string path)
 Strips the first subdirectory of the given path.
string readName (ifstream *file)
 Reads a name from a CargoHold file A name is defined as an unsigned character determining the length of the string followed by a null terminated string of characters.
int readInt (ifstream *file)
 Reads an integer from a CargoHold file.
unsigned readUnsigned (ifstream *file)
 Reads an unsigned integer from a CargoHold file.

Function Documentation

string alien::utils::ACHgrabFirstSubdir ( string  path)

Returns the first subdirectory or file name in a path.

Parameters:
paththe path
Returns:
the string up to the first occurance of a / character

Definition at line 32 of file ACHCommonUtils.cpp.

bool alien::utils::ACHisAFile ( string  path)

Checks if the provided internal path has subdirectories or not.

Parameters:
paththe path
Returns:
has subdirectories - false; just a file - true

Definition at line 27 of file ACHCommonUtils.cpp.

int alien::utils::ACHreadInt ( ifstream *  file)

Reads an integer from a CargoHold file.

Parameters:
fileA pointer to the file object

Definition at line 13 of file ACHCommonUtils.cpp.

string alien::utils::ACHreadName ( ifstream *  file)

Reads a name from a CargoHold file A name is defined as an unsigned character determining the length of the string followed by a null terminated string of characters.

Parameters:
fileA pointer to the file object

Definition at line 4 of file ACHCommonUtils.cpp.

unsigned alien::utils::ACHreadUnsigned ( ifstream *  file)

Reads an unsigned integer from a CargoHold file.

Parameters:
fileA pointer to the file object

Definition at line 20 of file ACHCommonUtils.cpp.

string alien::utils::ACHstripFirstSubdir ( string  path)

Strips the first subdirectory of the given path.

Parameters:
paththe path
Returns:
the path minus the first subdirectory

Note: this function assumes that the path is not a file (that is, there is at least one / character in it)

Definition at line 41 of file ACHCommonUtils.cpp.

int alien::utils::readInt ( ifstream *  file)

Reads an integer from a CargoHold file.

Parameters:
fileA pointer to the file object

Definition at line 13 of file ACHCommonUtils.cpp.

string alien::utils::readName ( ifstream *  file)

Reads a name from a CargoHold file A name is defined as an unsigned character determining the length of the string followed by a null terminated string of characters.

Parameters:
fileA pointer to the file object

Definition at line 4 of file ACHCommonUtils.cpp.

unsigned alien::utils::readUnsigned ( ifstream *  file)

Reads an unsigned integer from a CargoHold file.

Parameters:
fileA pointer to the file object

Definition at line 20 of file ACHCommonUtils.cpp.