Tulip  4.7.0
Better Visualization Through Research
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Groups Pages
CSVContentHandler.h
1 /*
2  *
3  * This file is part of Tulip (www.tulip-software.org)
4  *
5  * Authors: David Auber and the Tulip development Team
6  * from LaBRI, University of Bordeaux
7  *
8  * Tulip is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU Lesser General Public License
10  * as published by the Free Software Foundation, either version 3
11  * of the License, or (at your option) any later version.
12  *
13  * Tulip is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16  * See the GNU General Public License for more details.
17  *
18  */
19 ///@cond DOXYGEN_HIDDEN
20 #ifndef CSVCONTENTHANDLER_H_
21 #define CSVCONTENTHANDLER_H_
22 
23 #include <string>
24 #include <vector>
25 
26 #include <tulip/tulipconf.h>
27 
28 namespace tlp {
29 /**
30  * @brief Interface to inherit to get and treat data from csv files with CSVParser object.
31  */
32 class TLP_QT_SCOPE CSVContentHandler {
33 public:
34  virtual ~CSVContentHandler() {
35 
36  }
37  /**
38  * Function called at the beginning of the file parsing.
39  */
40  virtual void begin() = 0;
41 
42  /**
43  * Function called for each line in the file.
44  * @param row The number of the row.
45  * @param lineTokens The tokens.
46  */
47  virtual void line(unsigned int row,const std::vector<std::string>& lineTokens) = 0;
48 
49  /**
50  * Function called at the end of the parsing.
51  * @param rowNumber the number of row read in the file.
52  * @param columnNumber The column number for the line with the greatest column number.
53  */
54  virtual void end(unsigned int rowNumber, unsigned int columnNumber) = 0;
55 };
56 }
57 #endif /* CSVCONTENTHANDLER_H_ */
58 ///@endcond