1 #ifndef __JDB_JDATALOGSTRING__
2 #define __JDB_JDATALOGSTRING__
23 namespace JPP {
using namespace JDB; }
34 static const char*
const getName() {
return "datalogstrings"; }
49 if (!datalog.
data .empty() && !regex_match(
data, regex(datalog.
data))) {
return false; }
71 while (in.peek() != EOF && isspace((
char) in.peek())) { in.ignore(1); }
91 out <<
object.utc <<
' ';
93 out <<
object.source <<
' ';
94 out <<
object.parameter <<
' ';
133 for (const_iterator
i = this->begin();
i != this->end(); ++
i) {
134 if (target.find(*
i) != std::string::npos) {
151 "LocalAuthenticationProvider",
152 "MasterControlProgram",
208 ifstream
in(file_name.c_str());
210 in.ignore(numeric_limits<std::streamsize>::max(),
'\n');
220 in.ignore(numeric_limits<std::streamsize>::max(),
'\n');
248 for (
string buffer;
getline(in, buffer); ) {
250 istringstream
is(buffer);
252 if (is >> datalog.run >> datalog.utc >> datalog.source >> datalog.parameter) {
256 if (
SOURCE_NAMES(datalog.source) && !IGNORED_PARAMETER_NAMES(datalog.parameter)) {
258 while (is.peek() != EOF && isspace((
char) is.peek())) { is.ignore(1); }
264 if (
object.sources.empty() ||
object.sources.count(datalog.source) != 0) {
266 object.push_back(datalog);
276 if (!
object.empty()) {
277 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 Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] 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.