bitsim
Model, simulate, estimate and control robots in C++
Loading...
Searching...
No Matches
csv_file_reader.h
Go to the documentation of this file.
1#ifndef BITSIM_UTILS_IO_CSV_FILE_READER_H
2#define BITSIM_UTILS_IO_CSV_FILE_READER_H
3
6
7#include <string>
8#include <vector>
9
10namespace bitsim
11{
12namespace utils
13{
14namespace io
15{
16
21{
22 public:
26 static std::string default_delimeter() { return ","; }
27
31 CSVFileReader(const std::string &file_path,
32 const std::string delimeter = CSVFileReader::default_delimeter());
33
38
44 std::vector<std::string> read_line();
45
50 std::vector<uint_t> read_line_as_uint();
51
52 private:
56 const std::string delimeter_;
57
61 uint_t current_row_idx_;
62};
63
64} // namespace io
65} // namespace utils
66} // namespace bitsim
67#endif // BITSIM_UTILS_IO_CSV_FILE_READER_H
The basic types of bitsim. Code outside this file names Eigen's matrix and vector types only through ...
std::vector< std::string > read_line()
Read a line from the file, split at the delimiter. The file must be open. Lines that start with # are...
Definition csv_file_reader.cpp:21
static std::string default_delimeter()
The default column delimiter.
Definition csv_file_reader.h:26
std::vector< uint_t > read_line_as_uint()
read_line_as_uint. Read the line as uint
Definition csv_file_reader.cpp:53
~CSVFileReader()
Destructor. Close the file if it is empty.
Definition csv_file_reader.cpp:19
CSVFileReader(const std::string &file_path, const std::string delimeter=CSVFileReader::default_delimeter())
Constructor.
Definition csv_file_reader.cpp:14
FileReaderBase(const std::string &file_name, FileFormats::Type t)
Constructor.
Definition file_reader_base.cpp:15
Definition csv_file_reader.cpp:12
Definition bitsim_utils.h:11
Definition dc_motor_backend_base.h:9
std::size_t uint_t
uint_t
Definition bitsim_types.h:40