1 #ifndef __JDB_JDATALOGSTRING__
2 #define __JDB_JDATALOGSTRING__
24 namespace JPP {
using namespace JDB; }
35 static const char*
const getName() {
return "datalogstrings"; }
50 if (!datalog.
data .empty() && !regex_match(
data, regex(datalog.
data))) {
return false; }
72 while (in.peek() != EOF && isspace((
char) in.peek())) { in.ignore(1); }
92 out <<
object.utc <<
' ';
94 out <<
object.source <<
' ';
95 out <<
object.parameter <<
' ';
121 std::
vector<std::string>(buffer)
134 for (const_iterator
i = this->begin();
i != this->end(); ++
i) {
135 if (target.find(*
i) != std::string::npos) {
152 "LocalAuthenticationProvider",
153 "MasterControlProgram",
201 void load(
const std::string& file_name)
209 ifstream
in(file_name.c_str());
211 in.ignore(numeric_limits<std::streamsize>::max(),
'\n');
221 in.ignore(numeric_limits<std::streamsize>::max(),
'\n');
249 for (
string buffer;
getline(in, buffer); ) {
251 istringstream
is(buffer);
253 if (is >> datalog.run >> datalog.utc >> datalog.source >> datalog.parameter) {
257 if (
SOURCE_NAMES(datalog.source) && !IGNORED_PARAMETER_NAMES(datalog.parameter)) {
259 while (is.peek() != EOF && isspace((
char) is.peek())) { is.ignore(1); }
265 if (
object.sources.empty() ||
object.sources.count(datalog.source) != 0) {
267 object.push_back(datalog);
277 if (!
object.empty()) {
278 object.rbegin()->data.append(
" " + buffer);
Exception for opening of file.
JKeywords(const std::initializer_list< std::string > &buffer)
Constructor.
JDatalogs_t(const std::initializer_list< std::string > &buffer={})
Constructor.
bool operator()(const std::string &target) const
Test validity of target.
friend std::istream & operator>>(std::istream &in, JDatalogString &object)
Read datalog from input.
JDatalogs_t(const std::set< std::string > &buffer)
Constructor.
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
void load(const std::string &file_name)
Load message from input file.
bool match(const JDatalogString &datalog) const
Get match.
friend std::ostream & operator<<(std::ostream &out, const JDatalogString &object)
Write datalog to output.
Auxiliary data structure for datalog strings.
std::istream & getline(std::istream &in, JString &object)
Read string from input stream until end of line.
friend std::istream & operator>>(std::istream &in, JDatalogs_t &object)
Read message from input.
then fatal The output file must have the wildcard in the e g root fi eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Auxiliary class for date and time.
std::string getFilenameExtension(const std::string &file_name)
Get file name extension, i.e. part after last JEEP::FILENAME_SEPARATOR if any.
std::set< std::string > sources
static const char *const getName()
Table name.
const JKeywords SOURCE_NAMES
Valid source names.
Container for datalog strings.
const JKeywords IGNORED_PARAMETER_NAMES
Ignored parameter names.
Auxiliary data structure for selecting data.