CSVReader.h 717 B

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef CSVREADER_H
  2. #define CSVREADER_H
  3. #include <string>
  4. #include <vector>
  5. #include <fstream>
  6. /*
  7. * Ließt eine CSV Datei
  8. */
  9. class CSVReader
  10. {
  11. private:
  12. std::ifstream stream; // Der Stream, mit dem die Datei gelesen wird
  13. int byteCount; // Die Anzahl der Bytes in der Datei
  14. public:
  15. // Erstellt den Leser
  16. // path: Der Pfad der CSV Datei
  17. CSVReader(std::string path);
  18. // Gibt die nächste Zeile der CSV Datei zurück
  19. std::vector<std::string>getNextRow();
  20. // Gibt true zurück, falls es noch eine Zeile gibt
  21. bool hasNext() const;
  22. // Gibt den Fortschritt des lesens in Prozent zurück
  23. int getProgress();
  24. };
  25. #endif // CSVREADER_H