#include <BxBinaryFile.h>
Inheritance diagram for BxBinaryFile:

Public Member Functions | |
| BxBinaryFile () | |
| long | getFileSize () |
| long | getFilePos () |
| void | setFilename (char *filename) |
| void | copyFilename (const char *filename) |
Static Public Member Functions | |
| BxByteOrder | calcMemoryByteOrder () |
| void | reverseBytes (byte *buffer, int numBytes) |
|
|
Default constructor. Constructs an instance of the class BxBinaryFile. Default attribute values are assigned as follows:
f_ = NULL;
readonly_ = false;
filename_ = NULL;
datasetptr_ = NULL;
memByteOrder_ = BIG_ENDIAN or LITTLE_ENDIAN,
depending on the byte order of the current host machine
|
|
|
Determine the memory byte order for the executing host machine.
Determine whether the memory system on the executing host machine uses BIG_ENDIAN or LITTLE_ENDIAN byte order.
|
|
|
Set the filename attribute by copying a specified string.
If the filename has been previously set, the memory allocated to the old string in released before a new string is assigned. Memory is allocated for a new string and the string value is copied from the input string. The caller is responsible for releasing memory allocated for the input parameter when that string is not longer needed.
pBinaryFile->copyFilename("dummy.dat");
char * filename = new char[20];
strcpy(filename, "dummy.dat");
pBinaryFile->copyFilename(filename);
...
...
delete[] filename;
|
|
|
Get the current file pointer (absolute) position. Returns the current absolute byte offset in the binary file. The file must be open for reading or writing.
|
|
|
Get the size of the binary file in bytes. The current file pointer position is maintained by this method.
|
|
||||||||||||
|
Convert a byte stream from big-endian to little-endian or vice versa.
Bytes within the input parameter buffer are converted from one byte ordering to the other. The reverse-ordered result is placed in the input buffer, destroying the previous contents of the input buffer.
|
|
|
Set or reset the filename attribute to a specified string.
If the filename has been previously set, the memory allocated to the old string in released before a new string is assigned.
char * filename = new char[20];
strcpy(filename, "dummy.dat");
pBinaryFile->setFilename(filename);
... ...
|
1.3.3