2017-01-20 08:36:52 -05:00
|
|
|
#pragma once
|
|
|
|
|
2016-01-05 19:23:43 -05:00
|
|
|
namespace Utils
|
|
|
|
{
|
|
|
|
class CSV
|
|
|
|
{
|
|
|
|
public:
|
2016-02-06 07:37:23 -05:00
|
|
|
CSV(std::string file, bool isFile = true, bool allowComments = true);
|
2016-01-05 19:23:43 -05:00
|
|
|
~CSV();
|
|
|
|
|
2016-11-20 08:09:07 -05:00
|
|
|
int getRows();
|
|
|
|
int getColumns();
|
|
|
|
int getColumns(size_t row);
|
2016-01-05 19:23:43 -05:00
|
|
|
|
2016-11-20 08:09:07 -05:00
|
|
|
std::string getElementAt(size_t row, size_t column);
|
2016-01-05 19:23:43 -05:00
|
|
|
|
|
|
|
private:
|
2016-11-20 08:09:07 -05:00
|
|
|
std::vector<std::vector<std::string>> dataMap;
|
2016-01-05 19:23:43 -05:00
|
|
|
|
2016-11-20 08:09:07 -05:00
|
|
|
void parse(std::string file, bool isFile = true, bool allowComments = true);
|
|
|
|
void parseRow(std::string row, bool allowComments = true);
|
2016-01-05 19:23:43 -05:00
|
|
|
};
|
|
|
|
}
|