CFEL - ASG Software Suite
2.5.0
CASS
|
class for reading txt files More...
#include <txt_reader.h>
Public Member Functions | |
TxtReader () | |
constructor More... | |
bool | operator() (std::ifstream &file, CASSEvent &event) |
read the frms6 file contents put them into cassevent More... | |
void | loadSettings () |
load the settings of the reader More... | |
void | readHeaderInfo (std::ifstream &file) |
read the file header More... | |
![]() | |
virtual | ~FileReader () |
virtual destructor More... | |
void | filename (const std::string &filename) |
set the filename of the instance More... | |
const std::string & | filename () const |
retrieve the filename that this instance is working on More... | |
std::string | type () const |
return the type of file that this is for More... | |
Private Attributes | |
std::vector< std::string > | _headers |
the value names More... | |
Splitter | _split |
a splitter object to split up the lines More... | |
char | _delim |
the deliminator by which the values are separated in the ascii file More... | |
std::string | _eventIdhead |
the header name under which the event id is stored More... | |
size_t | _linesToSkip |
how many lines should be skipped before reading the header line More... | |
Additional Inherited Members | |
![]() | |
typedef std::tr1::shared_ptr< FileReader > | shared_pointer |
typedef the shared pointer of this More... | |
![]() | |
static shared_pointer | instance (const std::string &filename) |
create an instance of the requested type More... | |
![]() | |
FileReader () | |
only inheritants can create this More... | |
FileReader (const std::string &type) | |
set the readers type More... | |
![]() | |
std::string | _filename |
the name of the file that we read the values from More... | |
std::string | _type |
the reader type as string More... | |
class for reading txt files
first line has to give the names of the variables, which are then ordered line by line.
TxtReader/%filename%/{Deliminator}
The deliminator that is used to separate the values. Default is '\t', which is a tab.
TxtReader/%filename%/{EventIdHeader}
The name of the Header under which the Event Id is stored. Default is "".
TxtReader/%filename%/{LinesToSkip}
How many lines do we have to skip before the line appears that contains the headers. Default is 3
Definition at line 41 of file txt_reader.h.
TxtReader::TxtReader | ( | ) |
constructor
Definition at line 25 of file txt_reader.cpp.
|
virtual |
load the settings of the reader
Implements cass::FileReader.
Definition at line 29 of file txt_reader.cpp.
References _delim, _eventIdhead, cass::FileReader::_filename, _linesToSkip, QSettings::beginGroup(), QSettings::endGroup(), QString::fromStdString(), and QSettings::value().
|
virtual |
read the frms6 file contents put them into cassevent
file | the file that contains the data to be put into the cassevent |
event | the CASSEvent where the data will be put into |
Implements cass::FileReader.
Definition at line 57 of file txt_reader.cpp.
References _delim, _eventIdhead, cass::FileReader::_filename, _headers, _split, cass::CASSEvent::devices(), cass::CASSEvent::id(), cass::CASSEvent::MachineData, cass::toString(), and value.
|
virtual |
read the file header
file | the filestream to the header information of the file |
Reimplemented from cass::FileReader.
Definition at line 41 of file txt_reader.cpp.
References _delim, cass::FileReader::_filename, _headers, _linesToSkip, _split, cass::Log::add(), info, and cass::Log::VERBOSEINFO.
|
private |
the deliminator by which the values are separated in the ascii file
Definition at line 73 of file txt_reader.h.
Referenced by loadSettings(), operator()(), and readHeaderInfo().
|
private |
the header name under which the event id is stored
Definition at line 76 of file txt_reader.h.
Referenced by loadSettings(), and operator()().
|
private |
the value names
Definition at line 67 of file txt_reader.h.
Referenced by operator()(), and readHeaderInfo().
|
private |
how many lines should be skipped before reading the header line
Definition at line 79 of file txt_reader.h.
Referenced by loadSettings(), and readHeaderInfo().
|
private |
a splitter object to split up the lines
Definition at line 70 of file txt_reader.h.
Referenced by operator()(), and readHeaderInfo().