#include <BinaryIO.h>
Public Types | |
enum | MODE { READ, WRITE } |
Public Member Functions | |
BinaryIO (void) | |
BinaryIO (const std::string &fn, MODE m) | |
~BinaryIO (void) | |
const std::string & | getName (void) const |
bool | is_open (void) const |
bool | is_std (void) const |
unsigned long | getPos (void) const |
bool | eof (void) const |
void | open (const std::string &fn, MODE m) |
void | close (void) |
BYTE | read8 (void) |
UWORD16 | read16_le (void) |
UWORD16 | read16_be (void) |
UWORD32 | read32_le (void) |
UWORD32 | read32_be (void) |
UWORD32 | read_le (unsigned short n) |
std::string | readstring (unsigned int len) |
void | write8 (BYTE val) |
void | write16_le (UWORD16 val) |
void | write16_be (UWORD16 val) |
void | write32_le (UWORD32 val) |
void | write32_be (UWORD32 val) |
void | write_le (UWORD32 val, unsigned short n) |
void | writestring (const std::string &s) |
FILE * | getStream (void) const |
Protected Member Functions | |
void | setStream (FILE *s) |
void | setName (const std::string &fn) |
MODE | getMode (void) const |
void | setMode (MODE m) |
Private Member Functions | |
void | init (void) |
void | set_open (bool o) |
void | checkForce (const std::string &fn) const |
bool | Fileexists (const std::string &fn) const |
Private Attributes | |
std::string | Name |
FILE * | Stream |
bool | FileOpen |
MODE | Mode |
|
|
|
|
|
construct a BinaryIO object
|
|
|
|
when opening a file in write mode perform various checks depending on the value of the force argument |
|
close the currently open file - it is save to call close() even if is_std() is true |
|
is the current state of this file at the end of the file |
|
check if the file described by fn exists
|
|
|
|
get the name (with path) of this file |
|
get the current position in the current file |
|
get the underlying cstdio FILE* pointer |
|
|
|
is this file currently opened ? |
|
is this file a standard stream (stdin or stdout) ? |
|
open the file given by fn in the mode m
|
|
read two bytes from the file using big-endian byte ordering |
|
read two bytes from the file using little-endian byte ordering |
|
read four bytes from the file using big-endian byte ordering |
|
read four bytes from the file using little-endian byte ordering |
|
read one byte from the file |
|
read n bytes (little endian byte ordering)
|
|
read a string with length len from the file |
|
|
|
|
|
|
|
|
|
write two bytes to the file using big-endian byte ordering |
|
write two bytes to the file using little-endian byte ordering |
|
write four bytes to the file using big-endian byte ordering |
|
write four bytes to the file using little-endian byte ordering |
|
write one byte to the file |
|
write n bytes of val (little endian byte ordering)
|
|
|
|
|
|
|
|
|
|
|