iw4x-client/src/Utils/CSV.hpp

28 lines
536 B
C++
Raw Normal View History

2017-01-20 08:36:52 -05:00
#pragma once
2016-01-05 19:23:43 -05:00
namespace Utils
{
class CSV
{
public:
CSV() { }
CSV(std::string file, bool isFile = true, bool allowComments = true);
2016-01-05 19:23:43 -05:00
~CSV();
int getRows();
int getColumns();
int getColumns(size_t row);
2016-01-05 19:23:43 -05:00
std::string getElementAt(size_t row, size_t column);
2016-01-05 19:23:43 -05:00
2017-04-04 16:35:30 -04:00
bool isValid() { return this->valid; }
2016-01-05 19:23:43 -05:00
private:
2017-04-04 16:35:30 -04:00
bool valid;
std::vector<std::vector<std::string>> dataMap;
2016-01-05 19:23:43 -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
};
}