bitrl & cuberl Documentation
Simulation engine for reinforcement learning agents
Loading...
Searching...
No Matches
csv_file_reader.h
Go to the documentation of this file.
1#ifndef CSV_FILE_READER_H
2#define CSV_FILE_READER_H
3
4#include "bitrl/bitrl_types.h"
6
7#include <boost/noncopyable.hpp>
8#include <fstream>
9#include <string>
10#include <vector>
11
12namespace bitrl
13{
14namespace utils
15{
16namespace io
17{
18
23{
24 public:
28 static std::string default_delimeter() { return ","; }
29
33 CSVFileReader(const std::string &file_path,
34 const std::string delimeter = CSVFileReader::default_delimeter());
35
40
45 std::vector<std::string> read_line();
46
51 std::vector<uint_t> read_line_as_uint();
52
53 private:
57 const std::string delimeter_;
58
62 uint_t current_row_idx_;
63};
64
65} // namespace io
66} // namespace utils
67} // namespace bitrl
68#endif // CSV_FILE_READER_H
The CSVFileReader class.
Definition csv_file_reader.h:23
std::vector< std::string > read_line()
Read a line from the file. It attempts to open the file if the file is not already open.
Definition csv_file_reader.cpp:26
~CSVFileReader()
Destructor. Close the file if it is empty.
Definition csv_file_reader.cpp:24
std::vector< uint_t > read_line_as_uint()
read_line_as_uint. Read the line as uint
Definition csv_file_reader.cpp:60
static std::string default_delimeter()
The default column delimiter.
Definition csv_file_reader.h:28
Definition file_reader_base.h:25
OutT resolve(const std::string &name, const std::map< std::string, std::any > &input)
Definition std_map_utils.h:25
Definition bitrl_consts.h:14
std::size_t uint_t
uint_t
Definition bitrl_types.h:43