GnuCash
5.6-150-g038405b370+
gnucash
import-export
csv-imp
gnc-tokenizer-csv.hpp
Go to the documentation of this file.
1
/********************************************************************\
2
* gnc-tokenizer-csv.hpp - takes a csv file and converts it into a *
3
* two-dimensional vector of strings (table)*
4
* *
5
* This program is free software; you can redistribute it and/or *
6
* modify it under the terms of the GNU General Public License as *
7
* published by the Free Software Foundation; either version 2 of *
8
* the License, or (at your option) any later version. *
9
* *
10
* This program is distributed in the hope that it will be useful, *
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13
* GNU General Public License for more details. *
14
* *
15
* You should have received a copy of the GNU General Public License*
16
* along with this program; if not, contact: *
17
* *
18
* Free Software Foundation Voice: +1-617-542-5942 *
19
* 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
20
* Boston, MA 02110-1301, USA gnu@gnu.org *
21
\********************************************************************/
22
34
#ifndef GNC_CSV_TOKENIZER_HPP
35
#define GNC_CSV_TOKENIZER_HPP
36
37
#include <config.h>
38
39
#include <iostream>
40
#include <fstream>
// fstream
41
#include <vector>
42
#include <string>
43
#include "
gnc-tokenizer.hpp
"
44
45
class
GncCsvTokenizer
:
public
GncTokenizer
46
{
47
public
:
48
GncCsvTokenizer
() =
default
;
// default constructor
49
GncCsvTokenizer
(
const
GncCsvTokenizer
&) =
default
;
// copy constructor
50
GncCsvTokenizer
& operator=(
const
GncCsvTokenizer
&) =
default
;
// copy assignment
51
GncCsvTokenizer
(
GncCsvTokenizer
&&) =
default
;
// move constructor
52
GncCsvTokenizer
& operator=(
GncCsvTokenizer
&&) =
default
;
// move assignment
53
~
GncCsvTokenizer
() =
default
;
// destructor
54
55
void
set_separators(
const
std::string& separators);
56
int
tokenize()
override
;
57
58
private
:
59
std::string m_sep_str =
","
;
60
};
61
62
#endif
gnc-tokenizer.hpp
Class convert a file into vector of string vectors.
GncCsvTokenizer
Definition:
gnc-tokenizer-csv.hpp:45
GncTokenizer
Definition:
gnc-tokenizer.hpp:57
Generated by
1.8.14