Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Attributes | Friends | List of all members
JEEP::JProperties Class Reference

Utility class to parse parameter values. More...

#include <JProperties.hh>

Inheritance diagram for JEEP::JProperties:
std::map< std::string, JPropertiesElement > JLANG::JEquationParameters JEEP::JMessage< JProperties > JDETECTOR::JDetectorHeader::JDetectorHeaderHelper JDETECTOR::JDetectorParametersHelper JDETECTOR::JPMTParameters::JPMTParametersHelper

Classes

class  JFileReader
 Auxiliary class to handle input from file. More...
 

Public Types

typedef std::map< std::string,
JPropertiesElement
JMap_t
 

Public Member Functions

 JProperties (const int debug=0)
 Constructor. More...
 
 JProperties (const JEquationParameters &parameters, const int debug=0)
 Constructor. More...
 
template<class T >
void put (const std::string &key, T &object)
 Put object at given key. More...
 
JPropertiesjoin (const JProperties &properties)
 Join properties objects. More...
 
bool read (const JEquation &equation)
 Read equation. More...
 
bool read (const std::string &buffer)
 Read from input string. More...
 
std::istream & read (std::istream &in)
 Read from input stream. More...
 
std::istream & read (std::istream &in, const std::string &format)
 Read from input stream according given format. More...
 
template<class T >
std::istream & read (std::istream &in, T __begin, T __end)
 Read from input stream according given format. More...
 
std::ostream & write (std::ostream &out) const
 Write the current parameter values. More...
 
std::ostream & write (std::ostream &out, const std::string &format)
 Write to output stream according given format. More...
 
template<class T >
std::ostream & write (std::ostream &out, T __begin, T __end)
 Write to output stream according given format. More...
 
std::string sed (const std::string &format, const std::string &prefix="", const std::string &postfix="")
 Stream editing of input format. More...
 
template<class T >
const T & getValue (const std::string &key) const
 Get value. More...
 
template<class T >
T & getValue (const std::string &key)
 Get value. More...
 
template<class T >
void setValue (const std::string &key, const T &value)
 Set value. More...
 
std::string getString (const std::string &key) const
 Get string value. More...
 
std::ostream & print (std::ostream &out) const
 Print the current parameter values. More...
 
const JEquationParametersgetEquationParameters () const
 Get equation parameters. More...
 
void setEquationParameters (const JEquationParameters &buffer)
 Set equation parameters. More...
 
const char getDefaultSeparator () const
 Get default separator character. More...
 
const std::string & getSeparator () const
 Get separator characters. More...
 
void setSeparator (const std::string &sep)
 Set separator character(s). More...
 
const char getDefaultEndOfLine () const
 Get default end of line character. More...
 
const char getPreferredEndOfLine (const unsigned int index) const
 Get preferred end of line character. More...
 
const std::string & getEndOfLine () const
 Get end of line characters. More...
 
void setEndOfLine (const std::string &eol)
 Set end of line characters. More...
 
const char getDefaultDivision () const
 Get default division character. More...
 
const std::string & getDivision () const
 Get division characters. More...
 
void setDivision (const std::string &div)
 Set division characters. More...
 
const char getDefaultSkipLine () const
 Get default skip line character. More...
 
const std::string & getSkipLine () const
 Get skip line characters. More...
 
void setSkipLine (const std::string &skip)
 Set skip line characters. More...
 
void setBrackets (const char left, const char right)
 Set brackets. More...
 
char getLeftBracket () const
 Get left bracket. More...
 
char getRightBracket () const
 Get right bracket. More...
 
const char getDefaultWhiteSpace () const
 Get default white space character. More...
 
const std::string & getWhiteSpace () const
 Get white space characters. More...
 
void setWhiteSpace (const std::string &ws)
 Set white space characters. More...
 
JEquationParametersjoin (const JEquationParameters &value)
 Join equation parameters. More...
 
bool isSeparator (const char c) const
 Test for separator character. More...
 
bool isEndOfLine (const char c) const
 Test for end of line character. More...
 
bool isDivision (const char c) const
 Test for division character. More...
 
bool isSkipLine (const char c) const
 Test for skip line character. More...
 
bool isLeftBracket (const char c) const
 Test for left bracket character. More...
 
bool isRightBracket (const char c) const
 Test for right bracket character. More...
 
bool isWhiteSpace (const char c) const
 Test for white space character. More...
 

Static Public Member Functions

static std::string getKey (const std::string &buffer, const std::string &sep)
 Utility method to strip off all leading characters from a string until specified character(s). More...
 

Static Public Attributes

static int debug
 

Protected Attributes

std::string sep
 
std::string eol
 
std::string div
 
std::string skip
 
char left
 
char right
 
std::string ws
 

Friends

std::istream & operator>> (std::istream &in, JProperties &properties)
 Stream input. More...
 
std::ostream & operator<< (std::ostream &out, const JProperties &properties)
 Stream output. More...
 

Detailed Description

Utility class to parse parameter values.

The mapping between a parameter (of any type) and a value has to be defined in the user's program, e.g.

ifstream in(filename.c_str());
int integer_value;
double double_value;
string string_value;
zap.insert(make_property(integer_value)); // key == parameter name
zap.insert(make_property(double_value)); // key == parameter name
zap["mies"] = string_value;
zap.read(in);
zap.write(cout);

Definition at line 484 of file JProperties.hh.

Member Typedef Documentation

Definition at line 491 of file JProperties.hh.

Constructor & Destructor Documentation

JEEP::JProperties::JProperties ( const int  debug = 0)
inline

Constructor.

Parameters
debugdebug level

Definition at line 608 of file JProperties.hh.

608  :
609  JMap_t(),
611  {
612  this->debug = debug;
613  }
std::map< std::string, JPropertiesElement > JMap_t
Definition: JProperties.hh:491
JEquationParameters()
Default constructor.
JEEP::JProperties::JProperties ( const JEquationParameters parameters,
const int  debug = 0 
)
inline

Constructor.

Parameters
parametersequation parameters
debugdebug level

Definition at line 622 of file JProperties.hh.

623  :
624  JMap_t(),
625  JEquationParameters(parameters)
626  {
627  this->debug = debug;
628  }
std::map< std::string, JPropertiesElement > JMap_t
Definition: JProperties.hh:491
JEquationParameters()
Default constructor.

Member Function Documentation

static std::string JEEP::JProperties::getKey ( const std::string &  buffer,
const std::string &  sep 
)
inlinestatic

Utility method to strip off all leading characters from a string until specified character(s).

Parameters
bufferinput string
seplast character(s) to strip
Returns
modified string

Definition at line 503 of file JProperties.hh.

504  {
505  using namespace std;
506 
507  const size_type pos = buffer.find_last_of(sep);
508 
509  if (pos != string::npos)
510  return buffer.substr(pos + 1);
511  else
512  return buffer;
513  }
template<class T >
void JEEP::JProperties::put ( const std::string &  key,
T &  object 
)
inline

Put object at given key.

Parameters
keykey
objectobject

Definition at line 638 of file JProperties.hh.

639  {
640  this->insert(value_type(key, JPropertiesElement(object)));
641  }
The property value class.
Definition: JProperties.hh:281
JProperties& JEEP::JProperties::join ( const JProperties properties)
inline

Join properties objects.

Parameters
propertiesproperties

Definition at line 649 of file JProperties.hh.

650  {
651  JEquationParameters::join(properties);
652 
653  insert(properties.begin(), properties.end());
654 
655  return *this;
656  }
JEquationParameters & join(const JEquationParameters &value)
Join equation parameters.
bool JEEP::JProperties::read ( const JEquation equation)
inline

Read equation.

Parameters
equationequation
Returns
status

Definition at line 665 of file JProperties.hh.

666  {
667  using namespace std;
668 
669  iterator p = find(equation.getKey());
670 
671  DEBUG("Processing key: " << equation.getKey() << ' ' << (p != end()) << endl);
672 
673  if (p != end()) {
674 
675  istringstream is(equation.getValue());
676 
677  if (isDivision(equation.getSeparator())) {
678 
679  if (p->second->is_properties()) {
680 
681  p->second->read(is);
682 
683  } else {
684 
685  ERROR("JProperties::read(): no properties object after division <" << equation.getKey() << ">" << endl);
686  }
687 
688  } else if (isSeparator(equation.getSeparator())) {
689 
690  try {
691  p->second->read(is);
692  }
693  catch(const exception& error) {
694  ERROR("JProperties::read(): " << error.what() << endl);
695  }
696 
697  } else {
698 
699  ERROR("JProperties::read(): illegal character following key <" << equation.getKey() << "> " << equation.getSeparator() << endl);
700  }
701 
702  if (p->second.getEndMarker()) {
703  return false;
704  }
705 
706  if (fail(is)) {
707 
708  ERROR("JProperties::read(): error reading data for key <" << equation.getKey() << "> " << equation.getValue() << endl);
709  }
710 
711  } else {
712 
713  WARNING("JProperties::read(): unknown key <" << equation.getKey() << ">" << endl);
714  }
715 
716  return true;
717  }
#define WARNING(A)
Definition: JMessage.hh:63
#define ERROR(A)
Definition: JMessage.hh:64
bool fail(std::istream &in)
Check for stream state.
Definition: JProperties.hh:57
bool isSeparator(const char c) const
Test for separator character.
bool isDivision(const char c) const
Test for division character.
#define DEBUG(A)
Message macros.
Definition: JMessage.hh:60
bool JEEP::JProperties::read ( const std::string &  buffer)
inline

Read from input string.

Parameters
bufferinput string
Returns
read status

Definition at line 726 of file JProperties.hh.

727  {
728  std::istringstream in(buffer);
729 
730  return !fail(read(in));
731  }
bool read(const JEquation &equation)
Read equation.
Definition: JProperties.hh:665
bool fail(std::istream &in)
Check for stream state.
Definition: JProperties.hh:57
std::istream& JEEP::JProperties::read ( std::istream &  in)
inline

Read from input stream.

The input format is:

   [<key><sub>]<key><sep><value><eol>
   [<key><sub>]<key><sep><value><eol>

in this, white spaces are ignored. The reading of key and value pairs is controlled by the JLANG::JEquationFacet class.

Parameters
ininput stream
Returns
input stream

Definition at line 748 of file JProperties.hh.

749  {
750  using namespace std;
751 
752  in.imbue(locale(in.getloc(), new JEquationFacet(*this)));
753 
754  for (JEquation equation; in >> equation && read(equation); ) {}
755 
756  return in;
757  }
bool read(const JEquation &equation)
Read equation.
Definition: JProperties.hh:665
std::istream& JEEP::JProperties::read ( std::istream &  in,
const std::string &  format 
)
inline

Read from input stream according given format.

For each key in the format specification, a corresponding value will be read from the input stream.

Parameters
ininput stream
formatformat
Returns
input stream

Definition at line 770 of file JProperties.hh.

771  {
772  using namespace std;
773 
774  istringstream is(format);
775 
776  vector<string> buffer;
777 
778  for (string key; is >> key; ) {
779  buffer.push_back(key);
780  }
781 
782  return read(in, buffer.begin(), buffer.end());
783  }
bool read(const JEquation &equation)
Read equation.
Definition: JProperties.hh:665
template<class T >
std::istream& JEEP::JProperties::read ( std::istream &  in,
__begin,
__end 
)
inline

Read from input stream according given format.

For each key in the format specification, a corresponding value will be read from the input stream.

Parameters
ininput stream
__beginbegin of format
__endend of format
Returns
input stream

Definition at line 798 of file JProperties.hh.

799  {
800  using namespace std;
801 
802  for (T i = __begin; i != __end; ++i) {
803 
804  iterator p = find(*i);
805 
806  if (p != end()) {
807 
808  p->second->read(in);
809 
810  } else {
811 
812  WARNING("JProperties::read(): unknown key <" << *i << ">" << endl);
813  }
814  }
815 
816  return in;
817  }
#define WARNING(A)
Definition: JMessage.hh:63
std::ostream& JEEP::JProperties::write ( std::ostream &  out) const
inline

Write the current parameter values.

The output format is

[<key><sub>]<key><sep><value><eol> [<key><sub>]<key><sep><value><eol>

in this, white spaces are omitted.

Parameters
outoutput stream
Returns
output stream

Definition at line 833 of file JProperties.hh.

834  {
835  using namespace std;
836 
837  for (const_iterator i = begin(); i != end(); ++i) {
838 
839  char c = ' ';
840 
841  if (i->second->is_properties()) {
842  c = getDefaultDivision ();
843  } else {
844  c = getDefaultSeparator();
845  }
846 
847  i->second->write(out, (i->first + c).c_str(), getDefaultEndOfLine());
848  }
849 
850  out << flush;
851 
852  return out;
853  }
const char getDefaultSeparator() const
Get default separator character.
const char getDefaultDivision() const
Get default division character.
const char getDefaultEndOfLine() const
Get default end of line character.
std::ostream& JEEP::JProperties::write ( std::ostream &  out,
const std::string &  format 
)
inline

Write to output stream according given format.

For each key in the format specification, a corresponding value will be written to the output stream.

Parameters
outoutput stream
formatformat
Returns
output stream

Definition at line 866 of file JProperties.hh.

867  {
868  using namespace std;
869 
870  istringstream is(format);
871 
872  vector<string> buffer;
873 
874  for (string key; is >> key; ) {
875  buffer.push_back(key);
876  }
877 
878  return write(out, buffer.begin(), buffer.end());
879  }
std::ostream & write(std::ostream &out) const
Write the current parameter values.
Definition: JProperties.hh:833
template<class T >
std::ostream& JEEP::JProperties::write ( std::ostream &  out,
__begin,
__end 
)
inline

Write to output stream according given format.

For each key in the format specification, a corresponding value will be written to the output stream.

Parameters
outoutput stream
__beginbegin of format
__endend of format
Returns
output stream

Definition at line 894 of file JProperties.hh.

895  {
896  using namespace std;
897 
898  for (T i = __begin; i != __end; ++i) {
899 
900  iterator p = find(*i);
901 
902  if (p != end()) {
903 
904  out << getDefaultWhiteSpace();
905 
906  p->second->write(out);
907 
908  } else {
909 
910  WARNING("JProperties::write(): unknown key <" << *i << ">" << endl);
911  }
912  }
913 
914  return out;
915  }
#define WARNING(A)
Definition: JMessage.hh:63
const char getDefaultWhiteSpace() const
Get default white space character.
std::string JEEP::JProperties::sed ( const std::string &  format,
const std::string &  prefix = "",
const std::string &  postfix = "" 
)
inline

Stream editing of input format.

For each key in the format specification, a corresponding value will be written to the output stream.

Parameters
formatformat
prefixprefix key word
postfixpostfix key word
Returns
output stream

Definition at line 929 of file JProperties.hh.

932  {
933  using namespace std;
934 
935  string buffer = format;
936 
937  for (iterator i = begin(); i != end(); ++i) {
938 
939  string::size_type ipos = 0;
940 
941  while ((ipos = buffer.find(prefix + i->first + postfix, ipos)) != string::npos) {
942 
943  ostringstream out;
944 
945  i->second->write(out);
946 
947  buffer.replace(ipos, prefix.length() + i->first.length() + postfix.length(), out.str());
948  }
949  }
950 
951  return buffer;
952  }
template<class T >
const T& JEEP::JProperties::getValue ( const std::string &  key) const
inline

Get value.

Parameters
keykey
Returns
value of this JPropertiesElement

Definition at line 962 of file JProperties.hh.

963  {
964  const_iterator i = find(key);
965 
966  if (i != end())
967  return i->second.getValue<T>();
968  else
969  THROW(JPropertiesException, "Key <" << key << "> not found at JPropertiesElement::getValue()");
970  }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:633
template<class T >
T& JEEP::JProperties::getValue ( const std::string &  key)
inline

Get value.

Parameters
keykey
Returns
value of this JPropertiesElement

Definition at line 980 of file JProperties.hh.

981  {
982  iterator i = find(key);
983 
984  if (i != end())
985  return i->second.getValue<T>();
986  else
987  THROW(JPropertiesException, "Key <" << key << "> not found at JPropertiesElement::getValue()");
988  }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:633
template<class T >
void JEEP::JProperties::setValue ( const std::string &  key,
const T &  value 
)
inline

Set value.

Parameters
keykey
valuevalue

Definition at line 998 of file JProperties.hh.

999  {
1000  iterator i = find(key);
1001 
1002  if (i != end())
1003  return i->second.setValue<T>(value);
1004  else
1005  THROW(JPropertiesException, "Key <" << key << "> not found at JPropertiesElement::setValue()");
1006  }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:633
std::string JEEP::JProperties::getString ( const std::string &  key) const
inline

Get string value.

Parameters
keykey
Returns
value

Definition at line 1015 of file JProperties.hh.

1016  {
1017  const_iterator i = find(key);
1018 
1019  if (i != end())
1020  return i->second.toString();
1021  else
1022  THROW(JPropertiesException, "Key <" << key << "> not found at JPropertiesElement::getString()");
1023  }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:633
std::ostream& JEEP::JProperties::print ( std::ostream &  out) const
inline

Print the current parameter values.

Parameters
outoutput stream
Returns
output stream

Definition at line 1032 of file JProperties.hh.

1033  {
1034  write(out);
1035 
1036  return out;
1037  }
std::ostream & write(std::ostream &out) const
Write the current parameter values.
Definition: JProperties.hh:833
const JEquationParameters& JLANG::JEquationParameters::getEquationParameters ( ) const
inlineinherited

Get equation parameters.

Returns
equation parameters

Definition at line 71 of file JEquationParameters.hh.

72  {
73  return *this;
74  }
void JLANG::JEquationParameters::setEquationParameters ( const JEquationParameters buffer)
inlineinherited

Set equation parameters.

Parameters
bufferequation parameters

Definition at line 82 of file JEquationParameters.hh.

83  {
84  static_cast<JEquationParameters&>(*this) = buffer;
85  }
Simple data structure to support I/O of equations (see class JLANG::JEquation).
const char JLANG::JEquationParameters::getDefaultSeparator ( ) const
inlineinherited

Get default separator character.

Returns
separator between parameter and its value

Definition at line 93 of file JEquationParameters.hh.

94  {
95  if (sep.empty())
96  return '=';
97  else
98  return sep[0];
99  }
const std::string& JLANG::JEquationParameters::getSeparator ( ) const
inlineinherited

Get separator characters.

Returns
separator between parameter and its value

Definition at line 107 of file JEquationParameters.hh.

108  {
109  return sep;
110  }
void JLANG::JEquationParameters::setSeparator ( const std::string &  sep)
inlineinherited

Set separator character(s).

Parameters
sepseparator between parameter and its value

Definition at line 118 of file JEquationParameters.hh.

119  {
120  this->sep = sep;
121  }
const char JLANG::JEquationParameters::getDefaultEndOfLine ( ) const
inlineinherited

Get default end of line character.

Returns
end of line character

Definition at line 129 of file JEquationParameters.hh.

130  {
131  if (eol.empty())
132  return '\n';
133  else
134  return eol[0];
135  }
const char JLANG::JEquationParameters::getPreferredEndOfLine ( const unsigned int  index) const
inlineinherited

Get preferred end of line character.

Parameters
indexindex
Returns
end of line character

Definition at line 144 of file JEquationParameters.hh.

145  {
146  if (eol.empty())
147  return '\n';
148  else if (index < eol.size())
149  return eol[index];
150  else
151  return eol[0];
152  }
const std::string& JLANG::JEquationParameters::getEndOfLine ( ) const
inlineinherited

Get end of line characters.

Returns
end of line characters

Definition at line 160 of file JEquationParameters.hh.

161  {
162  return eol;
163  }
void JLANG::JEquationParameters::setEndOfLine ( const std::string &  eol)
inlineinherited

Set end of line characters.

Parameters
eolend of line character

Definition at line 171 of file JEquationParameters.hh.

172  {
173  this->eol = eol;
174  }
const char JLANG::JEquationParameters::getDefaultDivision ( ) const
inlineinherited

Get default division character.

Returns
division character

Definition at line 182 of file JEquationParameters.hh.

183  {
184  if (div.empty())
185  return '.';
186  else
187  return div[0];
188  }
const std::string& JLANG::JEquationParameters::getDivision ( ) const
inlineinherited

Get division characters.

Returns
division characters

Definition at line 196 of file JEquationParameters.hh.

197  {
198  return div;
199  }
void JLANG::JEquationParameters::setDivision ( const std::string &  div)
inlineinherited

Set division characters.

Parameters
divdivision characters

Definition at line 207 of file JEquationParameters.hh.

208  {
209  this->div = div;
210  }
const char JLANG::JEquationParameters::getDefaultSkipLine ( ) const
inlineinherited

Get default skip line character.

Returns
skip line character

Definition at line 218 of file JEquationParameters.hh.

219  {
220  if (skip.empty())
221  return '#';
222  else
223  return skip[0];
224  }
const std::string& JLANG::JEquationParameters::getSkipLine ( ) const
inlineinherited

Get skip line characters.

Returns
skip line characters

Definition at line 232 of file JEquationParameters.hh.

233  {
234  return skip;
235  }
void JLANG::JEquationParameters::setSkipLine ( const std::string &  skip)
inlineinherited

Set skip line characters.

Parameters
skipskip line characters

Definition at line 243 of file JEquationParameters.hh.

244  {
245  this->skip = skip;
246  }
void JLANG::JEquationParameters::setBrackets ( const char  left,
const char  right 
)
inlineinherited

Set brackets.

Parameters
leftleft bracket
rightright bracket

Definition at line 255 of file JEquationParameters.hh.

256  {
257  this->left = left;
258  this->right = right;
259  }
char JLANG::JEquationParameters::getLeftBracket ( ) const
inlineinherited

Get left bracket.

Returns
left bracket

Definition at line 267 of file JEquationParameters.hh.

268  {
269  return left;
270  }
char JLANG::JEquationParameters::getRightBracket ( ) const
inlineinherited

Get right bracket.

Returns
right bracket

Definition at line 278 of file JEquationParameters.hh.

279  {
280  return right;
281  }
const char JLANG::JEquationParameters::getDefaultWhiteSpace ( ) const
inlineinherited

Get default white space character.

Returns
white space character

Definition at line 289 of file JEquationParameters.hh.

290  {
291  if (ws.empty())
292  return ' ';
293  else
294  return ws[0];
295  }
const std::string& JLANG::JEquationParameters::getWhiteSpace ( ) const
inlineinherited

Get white space characters.

Returns
white space characters

Definition at line 303 of file JEquationParameters.hh.

304  {
305  return ws;
306  }
void JLANG::JEquationParameters::setWhiteSpace ( const std::string &  ws)
inlineinherited

Set white space characters.

Parameters
wswhite space characters

Definition at line 314 of file JEquationParameters.hh.

315  {
316  this->ws = ws;
317  }
JEquationParameters& JLANG::JEquationParameters::join ( const JEquationParameters value)
inlineinherited

Join equation parameters.

Parameters
valueequation parameters

Definition at line 325 of file JEquationParameters.hh.

326  {
327  using namespace std;
328 
329  for (string::const_iterator i = value.sep.begin(); i != value.sep.end(); ++i) {
330  if (!isSeparator(*i)) {
331  sep += *i;
332  }
333  }
334 
335  for (string::const_iterator i = value.eol.begin(); i != value.eol.end(); ++i) {
336  if (!isEndOfLine(*i)) {
337  eol += *i;
338  }
339  }
340 
341  for (string::const_iterator i = value.div.begin(); i != value.div.end(); ++i) {
342  if (!isDivision(*i)) {
343  div += *i;
344  }
345  }
346 
347  for (string::const_iterator i = value.skip.begin(); i != value.skip.end(); ++i) {
348  if (!isSkipLine(*i)) {
349  skip += *i;
350  }
351  }
352 
353  for (string::const_iterator i = value.ws.begin(); i != value.ws.end(); ++i) {
354  if (!isWhiteSpace(*i)) {
355  ws += *i;
356  }
357  }
358 
359  return *this;
360  }
bool isEndOfLine(const char c) const
Test for end of line character.
bool isWhiteSpace(const char c) const
Test for white space character.
bool isSkipLine(const char c) const
Test for skip line character.
bool isSeparator(const char c) const
Test for separator character.
bool isDivision(const char c) const
Test for division character.
bool JLANG::JEquationParameters::isSeparator ( const char  c) const
inlineinherited

Test for separator character.

Parameters
ccharacter
Returns
true if separator; else false

Definition at line 369 of file JEquationParameters.hh.

370  {
371  return sep .find(c) != std::string::npos;
372  }
bool JLANG::JEquationParameters::isEndOfLine ( const char  c) const
inlineinherited

Test for end of line character.

Parameters
ccharacter
Returns
true if end of line; else false

Definition at line 381 of file JEquationParameters.hh.

381 { return eol .find(c) != std::string::npos; }
bool JLANG::JEquationParameters::isDivision ( const char  c) const
inlineinherited

Test for division character.

Parameters
ccharacter
Returns
true if division; else false

Definition at line 390 of file JEquationParameters.hh.

391  {
392  return div .find(c) != std::string::npos;
393  }
bool JLANG::JEquationParameters::isSkipLine ( const char  c) const
inlineinherited

Test for skip line character.

Parameters
ccharacter
Returns
true if skip line; else false

Definition at line 402 of file JEquationParameters.hh.

403  {
404  return skip.find(c) != std::string::npos;
405  }
bool JLANG::JEquationParameters::isLeftBracket ( const char  c) const
inlineinherited

Test for left bracket character.

Parameters
ccharacter
Returns
true if left bracket; else false

Definition at line 414 of file JEquationParameters.hh.

415  {
416  return c == left;
417  }
bool JLANG::JEquationParameters::isRightBracket ( const char  c) const
inlineinherited

Test for right bracket character.

Parameters
ccharacter
Returns
true if right bracket; else false

Definition at line 426 of file JEquationParameters.hh.

427  {
428  return c == right;
429  }
bool JLANG::JEquationParameters::isWhiteSpace ( const char  c) const
inlineinherited

Test for white space character.

Parameters
ccharacter
Returns
true if white space; else false

Definition at line 438 of file JEquationParameters.hh.

439  {
440  return ws .find(c) != std::string::npos;
441  }

Friends And Related Function Documentation

std::istream& operator>> ( std::istream &  in,
JProperties properties 
)
friend

Stream input.

Parameters
ininput stream
propertiesproperties
Returns
input stream

Definition at line 1047 of file JProperties.hh.

1048  {
1049  return properties.read(in);
1050  }
bool read(const JEquation &equation)
Read equation.
Definition: JProperties.hh:665
std::ostream& operator<< ( std::ostream &  out,
const JProperties properties 
)
friend

Stream output.

Parameters
outoutput stream
propertiesproperties
Returns
output stream

Definition at line 1060 of file JProperties.hh.

1061  {
1062  return properties.write(out);
1063  }
std::ostream & write(std::ostream &out) const
Write the current parameter values.
Definition: JProperties.hh:833

Member Data Documentation

std::string JLANG::JEquationParameters::sep
protectedinherited

Definition at line 444 of file JEquationParameters.hh.

std::string JLANG::JEquationParameters::eol
protectedinherited

Definition at line 445 of file JEquationParameters.hh.

std::string JLANG::JEquationParameters::div
protectedinherited

Definition at line 446 of file JEquationParameters.hh.

std::string JLANG::JEquationParameters::skip
protectedinherited

Definition at line 447 of file JEquationParameters.hh.

char JLANG::JEquationParameters::left
protectedinherited

Definition at line 448 of file JEquationParameters.hh.

char JLANG::JEquationParameters::right
protectedinherited

Definition at line 449 of file JEquationParameters.hh.

std::string JLANG::JEquationParameters::ws
protectedinherited

Definition at line 450 of file JEquationParameters.hh.

int JEEP::JMessage< JProperties >::debug
staticinherited

debug level (default is off).

Definition at line 43 of file JMessage.hh.


The documentation for this class was generated from the following file: