FileIO class public functions
Other functions are inherited from fstream which is a
build-in C++ class for file I/O.
- FileIO(const char* filename, int state);
- Opens the specified file for reading or writing according to the
state flag:
- ios::in open file in input mode.
- ios::out open file in output mode.
- void readBigEndian(char& aNumber);
void readBigEndian(uchar& aNumber);
void readBigEndian(short& aNumber);
void readBigEndian(ushort& aNumber);
void readBigEndian(long& aNumber);
void readBigEndian(ulong& aNumber);
void readBigEndian(int& aNumber);
void readBigEndian(uint& aNumber);
void readBigEndian(float& aNumber);
void readBigEndian(double& aNumber);
- Reads the data type from a file in big endian form; that is,
with the most significant byte of the data type first.
- void readLittleEndian(char& aNumber);
void readLittleEndian(uchar& aNumber);
void readLittleEndian(short& aNumber);
void readLittleEndian(ushort& aNumber);
void readLittleEndian(long& aNumber);
void readLittleEndian(ulong& aNumber);
void readLittleEndian(int& aNumber);
void readLittleEndian(uint& aNumber);
void readLittleEndian(float& aNumber);
void readLittleEndian(double& aNumber);
- Reads the data type from a file in little endian form; that is,
with the least significant byte of the data type first.
- void readMachineEndian(char& aNumber);
void readMachineEndian(uchar& aNumber);
void readMachineEndian(short& aNumber);
void readMachineEndian(ushort& aNumber);
void readMachineEndian(long& aNumber);
void readMachineEndian(ulong& aNumber);
void readMachineEndian(int& aNumber);
void readMachineEndian(uint& aNumber);
void readMachineEndian(float& aNumber);
void readMachineEndian(double& aNumber);
- Reads the data type from the file in the same endian as the
computer. Intel machines read in little-endian form,
while almost all other computers will read in big-endian form.
- void readNotMachineEndian(char& aNumber);
void readNotMachineEndian(uchar& aNumber);
void readNotMachineEndian(short& aNumber);
void readNotMachineEndian(ushort& aNumber);
void readNotMachineEndian(long& aNumber);
void readNotMachineEndian(ulong& aNumber);
void readNotMachineEndian(int& aNumber);
void readNotMachineEndian(uint& aNumber);
void readNotMachineEndian(float& aNumber);
void readNotMachineEndian(double& aNumber);
- Reads the data type from the file in the opposite endian of the
the computer. Intel machines will read in big-endian form with
this functions, while almost all other computers will read
in little-endian form with this function.
- void writeBigEndian(char aNumber);
void writeBigEndian(uchar aNumber);
void writeBigEndian(short aNumber);
void writeBigEndian(ushort aNumber);
void writeBigEndian(long aNumber);
void writeBigEndian(ulong aNumber);
void writeBigEndian(int aNumber);
void writeBigEndian(uint aNumber);
void writeBigEndian(float aNumber);
void writeBigEndian(double aNumber);
- Writes the specified data type in big-endian form.
- void writeLittleEndian(char aNumber);
void writeLittleEndian(uchar aNumber);
void writeLittleEndian(short aNumber);
void writeLittleEndian(ushort aNumber);
void writeLittleEndian(long aNumber);
void writeLittleEndian(ulong aNumber);
void writeLittleEndian(int aNumber);
void writeLittleEndian(uint aNumber);
void writeLittleEndian(float aNumber);
void writeLittleEndian(double aNumber);
- Writes the specified data type in little-endian form.
- void writeMachineEndian(char aNumber);
void writeMachineEndian(uchar aNumber);
void writeMachineEndian(short aNumber);
void writeMachineEndian(ushort aNumber);
void writeMachineEndian(long aNumber);
void writeMachineEndian(ulong aNumber);
void writeMachineEndian(int aNumber);
void writeMachineEndian(uint aNumber);
void writeMachineEndian(float aNumber);
void writeMachineEndian(double aNumber);
- Writes the specified data type in machine-endian form.
- void writeNotMachineEndian(char aNumber);
void writeNotMachineEndian(uchar aNumber);
void writeNotMachineEndian(short aNumber);
void writeNotMachineEndian(ushort aNumber);
void writeNotMachineEndian(long aNumber);
void writeNotMachineEndian(ulong aNumber);
void writeNotMachineEndian(int aNumber);
void writeNotMachineEndian(uint aNumber);
void writeNotMachineEndian(float aNumber);
void writeNotMachineEndian(double aNumber);
- Writes the specified data type in the opposite endian from
machine-endian form.