VR-Forces 4.6 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
tokenizer.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2017 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
11 
12 #pragma once
13 #include <vrfutil/vrfutilDefines.h>
14 
15 #include <fstream>
16 #include <string>
17 #include <vector>
18 
19 
20 
21 using namespace std;
22 
27 {
28 public:
29  DtTokenizer();
30  ~DtTokenizer();
31 
33  void setFilename( const string& filename );
35  void setStream( istream& stream );
36 
38  void setRecordSeparator( const string& separator );
39  void setFieldSeparators( const string& separators );
40  void setQuoteChars( const string& quoteChars );
41  void setEscapeChars( const string& escapeChars );
42  void setSeparatorData( const string& recordSeparator, const string& fieldSeparators = ",",
43  const string& quoteChars = "\"", const string& escapeChars = "\\" );
44 
46  void setTrimWhitespace( bool bTrim );
48  void setAddEmptyTokens( bool bAdd );
49 
51  void setSkipNextRecord( bool bSkip );
52 
56  bool nextRecord( vector<string>& record );
57 
58 protected:
60  virtual bool isEndOfRecord( const string& str );
61 
62 private:
64  void readRecord( string& record );
65 
68  string myQuoteChars;
69  string myEscapeChars;
70 
74 
75  ifstream myFileStream;
76  istream* pMyStream;
77 };
78 

Document ID: Generated on Thu Apr 12 03:15:37 EDT 2018 from SVN revision 187986
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)