Responsible for generic IO operations. More...
#include <managers/io/FileManager.h>
Public Member Functions | |
| FileManager () | |
| virtual | ~FileManager () |
| void | readInputFile (const std::string file_name, gpr::InputParameters ¶meters) |
| Read data from the input file and populates structure of parameters. The input file may have empty lines and in-line comments that should start with "%" character. The values should be assigned to variable using the assignment operator "=". | |
| template<typename T> | |
| void | readDataFile (const std::string file_name, std::map< std::string, T * > &data) |
| Read data file. The method reads data file written in ASCII format. The values of data should point to fields that supposed to be populated. The keys in data should have names of fields from the data file. | |
| template<typename T> | |
| bool | readFromPlainFile (const std::string file_name, T &field) |
| Read plain ASCII data file. This function reads data line-by-line from a plain text file. No memory allocation and no range chacks are invoked during the execution of the function. | |
| template<typename T> | |
| bool | writePlainFile (const std::string file_name, const T &field, std::ios::openmode mode) |
| bool | writeXYZFile (const std::string file_name, const gpr::Coord &field, std::ios::openmode mode) |
Responsible for generic IO operations.
Definition at line 34 of file FileManager.h.
| gpr::io::FileManager::FileManager | ( | ) |
Definition at line 23 of file FileManager.cpp.
|
virtual |
Definition at line 25 of file FileManager.cpp.
| void gpr::io::FileManager::readDataFile | ( | const std::string | file_name, |
| std::map< std::string, T * > & | data ) |
Read data file. The method reads data file written in ASCII format. The values of data should point to fields that supposed to be populated. The keys in data should have names of fields from the data file.
| file_name | Name of the data file. |
| data | Map of fields names and pointers to the fields objects. |
Definition at line 98 of file FileManager.inl.
| bool gpr::io::FileManager::readFromPlainFile | ( | const std::string | file_name, |
| T & | field ) |
Read plain ASCII data file. This function reads data line-by-line from a plain text file. No memory allocation and no range chacks are invoked during the execution of the function.
| file_name | File name |
| field | 2D field of data |
Definition at line 202 of file FileManager.inl.
| void gpr::io::FileManager::readInputFile | ( | const std::string | file_name, |
| gpr::InputParameters & | parameters ) |
Read data from the input file and populates structure of parameters. The input file may have empty lines and in-line comments that should start with "%" character. The values should be assigned to variable using the assignment operator "=".
| file_name | Name of the input file. |
| parameters | Structure of parameters |
Definition at line 27 of file FileManager.cpp.
| bool gpr::io::FileManager::writePlainFile | ( | const std::string | file_name, |
| const T & | field, | ||
| std::ios::openmode | mode ) |
Definition at line 230 of file FileManager.inl.
| bool gpr::io::FileManager::writeXYZFile | ( | const std::string | file_name, |
| const gpr::Coord & | field, | ||
| std::ios::openmode | mode ) |
Definition at line 231 of file FileManager.cpp.