fw4spl
CsvIO.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2017.
3  * Distributed under the terms of the GNU Lesser General Public License (LGPL) as
4  * published by the Free Software Foundation.
5  * ****** END LICENSE BLOCK ****** */
6 
7 #ifndef __FWGDCMIO_HELPER_CSVIO_HPP__
8 #define __FWGDCMIO_HELPER_CSVIO_HPP__
9 
10 #include "fwGdcmIO/config.hpp"
11 
12 #include <iostream>
13 #include <string>
14 #include <vector>
15 
16 namespace fwGdcmIO
17 {
18 
19 namespace helper
20 {
21 
26 class FWGDCMIO_CLASS_API CsvIO
27 {
28 
29 public:
30 
36  FWGDCMIO_API CsvIO(std::istream& csvStream);
37 
39  FWGDCMIO_API virtual ~CsvIO();
40 
42  typedef std::vector< std::string > TokenContainerType;
43 
52  FWGDCMIO_API TokenContainerType getLine(const std::string& separator = ",");
53 
54 private:
55 
57  std::istream& m_stream;
58 };
59 
60 } // namespace helper
61 } // namespace fwGdcmIO
62 
63 #endif // __FWGDCMIO_HELPER_CSVIO_HPP__
64 
The namespace fwGdcmIO contains reader, writer and helper for dicom data.
std::vector< std::string > TokenContainerType
Containers to store parsed tokens.
Definition: CsvIO.hpp:42
Read CSV file and returns parsed tokens. The input file is supposed to use comma separator, but another separator can be used when reading file.
Definition: CsvIO.hpp:26