#include <FileIO.h>
|
| static void | ReadCSV (Vector3d &values, const std::string &file_name, char delimiter) |
| |
| static void | ReadCSV (Vector2d &values, const std::string &file_name, char delimiter) |
| |
| static void | ListFiles (const std::string &folder, std::vector< std::string > &file_names, bool sort=true) |
| |
| static void | WriteCSVMatlab (DirectedGraph &graph, const std::string &file_name) |
| |
| static void | WriteCSVMatlab (MultiPredecessorMap &map, Vertex &source, Vertex &sink, const std::string &file_name) |
| |
| static void | ReadCSV (ValueMapVector &values, const std::string &file_name, char delimiter) |
| |
| static void | ReadCSV (ValueMapVector &values, const std::string &header, const std::string &file_name, char delimiter) |
| |
| static void | WriteTracks (std::vector< core::TrackletPtr > &tracks, const std::string &file_name, char delimiter) |
| |
| static void | ReadTracks (std::vector< core::TrackletPtr > &tracks, const std::string &file_name, char delimiter) |
| |
| static std::vector< std::string > | Split (const std::string &input, char delimiter) |
| |
Utility class for file in- and output.
| void util::FileIO::ListFiles |
( |
const std::string & |
folder, |
|
|
std::vector< std::string > & |
file_names, |
|
|
bool |
sort = true |
|
) |
| |
|
static |
Lists all file names in the given folder.
- Parameters
-
| folder | The folder to look into |
| file_names | The name of the files in the folder |
| sort | True, if the files should be sorted alphabetically |
| void util::FileIO::ReadCSV |
( |
Vector3d & |
values, |
|
|
const std::string & |
file_name, |
|
|
char |
delimiter |
|
) |
| |
|
static |
Reads a CSV file and stores the values in a 3D array. The first dimension is the first value of each row, used as a index to bundle multiple rows with the same first value into a single vector. The second dimension is the row in the row bundle. The third dimension is the value in that row.
- Parameters
-
| values | The 3D array of values to store the read values in |
| file_name | The name of the file to read |
| delimiter | The value delimiter of the file |
| void util::FileIO::ReadCSV |
( |
Vector2d & |
values, |
|
|
const std::string & |
file_name, |
|
|
char |
delimiter |
|
) |
| |
|
static |
Reads a CSV file and stores the values in a 2D array. The first dimension is the row and the second the value in that row.
- Parameters
-
| values | The 2D array of values to store the read values in |
| file_name | The name of the file to read |
| delimiter | The value delimiter of the file |
| void util::FileIO::ReadCSV |
( |
ValueMapVector & |
values, |
|
|
const std::string & |
file_name, |
|
|
char |
delimiter |
|
) |
| |
|
static |
Reads a CSV file. The first line of the CSV file is a header specifying the keys. The values are stored with their specified key into one map per line.
- Parameters
-
| values | A vector of maps to store the key-value pairs into |
| file_name | The name of the file to read |
| delimiter | The value delimiter of the file |
| void util::FileIO::ReadCSV |
( |
ValueMapVector & |
values, |
|
|
const std::string & |
header, |
|
|
const std::string & |
file_name, |
|
|
char |
delimiter |
|
) |
| |
|
static |
Reads a CSV file. The header specifies the keys. The values are stored with their specified key into one map per line.
- Parameters
-
| values | A vector of maps to store the key-value pairs into |
| header | A string containing the keys separated by the delimiter |
| file_name | The name of the file to read |
| delimiter | The value delimiter of the file |
| static void util::FileIO::ReadTracks |
( |
std::vector< core::TrackletPtr > & |
tracks, |
|
|
const std::string & |
file_name, |
|
|
char |
delimiter |
|
) |
| |
|
static |
Reads the tracks from the specified file.
- Parameters
-
| tracks | A vector for storing the read tracks |
| file_name | The path of the file to read from |
| delimiter | The delimiter used to separate values |
| std::vector< std::string > util::FileIO::Split |
( |
const std::string & |
input, |
|
|
char |
delimiter |
|
) |
| |
|
static |
Splits the input string at the delimiter and store each part into the return vector. If there is nothing between two delimiters the part will be an empty string.
- Parameters
-
| input | The string to split |
| delimiter | The delimiter used to split, the delimiter will not be stored |
- Returns
- A vector of parts like (for string of length n: [0,d)...(d,d)...(d,n))
| void util::FileIO::WriteCSVMatlab |
( |
DirectedGraph & |
graph, |
|
|
const std::string & |
file_name |
|
) |
| |
|
static |
Writes the specified graph into a CSV file with an format readable by Matlab.
- Parameters
-
| graph | The graph to write |
| file_name | The name of the file to write |
| void util::FileIO::WriteCSVMatlab |
( |
MultiPredecessorMap & |
map, |
|
|
Vertex & |
source, |
|
|
Vertex & |
sink, |
|
|
const std::string & |
file_name |
|
) |
| |
|
static |
Writes the specified multi predecessor map into a CSV format readable by Matlab to display all paths in the corresponding graph.
- Parameters
-
| map | The multi predecessor map to extract the paths from |
| source | The sink, this is the vertex where all paths begin |
| sink | The sink, this is the vertex where all paths end |
| file_name | The name of the file to write |
| void util::FileIO::WriteTracks |
( |
std::vector< core::TrackletPtr > & |
tracks, |
|
|
const std::string & |
file_name, |
|
|
char |
delimiter |
|
) |
| |
|
static |
Writes the given tracks to the given file.
- Parameters
-
| tracks | The tracks to store |
| file_name | The path to the file to store the tracks in |
| delimiter | The delimiter used to separate values |
The documentation for this class was generated from the following files: