![]() |
VR-Forces 4.1 Class Documentation
|
The getSelf() and getData() member functions read data from a file.
The getSelf() member function works similarly to putSelf(), except that it operates on an MTL stream instead of an open file pointer.
VR-Forces opens, reads, and converts the file being read into an MTL stream. The following example shows how to open an MTL file:
The getData() specification is:
Example RD-1 illustrates the getData() member function for DtRwString.
Example RD-1
Suppose that the "args" DtlObjPtr in Example 14.2 points to the LISP expression:
The "car" of this expression (retrieved with DtcCar(args)) is name (no parentheses) and the "cdr" (DtcCdr(args)) of the expression is ("dataString"). You do not need the name. (getSelf() will have grabbed it if the object was created without a name.) The local variable dataList is set to point to the list of data arguments. (In this case, there is only one element in the list.) The "car" of this expression is the data we want, and the "cdr" of this expression gets returned.
Example RD-2 shows an excerpt of a getData() call for an arbitrary list of numbers (from DtNLengthIntegerVector).
Example RD-2
[<< Writing Data to a File] [Home] [Top of Page] [Multiple Inheritance and DtReaderWriter >>]