28 lines
565 B
C++
Raw Normal View History

2017-01-20 14:36:52 +01:00
#pragma once
2016-01-06 01:23:43 +01:00
namespace Utils
{
class CSV
{
public:
CSV() { }
2018-12-17 14:29:18 +01:00
CSV(const std::string& file, bool isFile = true, bool allowComments = true);
2016-01-06 01:23:43 +01:00
~CSV();
int getRows();
int getColumns();
int getColumns(size_t row);
2016-01-06 01:23:43 +01:00
std::string getElementAt(size_t row, size_t column);
2016-01-06 01:23:43 +01:00
2017-04-04 22:35:30 +02:00
bool isValid() { return this->valid; }
2016-01-06 01:23:43 +01:00
private:
bool valid = false;
std::vector<std::vector<std::string>> dataMap;
2016-01-06 01:23:43 +01:00
2018-12-17 14:29:18 +01:00
void parse(const std::string& file, bool isFile = true, bool allowComments = true);
void parseRow(const std::string& row, bool allowComments = true);
2016-01-06 01:23:43 +01:00
};
}