GnuCash c935c2f+
Loading...
Searching...
No Matches
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
46{
47public:
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 void set_enable_escape(const bool enable);
57 int tokenize() override;
58
59private:
60 std::string m_sep_str = ",";
61
62 bool m_enable_escape = true;
63};
64
65#endif
Class convert a file into vector of string vectors.