#include <dime/Input.h>
Public Member Functions | |
dimeInput () | |
~dimeInput () | |
bool | setFileHandle (FILE *fp) |
bool | setFile (const char *const filename) |
bool | setFilePointer (const int fd) |
bool | eof () const |
void | setCallback (int(*cb)(float, void *), void *cbdata) |
float | relativePosition () |
void | putBackGroupCode (const int32 code) |
bool | readGroupCode (int32 &code) |
bool | readInt8 (int8 &val) |
bool | readInt16 (int16 &val) |
bool | readInt32 (int32 &val) |
bool | readFloat (float &val) |
bool | readDouble (dxfdouble &val) |
const char * | readString () |
dimeModel * | getModel () |
dimeMemHandler * | getMemHandler () |
int | getFilePosition () const |
bool | isBinary () const |
int | getVersion () const |
bool | isAborted () const |
Friends | |
class | dimeModel |
|
Constructor. |
|
Destructor. |
|
Returns true if end of file is encountered. |
|
For ASCII files, it returns the current line number. For binary files the file position is returned. |
|
Returns the memory handler used in this model. |
|
Returns the model for this file. |
|
Returns the version of this file (10, 12, 13 or 14). |
|
This method returns wether file input was aborted or not. |
|
Returns true if this is a binary (DXB) file. |
|
This function is needed when a loader snoops for future group codes. It is possible to put back a single group code so that the next time dimeInput::readGroupCode() is called, the putback value will be returned. |
|
Reads a dxfdouble precision floating point number from the file. |
|
Reads a single precision floating point number from the file. |
|
Reads a group code from the file. In binary files, group codes are represented as a single byte, with the exception of extended data which has 255 as the first byte, and then the actual group code following as a 16-bit integer. |
|
Reads a 16 bit integer from the file. |
|
Reads a 32 bit integer from the file. |
|
Reads an 8 bit integer from the file. |
|
Returns a null-terminated string read from the file. The string is valid only until the next read operation, so you'd better copy it somewhere if you need it. |
|
Returns the relative file position. 0.0 means beginning of file, 1.0 is at end of file. |
|
This method sets a progress callback that will be called with a float in the range between 0 and 1, and void * cbdata as arguments. |
|
Opens the file 'filename' for reading. True is returned if the file is opened correctly. File will be closed in destructor. |
|
Sets the input data to the stream fp. must be a valid file/stream, and will not be closed in the destuctor. No progress information will be avilable during loading if this method is used. |
|
Sets the file pointer for this instance. newfd is a file opened with the unistd open() function. |