im.binfile

\file \brief Binary File Access.

See Copyright Notice in im_lib.d

Members

Aliases

imBinFile
alias imBinFile = _imBinFile
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
imBinMemoryFileName
alias imBinMemoryFileName = _imBinMemoryFileName
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.

Enums

imBinFileModule
enum imBinFileModule

Predefined I/O Modules. * \ingroup binfile

Functions

imBinFileByteOrder
int imBinFileByteOrder(imBinFile* bfile, int pByteOrder)

Changes the file byte order. Returns the old one. * \ingroup binfile

imBinFileClose
void imBinFileClose(imBinFile* bfile)

Closes the file. * \ingroup binfile

imBinFileEndOfFile
int imBinFileEndOfFile(imBinFile* bfile)

Indicates that the file pointer is at the end of the file. * \ingroup binfile

imBinFileError
int imBinFileError(imBinFile* bfile)

Indicates that was an error on the last operation. * \ingroup binfile

imBinFileNew
imBinFile* imBinFileNew(const(char)* pFileName)

Creates a new binary file for writing. * The default file byte order is the CPU byte order. * Returns NULL if failed. * \ingroup binfile

imBinFileOpen
imBinFile* imBinFileOpen(const(char)* pFileName)

Opens an existant binary file for reading. * The default file byte order is the CPU byte order. * Returns NULL if failed. * \ingroup binfile

imBinFilePrintf
ulong imBinFilePrintf(imBinFile* bfile, const(char)* format, ...)

Writes a string without the NULL terminator. The function uses sprintf to compose the string. \n * The internal buffer is fixed at 4096 bytes. \n * Returns the actual count of values writen. * \ingroup binfile

imBinFileRead
ulong imBinFileRead(imBinFile* bfile, void* pValues, ulong pCount, int pSizeOf)

Reads an array of count values with byte sizes: 1, 2, 4, or 8. And invert the byte order if necessary after read. \n * Returns the actual count of values read. * \ingroup binfile

imBinFileReadInteger
int imBinFileReadInteger(imBinFile* handle, int* value)

Reads an integer number from the current position until found a non integer character. * Returns a non zero value if sucessfull. * \ingroup binfile

imBinFileReadLine
int imBinFileReadLine(imBinFile* handle, char* comment, int* size)

Reads a line until line break. \n * Returns the line in array, must have room enough. Line break is discarted. \n * Use *size to inform buffer size. *size return the actual number os characters read. * \ingroup binfile

imBinFileReadReal
int imBinFileReadReal(imBinFile* handle, double* value)

Reads an floating point number from the current position until found a non number character. * Returns a non zero value if sucessfull. * \ingroup binfile

imBinFileSeekFrom
void imBinFileSeekFrom(imBinFile* bfile, long pOffset)

Moves the file pointer from the end of the file.\n * The offset is usually a negative value. * \ingroup binfile

imBinFileSeekOffset
void imBinFileSeekOffset(imBinFile* bfile, long pOffset)

Moves the file pointer from current position.\n * If the offset is a negative value the pointer moves backwards. * \ingroup binfile

imBinFileSeekTo
void imBinFileSeekTo(imBinFile* bfile, ulong pOffset)

Moves the file pointer from the begining of the file.\n * When writing to a file seeking can go beyond the end of the file. * \ingroup binfile

imBinFileSetCurrentModule
int imBinFileSetCurrentModule(int pModule)

Sets the current I/O module. * \returns the previous function set, or -1 if failed. * See also \ref imBinFileModule. * \ingroup binfile

imBinFileSize
ulong imBinFileSize(imBinFile* bfile)

Returns the file size in bytes. * \ingroup binfile

imBinFileSkipLine
int imBinFileSkipLine(imBinFile* handle)

Skips a line, including line break. * \ingroup binfile

imBinFileTell
ulong imBinFileTell(imBinFile* bfile)

Returns the current offset position. * \ingroup binfile

imBinFileWrite
ulong imBinFileWrite(imBinFile* bfile, void* pValues, ulong pCount, int pSizeOf)

Writes an array of values with sizes: 1, 2, 4, or 8. And invert the byte order if necessary before write.\n * <b>ATENTION</b>: The function will not make a temporary copy of the values to invert the byte order.\n * So after the call the values will be invalid, if the file byte order is diferent from the CPU byte order. \n * Returns the actual count of values writen. * \ingroup binfile

imBinMemoryRelease
void imBinMemoryRelease(ubyte* buffer)

Release the internal memory allocated when writing a Memory File (see \ref imBinMemoryFileName). * \ingroup binfile

Structs

_imBinFile
struct _imBinFile

\brief Binary File Structure (Private). * \ingroup binfile

_imBinMemoryFileName
struct _imBinMemoryFileName

\brief Memory File Filename Parameter Structure * * \par * Fake file name for the memory I/O module. * \ingroup binfile

Meta