VR-Exchange 2.4 API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
brokers/ddsBroker/ddsBroker/csvFileRdr.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright (c) 2013 VT MAK
3  * All rights reserved.
4  ****************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <ddsBroker/dllExport.h>
13 #include <ddsBroker/csvFileEntry.h>
14 #include <vlutil/vlFilename.h>
15 #include <vl/hostStructs.h>
16 #include <fstream>
17 
18 class DtCsvFileReader;
19 
20 typedef DtCsvFileReader* (*DtCsvFileReaderCreatorFcn)();
21 
28 {
29 public:
30 
32  static DtCsvFileReader* creator();
33 
36 
38  DtCsvFileReader( const DtString& fileName );
39 
41  virtual ~DtCsvFileReader();
42 
45 
46  virtual bool openStream();
47  virtual bool openStream( const DtString& fileName );
48  virtual void closeStream();
49 
51 
54 
55  virtual bool isEOF() const;
56  virtual bool isOpen();
57 
59 
62 
63  virtual void setFilename(const DtString& name);
64  virtual const DtString& filename() const;
65 
67 
68  // Used to read and parse the rest of the table.
69  // Derived Readers should create a derived DtCsvFileEntry
70  // and pass that into parseLine.
71  // The default simply reads a line and returns a generic
72  // DtCsvFileEntry, containing a list of token strings.
73  virtual DtCsvFileEntry* readAndParseNextLine(
74  DtCsvFileEntryCreatorFcn pEntryCreatorFcn );
75 
76 protected:
77 
79  virtual bool readLine( DtString& line );
80 
82  virtual void parseLine( DtCsvFileEntry* pEntry, DtString& line );
83 
84 private:
85 
86  // copy constructor
87  DtCsvFileReader( const DtCsvFileReader& orig );
88 
89  // assignment operator
90  DtCsvFileReader& operator = ( const DtCsvFileReader& orig );
91 
92 protected:
93 
94  DtFilename myFilename;
95  std::ifstream myInfile;
96 
97 };

Document ID: Generated on Thu Jul 23 10:25:22 EDT 2015 from SVN revision 155065
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)