![]() |
VR-Forces 4.0.4 Class Documentation
|
Using a DtReaderWriterFile allows a DtReaderWriter object to be read in from an MTL stream contained in an external file. More...

Public Member Functions | |
| DtReaderWriterFile () | |
| default constructor | |
| DtReaderWriterFile (const DtString &name, DtReaderWriterRegistry *parentRegistry=NULL) | |
| real constructor | |
| DtReaderWriterFile (const DtSymbolString &name, DtReaderWriterRegistry *parentRegistry=NULL) | |
| DtReaderWriterFile (const DtString &name, const DtReaderWriterFile &orig, DtReaderWriterRegistry *parentRegistry=NULL) | |
| copy constructor | |
| DtReaderWriterFile (const DtSymbolString &name, const DtReaderWriterFile &orig, DtReaderWriterRegistry *parentRegistry=NULL) | |
| DtReaderWriterFile & | operator= (const DtReaderWriterFile &orig) |
| assignment operator | |
| DtReaderWriterFile & | operator= (const DtFilename &orig) |
| virtual | ~DtReaderWriterFile () |
| destructor | |
| DtReaderWriterFile * | clone (const DtString &name, DtReaderWriterRegistry *parentRegistry=NULL) |
| clone | |
| DtReaderWriterFile * | clone (const DtSymbolString &name, DtReaderWriterRegistry *parentRegistry=NULL) |
| virtual void | getSelf (DtlObjPtr args, const DtFilename &searchPath, const DtVariableBindingsList &variableBindings) |
| Top level to read itself from an input stream. | |
| virtual void | saveFile (const DtFilename &filename) |
| Saves contents of file to specified filename. | |
| virtual void | loadFile (const DtFilename &searchPath, const DtVariableBindingsList &variableBindings, DtlObjStringMap *commentMap=NULL) |
| virtual void | putSelf (FILE *fp, int indentLevel, bool writeUnspecified, const DtFilename &path) |
| Top level call to write itself to file. | |
| virtual void | setObjectToReadAndWrite (DtReaderWriter *object) |
| Sets the DtReaderWriter to be read from and written to the file. | |
| virtual const DtReaderWriter & | objectToReadAndWrite () const |
| Returns the DtReaderWriter to be read from and written to the file. | |
| virtual void | setFilename (const DtString &filename) |
| Name of the file to to write. | |
| virtual void | setFilename (const DtString &filename, const DtString &unsubstitutedFilename) |
| Sets the filename in the same way as setFilename(const DtString& filename), but additionally sets the unsubstituted filename to the specified string. | |
| virtual const DtString & | filename () const |
| If variables are specified in the filename, they will be substituted with their values before being returned by this method. | |
| virtual DtString | unsubstitutedFilename () const |
| virtual void | setUnsubstitudedFilename (const DtString &f) |
| Sets the unsubsituted filename in the myFileame object. | |
| virtual const DtFilename & | filenameLastReadIn () const |
| Name of file most recently read in by getSelf() | |
| virtual void | setFileReadOnly (bool readOnly=true) |
| By default, DtReaderWriterFile reads a file that has been specified, but when it writes itself, it only writes the filename. | |
| virtual bool | fileReadOnly () const |
| virtual const char * | readerWriterType () const |
| Used to supply a string type that this reader writer type is. | |
| virtual void | substitute (const DtVariableBindingsList &variableBindings) |
| Substitutes any variables in the list to variable substituted filename. | |
Static Public Member Functions | |
| static const DtFilename & | appPath () |
| Gets the current working directory. Calls DtReaderWriter::appPath(). | |
Protected Member Functions | |
| bool | getFilenameToWrite (const DtFilename &path, const DtFilename &filename, DtFilename &filenameToWrite) const |
| Get the filename to write, given a path and base filename. | |
Protected Attributes | |
| DtRwString | myFilename |
| DtReaderWriter * | myObjectToReadAndWrite |
| bool | myFileReadOnly |
| DtFilename | myFilenameLastReadIn |
| DtString | myVariableSubstitutedFilename |
Using a DtReaderWriterFile allows a DtReaderWriter object to be read in from an MTL stream contained in an external file.
For instance, the signature object sensor uses a DtReaderWriterFile for its "combat-identification-level-table-file" parameter. Once the file is created, setObjectToReadAndWrite must be called before use.
default constructor
| DtReaderWriterFile::DtReaderWriterFile | ( | const DtString & | name, |
| DtReaderWriterRegistry * | parentRegistry = NULL |
||
| ) |
real constructor
| DtReaderWriterFile::DtReaderWriterFile | ( | const DtSymbolString & | name, |
| DtReaderWriterRegistry * | parentRegistry = NULL |
||
| ) |
| DtReaderWriterFile::DtReaderWriterFile | ( | const DtString & | name, |
| const DtReaderWriterFile & | orig, | ||
| DtReaderWriterRegistry * | parentRegistry = NULL |
||
| ) |
copy constructor
| DtReaderWriterFile::DtReaderWriterFile | ( | const DtSymbolString & | name, |
| const DtReaderWriterFile & | orig, | ||
| DtReaderWriterRegistry * | parentRegistry = NULL |
||
| ) |
| virtual DtReaderWriterFile::~DtReaderWriterFile | ( | ) | [virtual] |
destructor
| DtReaderWriterFile& DtReaderWriterFile::operator= | ( | const DtReaderWriterFile & | orig | ) |
assignment operator
Reimplemented in DtReaderWriterFileExtensible.
| DtReaderWriterFile& DtReaderWriterFile::operator= | ( | const DtFilename & | orig | ) |
Reimplemented in DtReaderWriterFileExtensible.
| DtReaderWriterFile* DtReaderWriterFile::clone | ( | const DtString & | name, |
| DtReaderWriterRegistry * | parentRegistry = NULL |
||
| ) |
clone
| DtReaderWriterFile* DtReaderWriterFile::clone | ( | const DtSymbolString & | name, |
| DtReaderWriterRegistry * | parentRegistry = NULL |
||
| ) |
| virtual void DtReaderWriterFile::getSelf | ( | DtlObjPtr | args, |
| const DtFilename & | searchPath, | ||
| const DtVariableBindingsList & | variableBindings | ||
| ) | [virtual] |
Top level to read itself from an input stream.
searchPath is the name of the directory in which to locate it's filename to load.
| virtual void DtReaderWriterFile::saveFile | ( | const DtFilename & | filename | ) | [virtual] |
Saves contents of file to specified filename.
| virtual void DtReaderWriterFile::loadFile | ( | const DtFilename & | searchPath, |
| const DtVariableBindingsList & | variableBindings, | ||
| DtlObjStringMap * | commentMap = NULL |
||
| ) | [virtual] |
Reimplemented in DtReaderWriterFileExtensible.
| virtual void DtReaderWriterFile::putSelf | ( | FILE * | fp, |
| int | indentLevel, | ||
| bool | writeUnspecified, | ||
| const DtFilename & | path | ||
| ) | [virtual] |
Top level call to write itself to file.
The path prepended to the filename before writing the entry to file.
Reimplemented from DtReaderWriter.
| virtual void DtReaderWriterFile::setObjectToReadAndWrite | ( | DtReaderWriter * | object | ) | [virtual] |
Sets the DtReaderWriter to be read from and written to the file.
| virtual const DtReaderWriter& DtReaderWriterFile::objectToReadAndWrite | ( | ) | const [virtual] |
Returns the DtReaderWriter to be read from and written to the file.
| static const DtFilename& DtReaderWriterFile::appPath | ( | ) | [static] |
Gets the current working directory. Calls DtReaderWriter::appPath().
Reimplemented from DtReaderWriter.
| virtual void DtReaderWriterFile::setFilename | ( | const DtString & | filename | ) | [virtual] |
Name of the file to to write.
If path is absolute, this is the filename that will be written in putSelf(). If filename is relative, it will be combined with the path passed into putSelf(). If variables are specified in the filename, they will be substituted with their values before being returned by this method. This sets both the full filename and the unsubstituted filename to this string, essentially removing any variables.
| virtual void DtReaderWriterFile::setFilename | ( | const DtString & | filename, |
| const DtString & | unsubstitutedFilename | ||
| ) | [virtual] |
Sets the filename in the same way as setFilename(const DtString& filename), but additionally sets the unsubstituted filename to the specified string.
| virtual const DtString& DtReaderWriterFile::filename | ( | ) | const [virtual] |
If variables are specified in the filename, they will be substituted with their values before being returned by this method.
Use unsubstitutedFilename() to get the string with variables still in it.
| virtual DtString DtReaderWriterFile::unsubstitutedFilename | ( | ) | const [virtual] |
| virtual void DtReaderWriterFile::setUnsubstitudedFilename | ( | const DtString & | f | ) | [virtual] |
Sets the unsubsituted filename in the myFileame object.
| virtual const DtFilename& DtReaderWriterFile::filenameLastReadIn | ( | ) | const [virtual] |
Name of file most recently read in by getSelf()
| virtual void DtReaderWriterFile::setFileReadOnly | ( | bool | readOnly = true | ) | [virtual] |
By default, DtReaderWriterFile reads a file that has been specified, but when it writes itself, it only writes the filename.
If you want it to write not only the filename but also write the 'objectToReadAndWrite', call setFileReadOnly(false).
| virtual bool DtReaderWriterFile::fileReadOnly | ( | ) | const [virtual] |
| virtual const char* DtReaderWriterFile::readerWriterType | ( | ) | const [virtual] |
Used to supply a string type that this reader writer type is.
This can be used in place of dynamic-casting. Also used by the opd editor to determine which type of control to create
Reimplemented from DtReaderWriter.
| virtual void DtReaderWriterFile::substitute | ( | const DtVariableBindingsList & | variableBindings | ) | [virtual] |
Substitutes any variables in the list to variable substituted filename.
Reimplemented in DtReaderWriterFileExtensible.
| bool DtReaderWriterFile::getFilenameToWrite | ( | const DtFilename & | path, |
| const DtFilename & | filename, | ||
| DtFilename & | filenameToWrite | ||
| ) | const [protected] |
Get the filename to write, given a path and base filename.
If filename is absolute, sets filenameToWrite to filename and returns true. If filename is relative, combines the path with the filename, creating the directory if necessary.
DtRwString DtReaderWriterFile::myFilename [protected] |
DtReaderWriter* DtReaderWriterFile::myObjectToReadAndWrite [protected] |
bool DtReaderWriterFile::myFileReadOnly [protected] |
DtFilename DtReaderWriterFile::myFilenameLastReadIn [protected] |