VR-Forces 5.0.3 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
DtObjectParser Class Reference

This class is the base class for parsing out creation information from various textual formats. It uses the DtTokenizer class to parse the text file into records and fields for those records. Derived parsers will define how the text file seperates those and how to extract the information from those records and their fields.

Inheritance diagram for DtObjectParser:
Inheritance graph
[legend]

Public Member Functions

 DtObjectParser ()
 
 ~DtObjectParser ()
 
virtual bool parseFile (const string &filename)
 
virtual bool parse (istream &stream)
 
virtual ObjectListgetCreateObjectList ()
 
virtual void initTypeMap (const std::map< std::string, std::string > &importData)
 
virtual ObjectEntityTypeMaptypeMap ()
 

Protected Member Functions

void setSeparatorData (const string &recordSeparator, const string &fieldSeparators, const string &quoteChars, const string &escapeChars)
 
virtual void clear ()
 

Protected Attributes

ObjectList myCreateObjectList
 
DtTokenizer myTokenizer
 
Coordinate_SystemmyCoordSystem
 
ObjectEntityTypeMap myTypeMap
 

Constructor & Destructor Documentation

DtObjectParser::DtObjectParser ( )
DtObjectParser::~DtObjectParser ( )

Member Function Documentation

virtual bool DtObjectParser::parseFile ( const string &  filename)
virtual

Pass in the file to parse, creates an istream and calls parse on it.

virtual bool DtObjectParser::parse ( istream &  stream)
inlinevirtual

Derived classes will set up the tokenizer and determine how extract field information for each record.

Reimplemented in DtAcoParser, DtCsvParser, and DtTleParser.

virtual ObjectList& DtObjectParser::getCreateObjectList ( )
virtual

Gets a vector containing all of the import objects that were created during parsing.

virtual void DtObjectParser::initTypeMap ( const std::map< std::string, std::string > &  importData)
virtual

Allows one to map their string names to our entity types.

Reimplemented in DtAcoParser.

virtual ObjectEntityTypeMap* DtObjectParser::typeMap ( )
virtual
void DtObjectParser::setSeparatorData ( const string &  recordSeparator,
const string &  fieldSeparators,
const string &  quoteChars,
const string &  escapeChars 
)
protected

Define how the each creation record and its fields are delimited. For example a csv parser would use ","s to delimit fields and "/n" to define records These are passed into the tokenzier class that will go thru and parse the file into record chunks the derived class will then disect to get the field information and turn each record into an createinformation struct that will later on be used to create the vrfobjects that will represent these records.

virtual void DtObjectParser::clear ( )
protectedvirtual

cleans up the object, called from DTor and before parsing

Member Data Documentation

ObjectList DtObjectParser::myCreateObjectList
protected

vector to keep track of all of the Aco Data that we have parsed

DtTokenizer DtObjectParser::myTokenizer
protected
Coordinate_System* DtObjectParser::myCoordSystem
protected
ObjectEntityTypeMap DtObjectParser::myTypeMap
protected

The documentation for this class was generated from the following file:

Document ID: Generated on Thu Jun 1 17:58:13 EDT 2023 from SVN revision 255404
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)