ATLAS Offline Software
|
A class to provide read access to an ASCII input file. More...
#include <AsciiInput.h>
Public Member Functions | |
AsciiInput (const std::string &fileName) | |
~AsciiInput () | |
int | open () |
Open the input file. More... | |
int | close () |
Close the input file. More... | |
std::vector< std::string > | readRow () |
Read one line of the input text file into a vector of strings. More... | |
Static Public Member Functions | |
static std::vector< std::string > | strToStrVec (const std::string &inputString) |
A helper function to convert a string into a string vector, by using any number of space or tab characters as separators. More... | |
static long | strToLong (const std::string &inputString) |
A helper function to convert a string to a long value. More... | |
static double | strToDouble (const std::string &inputString) |
A helper function to convert a string to a double value. More... | |
Private Attributes | |
std::string | m_fileName |
Input file name. More... | |
std::ifstream | m_file |
Input file stream. More... | |
char | m_lineBuffer [MAX_LINE_LENGTH] |
Character buffers used while parsing the input file. More... | |
Static Private Attributes | |
static const int | MAX_LINE_LENGTH = 500 |
Size of the character buffers. More... | |
A class to provide read access to an ASCII input file.
Definition at line 18 of file AsciiInput.h.
AsciiInput::AsciiInput | ( | const std::string & | fileName | ) |
Definition at line 9 of file AsciiInput.cxx.
AsciiInput::~AsciiInput | ( | ) |
Definition at line 17 of file AsciiInput.cxx.
int AsciiInput::close | ( | ) |
Close the input file.
A non-zero value is returned if this is not successful.
Definition at line 32 of file AsciiInput.cxx.
int AsciiInput::open | ( | ) |
Open the input file.
A non-zero value is returned if this is not successful.
Definition at line 22 of file AsciiInput.cxx.
std::vector< std::string > AsciiInput::readRow | ( | ) |
Read one line of the input text file into a vector of strings.
Any number of space or tab characters are used as separators. If the row contains only separators or the end of file has been reached the returned vector will be empty.
Definition at line 42 of file AsciiInput.cxx.
|
static |
A helper function to convert a string to a double value.
Definition at line 122 of file AsciiInput.cxx.
|
static |
A helper function to convert a string to a long value.
Definition at line 113 of file AsciiInput.cxx.
|
static |
A helper function to convert a string into a string vector, by using any number of space or tab characters as separators.
Definition at line 67 of file AsciiInput.cxx.
|
private |
Input file stream.
Definition at line 53 of file AsciiInput.h.
|
private |
Input file name.
Definition at line 50 of file AsciiInput.h.
|
private |
Character buffers used while parsing the input file.
Definition at line 59 of file AsciiInput.h.
|
staticprivate |
Size of the character buffers.
Definition at line 56 of file AsciiInput.h.