The putSelf() and putData() member functions write data to a file, as follows:
-
Write an appropriate number of blanks based on indentLevel.
-
Write an open parenthesis.
-
Write the object name.
-
Call the putData() member function. The putData() member function is responsible for writing the data value or values for the object.
-
Tell the DtReaderWriter's registry (described later in this section) to put itself.
-
Write a final closing parenthesis.
The putData() member function is specified as:
virtual void putData(FILE *fp, int indentLevel = 0);
The following example shows the putData() member function for the DtRwString (rwString.h) class, provided by VR-Forces.
{
fprintf(fp, " \"%s\"", string());
}
[<< Readable, Writable Objects] [Home] [Top of Page] [Reading Data from a File >>]