#include <FileIO.h>
|
| static void | ReadCSV (Vector3d &values, const std::string &filename, char delimiter=';') |
| |
| static void | ReadCSV (Vector2d &values, const std::string &filename, 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, 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 vector to store the file names into |
| sort | True, if the files should be sorted alphabetically |
| void util::FileIO::ReadCSV |
( |
Vector3d & |
values, |
|
|
const std::string & |
filename, |
|
|
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 |
| filename | The filename to read from |
| delimiter | The delimiter used to separate the values in the file |
| void util::FileIO::ReadCSV |
( |
Vector2d & |
values, |
|
|
const std::string & |
filename, |
|
|
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 |
| filename | The filename to read from |
| delimiter | The delimiter used to separate the values in the file |
| void util::FileIO::WriteCSVMatlab |
( |
DirectedGraph & |
graph, |
|
|
const std::string & |
file_name, |
|
|
char |
delimiter = ';' |
|
) |
| |
|
static |
Writes the given 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 into |
| delimiter | The delimiter to use |
The documentation for this class was generated from the following files: