#include <ascio.h>
A high level interface class to read columns of data from an ASCII-file Supports arbitrary delimiter characters and whitespace seperated columns. Comments can begin at any point of a line. An arbitrary string can be used for the beginning of the comment.
|
Constructs an AsciiFile object. : in_(fname.c_str()), rows_(0), cols_(0), filename_(fname), delim_(delim), comment_(comment) Constructs an ltl::AscFile object corresponding to the file fname. |
|
High level interface to ltl::AscFile::cols_. Returns the number of columns in the file |
|
Internal function used to count the number of columns. Counts the cols in the file. Might be expensive on large files, so the function is not called before the information is requested by calling ltl::AscFile::cols(). |
|
Internal function used to count the number of rows. Counts the rows in the file. Might be expensive on large files, so the function is not called before the information is requested by calling ltl::AscFile::rows(). |
|
Internal function to extract one column from a given string. Extracts the col'th column from the string buff, and returns it as a string.
|
|
Internal function used to read on line from the file stream. Reads the next line from the input stream. The input stream is closed between subsequent calls, and the stream position is saved in the variable ltl::AscFile::filepos_. |
|
High level interface to ltl::AscFile::rows_. Returns the number of rows in the file. |
|
Internal storage of the number of columns in the file. Stores internally the the number of columns in the file. This variable is initialized with 0. The first call to ltl::AscFile::cols() updates the variable with the correct number of columns. |
|
Internal storage of the comment string. Defaults to '#'. |
|
Internal storage of delimiter character. Stores internally the column delimiter. If the set to int(0) then it is assumed, that the columns are whitespace delimited, and any number of whitespace characters is treated as one delimiter. |
|
Internal storage of the number of rows in the file. Stores internally the the number of rows in the file. This variable is initialized with 0. The first call to ltl::AscFile::rows() updates the variable with the correct number of rows. |