classutil_1_1FileIO.tex 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. \hypertarget{classutil_1_1FileIO}{}\section{util\+:\+:File\+IO Class Reference}
  2. \label{classutil_1_1FileIO}\index{util\+::\+File\+IO@{util\+::\+File\+IO}}
  3. {\ttfamily \#include $<$File\+I\+O.\+h$>$}
  4. \subsection*{Static Public Member Functions}
  5. \begin{DoxyCompactItemize}
  6. \item
  7. static void \hyperlink{classutil_1_1FileIO_af42c183525923014e142a10a626d3677}{Read\+C\+SV} (Vector3d \&values, const std\+::string \&filename, char delimiter=\textquotesingle{};\textquotesingle{})
  8. \item
  9. static void \hyperlink{classutil_1_1FileIO_a264c9b694fd7218635c8a783956d2c1e}{Read\+C\+SV} (Vector2d \&values, const std\+::string \&filename, char delimiter=\textquotesingle{};\textquotesingle{})
  10. \item
  11. static void \hyperlink{classutil_1_1FileIO_a6e290e22083d49619b757bfca96a51fa}{List\+Files} (const std\+::string \&folder, std\+::vector$<$ std\+::string $>$ \&file\+\_\+names, bool sort=true)
  12. \item
  13. static void \hyperlink{classutil_1_1FileIO_a862586aced240e732ecd35773b57c267}{Write\+C\+S\+V\+Matlab} (Directed\+Graph \&graph, const std\+::string \&file\+\_\+name, char delimiter=\textquotesingle{};\textquotesingle{})
  14. \end{DoxyCompactItemize}
  15. \subsection{Detailed Description}
  16. Utility class for file in-\/ and output.
  17. \subsection{Member Function Documentation}
  18. \index{util\+::\+File\+IO@{util\+::\+File\+IO}!List\+Files@{List\+Files}}
  19. \index{List\+Files@{List\+Files}!util\+::\+File\+IO@{util\+::\+File\+IO}}
  20. \subsubsection[{\texorpdfstring{List\+Files(const std\+::string \&folder, std\+::vector$<$ std\+::string $>$ \&file\+\_\+names, bool sort=true)}{ListFiles(const std::string \&folder, std::vector< std::string > \&file\_names, bool sort=true)}}]{\setlength{\rightskip}{0pt plus 5cm}void util\+::\+File\+I\+O\+::\+List\+Files (
  21. \begin{DoxyParamCaption}
  22. \item[{const std\+::string \&}]{folder, }
  23. \item[{std\+::vector$<$ std\+::string $>$ \&}]{file\+\_\+names, }
  24. \item[{bool}]{sort = {\ttfamily true}}
  25. \end{DoxyParamCaption}
  26. )\hspace{0.3cm}{\ttfamily [static]}}\hypertarget{classutil_1_1FileIO_a6e290e22083d49619b757bfca96a51fa}{}\label{classutil_1_1FileIO_a6e290e22083d49619b757bfca96a51fa}
  27. Lists all file names in the given folder.
  28. \begin{DoxyParams}{Parameters}
  29. {\em folder} & The folder to look into \\
  30. \hline
  31. {\em file\+\_\+names} & The vector to store the file names into \\
  32. \hline
  33. {\em sort} & True, if the files should be sorted alphabetically \\
  34. \hline
  35. \end{DoxyParams}
  36. \index{util\+::\+File\+IO@{util\+::\+File\+IO}!Read\+C\+SV@{Read\+C\+SV}}
  37. \index{Read\+C\+SV@{Read\+C\+SV}!util\+::\+File\+IO@{util\+::\+File\+IO}}
  38. \subsubsection[{\texorpdfstring{Read\+C\+S\+V(\+Vector3d \&values, const std\+::string \&filename, char delimiter=\textquotesingle{};\textquotesingle{})}{ReadCSV(Vector3d \&values, const std::string \&filename, char delimiter=';')}}]{\setlength{\rightskip}{0pt plus 5cm}void util\+::\+File\+I\+O\+::\+Read\+C\+SV (
  39. \begin{DoxyParamCaption}
  40. \item[{Vector3d \&}]{values, }
  41. \item[{const std\+::string \&}]{filename, }
  42. \item[{char}]{delimiter = {\ttfamily \textquotesingle{};\textquotesingle{}}}
  43. \end{DoxyParamCaption}
  44. )\hspace{0.3cm}{\ttfamily [static]}}\hypertarget{classutil_1_1FileIO_af42c183525923014e142a10a626d3677}{}\label{classutil_1_1FileIO_af42c183525923014e142a10a626d3677}
  45. Reads a C\+SV 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.
  46. \begin{DoxyParams}{Parameters}
  47. {\em values} & The 3D array of values to store the read values in \\
  48. \hline
  49. {\em filename} & The filename to read from \\
  50. \hline
  51. {\em delimiter} & The delimiter used to separate the values in the file \\
  52. \hline
  53. \end{DoxyParams}
  54. \index{util\+::\+File\+IO@{util\+::\+File\+IO}!Read\+C\+SV@{Read\+C\+SV}}
  55. \index{Read\+C\+SV@{Read\+C\+SV}!util\+::\+File\+IO@{util\+::\+File\+IO}}
  56. \subsubsection[{\texorpdfstring{Read\+C\+S\+V(\+Vector2d \&values, const std\+::string \&filename, char delimiter=\textquotesingle{};\textquotesingle{})}{ReadCSV(Vector2d \&values, const std::string \&filename, char delimiter=';')}}]{\setlength{\rightskip}{0pt plus 5cm}void util\+::\+File\+I\+O\+::\+Read\+C\+SV (
  57. \begin{DoxyParamCaption}
  58. \item[{Vector2d \&}]{values, }
  59. \item[{const std\+::string \&}]{filename, }
  60. \item[{char}]{delimiter = {\ttfamily \textquotesingle{};\textquotesingle{}}}
  61. \end{DoxyParamCaption}
  62. )\hspace{0.3cm}{\ttfamily [static]}}\hypertarget{classutil_1_1FileIO_a264c9b694fd7218635c8a783956d2c1e}{}\label{classutil_1_1FileIO_a264c9b694fd7218635c8a783956d2c1e}
  63. Reads a C\+SV file and stores the values in a 2D array. The first dimension is the row and the second the value in that row.
  64. \begin{DoxyParams}{Parameters}
  65. {\em values} & The 2D array of values to store the read values in \\
  66. \hline
  67. {\em filename} & The filename to read from \\
  68. \hline
  69. {\em delimiter} & The delimiter used to separate the values in the file \\
  70. \hline
  71. \end{DoxyParams}
  72. \index{util\+::\+File\+IO@{util\+::\+File\+IO}!Write\+C\+S\+V\+Matlab@{Write\+C\+S\+V\+Matlab}}
  73. \index{Write\+C\+S\+V\+Matlab@{Write\+C\+S\+V\+Matlab}!util\+::\+File\+IO@{util\+::\+File\+IO}}
  74. \subsubsection[{\texorpdfstring{Write\+C\+S\+V\+Matlab(\+Directed\+Graph \&graph, const std\+::string \&file\+\_\+name, char delimiter=\textquotesingle{};\textquotesingle{})}{WriteCSVMatlab(DirectedGraph \&graph, const std::string \&file\_name, char delimiter=';')}}]{\setlength{\rightskip}{0pt plus 5cm}void util\+::\+File\+I\+O\+::\+Write\+C\+S\+V\+Matlab (
  75. \begin{DoxyParamCaption}
  76. \item[{Directed\+Graph \&}]{graph, }
  77. \item[{const std\+::string \&}]{file\+\_\+name, }
  78. \item[{char}]{delimiter = {\ttfamily \textquotesingle{};\textquotesingle{}}}
  79. \end{DoxyParamCaption}
  80. )\hspace{0.3cm}{\ttfamily [static]}}\hypertarget{classutil_1_1FileIO_a862586aced240e732ecd35773b57c267}{}\label{classutil_1_1FileIO_a862586aced240e732ecd35773b57c267}
  81. Writes the given graph into a C\+SV file with an format readable by Matlab.
  82. \begin{DoxyParams}{Parameters}
  83. {\em graph} & The graph to write \\
  84. \hline
  85. {\em file\+\_\+name} & The name of the file to write into \\
  86. \hline
  87. {\em delimiter} & The delimiter to use \\
  88. \hline
  89. \end{DoxyParams}
  90. The documentation for this class was generated from the following files\+:\begin{DoxyCompactItemize}
  91. \item
  92. util/File\+I\+O.\+h\item
  93. util/File\+I\+O.\+cpp\end{DoxyCompactItemize}