Tracore
FileIO.h
1 //
2 // Created by wrede on 19.04.16.
3 //
4 
5 #ifndef GBMOT_FILEIO_H
6 #define GBMOT_FILEIO_H
7 
8 #include <string>
9 #include <fstream>
10 #include <vector>
11 #include "../core/ObjectData.h"
12 #include "../graph/Definitions.h"
13 #include "../core/Tracklet.h"
14 
15 namespace util
16 {
17  typedef std::vector<std::vector<std::vector<double>>> Vector3d;
18  typedef std::vector<std::vector<double>> Vector2d;
19  typedef std::unordered_map<std::string, double> ValueMap;
20  typedef std::vector<ValueMap> ValueMapVector;
21 
25  class FileIO
26  {
27  public:
40  static void ReadCSV(Vector3d& values, const std::string& file_name, char delimiter);
41 
50  static void ReadCSV(Vector2d& values, const std::string& file_name, char delimiter);
51 
59  static void ListFiles(const std::string& folder, std::vector<std::string>& file_names,
60  bool sort = true);
61 
69  static void WriteCSVMatlab(DirectedGraph& graph, const std::string& file_name);
70 
80  static void WriteCSVMatlab(MultiPredecessorMap& map, Vertex& source, Vertex& sink,
81  const std::string& file_name);
82 
92  static void ReadCSV(ValueMapVector& values, const std::string& file_name, char delimiter);
93 
104  static void ReadCSV(ValueMapVector& values, const std::string& header,
105  const std::string& file_name, char delimiter);
106 
107  //TODO comment
108  static void WriteTracks(std::vector<core::TrackletPtr>& tracks, const std::string& file_name,
109  char delimiter);
110 
111  static void ReadTracks(std::vector<core::TrackletPtr>& tracks, const std::string& file_name,
112  char delimiter);
113 
114  static std::vector<std::string> split(const std::string& input, char delimiter);
115  };
116 }
117 
118 
119 #endif //GBMOT_FILEIO_H
Definition: FileIO.cpp:11
static void ListFiles(const std::string &folder, std::vector< std::string > &file_names, bool sort=true)
Definition: FileIO.cpp:117
Definition: FileIO.h:25
static void WriteCSVMatlab(DirectedGraph &graph, const std::string &file_name)
Definition: FileIO.cpp:151
static void ReadCSV(Vector3d &values, const std::string &file_name, char delimiter)
Definition: FileIO.cpp:13