1 #ifndef SRC_UTILS_FILEIO_HPP_
2 #define SRC_UTILS_FILEIO_HPP_
11 #include <configure.hpp>
14 #include <athena/athena.hpp>
27 int GetNumCols(std::string fname,
char c =
' ');
33 void replaceChar(
char* buf,
char c_old,
char c_new);
39 char*
NextLine(
char* line,
int num, FILE* stream);
43 using DataVector = std::map<std::string, std::vector<double>>;
std::string DecommentFile(std::string fname)
decomment a file
int GetNumRows(std::string fname)
get number of rows in a data table
void ReadDataTable(AthenaArray< Real > *data, std::string fname, char c=' ')
bool FileExists(std::string fname)
test file existance
std::map< std::string, std::vector< double > > DataVector
char * StripLine(char *line)
void replaceChar(char *buf, char c_old, char c_new)
replace a character in a string
char * NextLine(char *line, int num, FILE *stream)
int GetNumCols(std::string fname, char c=' ')
get number of columns in a data table
bool IsBlankLine(char const *line)
test a blank line
DataVector read_data_vector(std::string fname)
void read_data_table(char const *fname, double **data, int *rows, int *cols)