25 int main(
int argc,
char **argv)
54 JParser<> zap(
"General purpose program to edit or create properties file.");
61 zap[
'w'] =
make_field(width,
"format width of key") = 12;
62 zap[
'q'] =
make_field(squash,
"squash meta data");
67 catch(
const exception &error) {
68 FATAL(error.what() << endl);
79 if (inputFile !=
"") {
81 ifstream in(inputFile.c_str());
85 in.imbue(locale(in.getloc(), facet.
clone()));
87 for (
JEquation equation; in >> equation; ) {
88 data[equation.getKey()] = equation.getValue();
102 if (!modifier.empty()) {
106 is.imbue(locale(is.getloc(), facet.
clone()));
108 for (
const token_type& token : modifier) {
118 ERROR(
"Invalid modifier: " << token << endl);
124 for (
const string& key : rm) {
128 if (i !=
data.end()) {
142 ostream os(buffer.is_open() ? &buffer : cout.rdbuf());
146 os.imbue(locale(cout.getloc(), facet.
clone()));
148 for (
const auto& item :
data) {
int main(int argc, char **argv)
General purpose messaging.
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Utility class to parse parameter values.
Utility class to parse parameter values.
Facet class to specify parsing of equations in currect locale (see class JLANG::JEquation).
virtual JEquationFacet * clone() const override
Clone this facet.
Simple data structure to support I/O of equations (see class JLANG::JEquation).
const std::string & getEndOfLine() const
Get end of line characters.
const std::string & getWhiteSpace() const
Get white space characters.
bool isSeparator(const char c) const
Test for separator character.
const std::string & getComment() const
Get comment string.
const std::string & getSeparator() const
Get separator characters.
char getLeftBracket() const
Get left bracket.
const std::string & getSkipLine() const
Get skip line characters.
const std::string & getDivision() const
Get division characters.
const char getDefaultWhiteSpace() const
Get default white space character.
char getRightBracket() const
Get right bracket.
General purpose equation class.
const std::string & getKey() const
Get key.
const std::string & getValue() const
Get value.
const char getSeparator() const
Get separator.
Wrapper class around string.
Utility class to parse command line options.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Empty structure for specification of parser element that is initialised (i.e. does not require input)...