You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
767 B

1 year ago
  1. #pragma once
  2. #include <fstream>
  3. #include <functional>
  4. #include <iostream>
  5. #include <list>
  6. #include <map>
  7. #include <memory>
  8. #include <set>
  9. #include <sstream>
  10. #include <string>
  11. #include <vector>
  12. namespace iflytop {
  13. using namespace std;
  14. class ZCSVCell {
  15. public:
  16. int rowNum;
  17. int colNum;
  18. string data;
  19. };
  20. class ZCSV {
  21. private:
  22. list<ZCSVCell> csvData;
  23. int m_maxRowNum = 0;
  24. int m_maxColNum = 0;
  25. public:
  26. ZCSV();
  27. bool parseCSV(string filename);
  28. void setdata(int rowNum, int colNum, string data);
  29. string getdata(int rowNum, int colNum);
  30. int maxRowNum() { return m_maxRowNum; }
  31. int maxColNum() { return m_maxColNum; }
  32. void dumpCSV(string filename);
  33. private:
  34. ZCSVCell* findCell(int rowNum, int colNum);
  35. };
  36. } // namespace iflytop