a8/a8/csvreader.h
2018-08-26 20:34:01 +08:00

27 lines
527 B
C++

#ifndef A8_CSVREADER_H
#define A8_CSVREADER_H
namespace a8
{
class CsvReader
{
public:
CsvReader();
bool Load(const std::string& filename);
bool NextLine();
a8::XValue GetValue(const char* name);
a8::XValue GetValue(const std::string& name);
bool KeyExists(const std::string& name);
private:
std::map<std::string, int> columns_;
std::vector<std::string> values_;
int currline_ = 0;
a8::StringList stringlist_;
};
}
#endif