VR-Exchange 2.6 API Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Libraries
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
include
broker
csvFileRdr.h
Go to the documentation of this file.
1
/****************************************************************************
2
* Copyright (c) 2016 VT MAK
3
* All rights reserved.
4
****************************************************************************/
5
9
10
#pragma once
11
12
#include <
broker/csvFileEntry.h
>
13
#include <vlutil/vlFilename.h>
14
#include <vl/hostStructs.h>
15
#include <fstream>
16
17
class
DtCsvFileReader
;
18
19
typedef
DtCsvFileReader
* (*DtCsvFileReaderCreatorFcn)();
20
26
class
DT_DLL_BROKER
DtCsvFileReader
27
{
28
public
:
29
31
static
DtCsvFileReader
* creator();
32
34
DtCsvFileReader
();
35
37
DtCsvFileReader
(
const
DtString
& fileName );
38
40
virtual
~
DtCsvFileReader
();
41
44
45
virtual
bool
openStream();
46
virtual
bool
openStream(
const
DtString
& fileName );
47
virtual
void
closeStream();
48
50
53
54
virtual
bool
isEOF()
const
;
55
virtual
bool
isOpen();
56
58
61
62
virtual
void
setFilename(
const
DtString
& name);
63
virtual
const
DtString
& filename()
const
;
64
66
67
// Used to read and parse the rest of the table.
68
// Derived Readers should create a derived DtCsvFileEntry
69
// and pass that into parseLine.
70
// The default simply reads a line and returns a generic
71
// DtCsvFileEntry, containing a list of token strings.
72
virtual
DtCsvFileEntry
* readAndParseNextLine(
73
DtCsvFileEntryCreatorFcn
pEntryCreatorFcn );
74
75
protected
:
76
78
virtual
bool
readLine(
DtString
& line );
79
81
virtual
void
parseLine(
DtCsvFileEntry
* pEntry,
DtString
& line );
82
83
private
:
84
85
// copy constructor
86
DtCsvFileReader
(
const
DtCsvFileReader
& orig );
87
88
// assignment operator
89
DtCsvFileReader
& operator = (
const
DtCsvFileReader
& orig );
90
91
protected
:
92
93
DtFilename
myFilename
;
94
std::ifstream
myInfile
;
95
96
};
Document ID: Generated on Wed Jan 30 18:15:18 EST 2019 from SVN revision 195534
Copyright © 2005-2019 VT MÄK. All Rights Reserved (
www.mak.com
)