Jpp 19.3.0-rc.1
the software that should make you happy
Loading...
Searching...
No Matches
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 > JAANET::JEvtCategoryMap< JEvtWeightFactorProduct >::JEvtCategoryMapHelper JAANET::JEvtCategoryMap< JFluxHelper >::JEvtCategoryMapHelper JAANET::JEvtWeightFactorConstant< JEvtWeightFactor_t >::JEvtWeightFactorConstantHelper JAANET::JEvtWeightFactorFunction< Flux_Atmospheric, JDiffuseFlux >::JFluxFunctionHelper JAANET::JEvtWeightFactorMeffRatio::JEvtWeightFactorMeffRatioHelper JAANET::JEvtWeightFactorProduct::JEvtWeightFactorProductHelper JAANET::JEvtWeightFactorTFormula::JEvtWeightFactorTFormulaHelper JAANET::JHondaFluxInterpolator< JPhiFunction_t, JCoszFunctionalMap_t, JEnergyFunctionalMap_t >::JHondaFluxInterpolatorHelper JAANET::JHondaFluxInterpolator< JConstantFunction1D< double, JArray< 4, double > >, JCoszFunctionalMap_t, JEnergyFunctionalMap_t >::JHondaFluxInterpolatorHelper JAANET::JMuonBundleCategory::JMuonBundleCategoryHelper JAANET::JNeutrinoInteractionCategory::JNeutrinoInteractionCategoryHelper JAANET::JOscFlux::JOscFluxHelper JAANET::JPowerLawFlux::JPowerLawFluxHelper JCOMPAREHISTOGRAMS::JTestSummary::JTestSummaryHelper JDETECTOR::JDetectorHeader::JDetectorHeaderHelper JDETECTOR::JDetectorParametersHelper JDETECTOR::JPMTParameters::JPMTParametersHelper JOSCPROB::JOscChannel::JOscChannelHelper JOSCPROB::JOscParameters< T >::JOscParametersHelper JOSCPROB::JOscProbInterpolator< JCollection_t, JFunction1D_t, JFunctionalMaplist_t >::JOscProbInterpolatorHelper JROOT::JStyle::JParameters::JParametersHelper

Classes

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

Public Types

typedef std::map< std::string, JPropertiesElementJMap_t
 

Public Member Functions

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

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).
 

Static Public Attributes

static int debug
 debug level (default is off).
 

Protected Attributes

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

Friends

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

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);
Utility class to parse parameter values.
Utility class to parse parameter values.
std::ostream & write(std::ostream &out) const
Write the current parameter values.
bool read(const JEquation &equation)
Read equation.

Definition at line 497 of file JProperties.hh.

Member Typedef Documentation

◆ JMap_t

Definition at line 504 of file JProperties.hh.

Constructor & Destructor Documentation

◆ JProperties() [1/2]

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

Constructor.

Parameters
debugdebug level

Definition at line 621 of file JProperties.hh.

621 :
622 JMap_t(),
624 {
625 this->debug = debug;
626 }
std::map< std::string, JPropertiesElement > JMap_t
JEquationParameters()
Default constructor.

◆ JProperties() [2/2]

JEEP::JProperties::JProperties ( const JEquationParameters & parameters,
const int debug = 0 )
inline

Constructor.

Parameters
parametersequation parameters
debugdebug level

Definition at line 635 of file JProperties.hh.

636 :
637 JMap_t(),
638 JEquationParameters(parameters)
639 {
640 this->debug = debug;
641 }

Member Function Documentation

◆ getKey()

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 516 of file JProperties.hh.

517 {
518 using namespace std;
519
520 const size_type pos = buffer.find_last_of(sep);
521
522 if (pos != string::npos)
523 return buffer.substr(pos + 1);
524 else
525 return buffer;
526 }

◆ put()

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 651 of file JProperties.hh.

652 {
653 this->insert(value_type(key, JPropertiesElement(object)));
654 }

◆ join() [1/2]

JProperties & JEEP::JProperties::join ( const JProperties & properties)
inline

Join properties objects.

Parameters
propertiesproperties
Returns
properties

Definition at line 663 of file JProperties.hh.

664 {
665 JEquationParameters::join(properties);
666
667 insert(properties.begin(), properties.end());
668
669 return *this;
670 }
JEquationParameters & join(const JEquationParameters &value)
Join equation parameters.

◆ read() [1/5]

bool JEEP::JProperties::read ( const JEquation & equation)
inline

Read equation.

Parameters
equationequation
Returns
status

Definition at line 679 of file JProperties.hh.

680 {
681 using namespace std;
682
683 iterator p = find(equation.getKey());
684
685 DEBUG("Processing key: " << equation.getKey() << ' ' << (p != end()) << endl);
686
687 if (p != end()) {
688
689 istringstream is(equation.getValue());
690
691 if (isDivision(equation.getSeparator())) {
692
693 if (p->second->is_properties()) {
694
695 p->second->read(is);
696
697 } else {
698
699 ERROR("JProperties::read(): no properties object after division <" << equation.getKey() << ">" << endl);
700 }
701
702 } else if (isSeparator(equation.getSeparator())) {
703
704 try {
705 p->second->read(is);
706 }
707 catch(const exception& error) {
708 ERROR("JProperties::read(): read error at key <" << equation.getKey() << "> " << error.what() << endl);
709 }
710
711 } else {
712
713 ERROR("JProperties::read(): illegal character following key <" << equation.getKey() << "> " << equation.getSeparator() << endl);
714 }
715
716 if (p->second.getEndMarker()) {
717 return false;
718 }
719
720 if (fail(is)) {
721
722 ERROR("JProperties::read(): error reading data for key <" << equation.getKey() << "> " << equation.getValue() << endl);
723 }
724
725 } else {
726
727 WARNING("JProperties::read(): unknown key <" << equation.getKey() << ">" << endl);
728 }
729
730 return true;
731 }
#define DEBUG(A)
Message macros.
Definition JMessage.hh:62
#define ERROR(A)
Definition JMessage.hh:66
#define WARNING(A)
Definition JMessage.hh:65
bool isSeparator(const char c) const
Test for separator character.
bool isDivision(const char c) const
Test for division character.
bool fail(std::istream &in)
Check for stream state.

◆ read() [2/5]

bool JEEP::JProperties::read ( const std::string & buffer)
inline

Read from input string.

Parameters
bufferinput string
Returns
read status

Definition at line 740 of file JProperties.hh.

741 {
742 std::istringstream in(buffer);
743
744 return !fail(read(in));
745 }

◆ read() [3/5]

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 762 of file JProperties.hh.

763 {
764 using namespace std;
765
766 in.imbue(locale(in.getloc(), new JEquationFacet(*this)));
767
768 for (JEquation equation; in >> equation && read(equation); ) {}
769
770 return in;
771 }

◆ read() [4/5]

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 784 of file JProperties.hh.

785 {
786 using namespace std;
787
788 istringstream is(format);
789
790 vector<string> buffer;
791
792 for (string key; is >> key; ) {
793 buffer.push_back(key);
794 }
795
796 return read(in, buffer.begin(), buffer.end());
797 }

◆ read() [5/5]

template<class T >
std::istream & JEEP::JProperties::read ( std::istream & in,
T __begin,
T __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 812 of file JProperties.hh.

813 {
814 using namespace std;
815
816 for (T i = __begin; i != __end; ++i) {
817
818 iterator p = find(*i);
819
820 if (p != end()) {
821
822 p->second->read(in);
823
824 } else {
825
826 WARNING("JProperties::read(): unknown key <" << *i << ">" << endl);
827 }
828 }
829
830 return in;
831 }

◆ write() [1/3]

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 847 of file JProperties.hh.

848 {
849 using namespace std;
850
851 for (const_iterator i = begin(); i != end(); ++i) {
852
853 char c = ' ';
854
855 if (i->second->is_properties()) {
856 c = getDefaultDivision ();
857 } else {
859 }
860
861 i->second->write(out, (i->first + c).c_str(), getDefaultEndOfLine());
862 }
863
864 out << flush;
865
866 return out;
867 }
const char getDefaultSeparator() const
Get default separator character.
const char getDefaultEndOfLine() const
Get default end of line character.
const char getDefaultDivision() const
Get default division character.

◆ write() [2/3]

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 880 of file JProperties.hh.

881 {
882 using namespace std;
883
884 istringstream is(format);
885
886 vector<string> buffer;
887
888 for (string key; is >> key; ) {
889 buffer.push_back(key);
890 }
891
892 return write(out, buffer.begin(), buffer.end());
893 }

◆ write() [3/3]

template<class T >
std::ostream & JEEP::JProperties::write ( std::ostream & out,
T __begin,
T __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 908 of file JProperties.hh.

909 {
910 using namespace std;
911
912 for (T i = __begin; i != __end; ++i) {
913
914 iterator p = find(*i);
915
916 if (p != end()) {
917
918 out << getDefaultWhiteSpace();
919
920 p->second->write(out);
921
922 } else {
923
924 WARNING("JProperties::write(): unknown key <" << *i << ">" << endl);
925 }
926 }
927
928 return out;
929 }
const char getDefaultWhiteSpace() const
Get default white space character.

◆ sed()

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 943 of file JProperties.hh.

946 {
947 using namespace std;
948
949 string buffer = format;
950
951 for (iterator i = begin(); i != end(); ++i) {
952
953 string::size_type ipos = 0;
954
955 while ((ipos = buffer.find(prefix + i->first + postfix, ipos)) != string::npos) {
956
957 ostringstream out;
958
959 i->second->write(out);
960
961 buffer.replace(ipos, prefix.length() + i->first.length() + postfix.length(), out.str());
962 }
963 }
964
965 return buffer;
966 }

◆ getValue() [1/2]

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 976 of file JProperties.hh.

977 {
978 const_iterator i = find(key);
979
980 if (i != end())
981 return i->second.getValue<T>();
982 else
983 THROW(JPropertiesException, "Key <" << key << "> not found at JPropertiesElement::getValue()");
984 }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.

◆ getValue() [2/2]

template<class T >
T & JEEP::JProperties::getValue ( const std::string & key)
inline

Get value.

Parameters
keykey
Returns
value of this JPropertiesElement

Definition at line 994 of file JProperties.hh.

995 {
996 iterator i = find(key);
997
998 if (i != end())
999 return i->second.getValue<T>();
1000 else
1001 THROW(JPropertiesException, "Key <" << key << "> not found at JPropertiesElement::getValue()");
1002 }

◆ setValue()

template<class T >
void JEEP::JProperties::setValue ( const std::string & key,
const T & value )
inline

Set value.

Parameters
keykey
valuevalue

Definition at line 1012 of file JProperties.hh.

1013 {
1014 iterator i = find(key);
1015
1016 if (i != end())
1017 return i->second.setValue<T>(value);
1018 else
1019 THROW(JPropertiesException, "Key <" << key << "> not found at JPropertiesElement::setValue()");
1020 }

◆ getString()

std::string JEEP::JProperties::getString ( const std::string & key) const
inline

Get string value.

Parameters
keykey
Returns
value

Definition at line 1029 of file JProperties.hh.

1030 {
1031 const_iterator i = find(key);
1032
1033 if (i != end())
1034 return i->second.toString();
1035 else
1036 THROW(JPropertiesException, "Key <" << key << "> not found at JPropertiesElement::getString()");
1037 }

◆ print()

std::ostream & JEEP::JProperties::print ( std::ostream & out) const
inline

Print the current parameter values.

Parameters
outoutput stream
Returns
output stream

Definition at line 1046 of file JProperties.hh.

1047 {
1048 write(out);
1049
1050 return out;
1051 }

◆ getEquationParameters()

const JEquationParameters & JLANG::JEquationParameters::getEquationParameters ( ) const
inlineinherited

Get equation parameters.

Returns
equation parameters

Definition at line 75 of file JEquationParameters.hh.

76 {
77 return *this;
78 }

◆ setEquationParameters()

void JLANG::JEquationParameters::setEquationParameters ( const JEquationParameters & buffer)
inlineinherited

Set equation parameters.

Parameters
bufferequation parameters

Definition at line 86 of file JEquationParameters.hh.

87 {
88 static_cast<JEquationParameters&>(*this) = buffer;
89 }

◆ getDefaultSeparator()

const char JLANG::JEquationParameters::getDefaultSeparator ( ) const
inlineinherited

Get default separator character.

Returns
separator between parameter and its value

Definition at line 97 of file JEquationParameters.hh.

98 {
99 if (sep.empty())
100 return '=';
101 else
102 return sep[0];
103 }

◆ getSeparator() [1/2]

const std::string & JLANG::JEquationParameters::getSeparator ( ) const
inlineinherited

Get separator characters.

Returns
separator between parameter and its value

Definition at line 111 of file JEquationParameters.hh.

112 {
113 return sep;
114 }

◆ getSeparator() [2/2]

std::string & JLANG::JEquationParameters::getSeparator ( )
inlineinherited

Get separator characters.

Returns
separator between parameter and its value

Definition at line 122 of file JEquationParameters.hh.

123 {
124 return sep;
125 }

◆ setSeparator()

void JLANG::JEquationParameters::setSeparator ( const std::string & sep)
inlineinherited

Set separator character(s).

Parameters
sepseparator between parameter and its value

Definition at line 133 of file JEquationParameters.hh.

134 {
135 this->sep = sep;
136 }

◆ getDefaultEndOfLine()

const char JLANG::JEquationParameters::getDefaultEndOfLine ( ) const
inlineinherited

Get default end of line character.

Returns
end of line character

Definition at line 144 of file JEquationParameters.hh.

145 {
146 if (eol.empty())
147 return '\n';
148 else
149 return eol[0];
150 }

◆ getPreferredEndOfLine()

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 159 of file JEquationParameters.hh.

160 {
161 if (eol.empty())
162 return '\n';
163 else if (index < eol.size())
164 return eol[index];
165 else
166 return eol[0];
167 }

◆ getEndOfLine() [1/2]

const std::string & JLANG::JEquationParameters::getEndOfLine ( ) const
inlineinherited

Get end of line characters.

Returns
end of line characters

Definition at line 175 of file JEquationParameters.hh.

176 {
177 return eol;
178 }

◆ getEndOfLine() [2/2]

std::string & JLANG::JEquationParameters::getEndOfLine ( )
inlineinherited

Get end of line characters.

Returns
end of line characters

Definition at line 186 of file JEquationParameters.hh.

187 {
188 return eol;
189 }

◆ setEndOfLine()

void JLANG::JEquationParameters::setEndOfLine ( const std::string & eol)
inlineinherited

Set end of line characters.

Parameters
eolend of line character

Definition at line 197 of file JEquationParameters.hh.

198 {
199 this->eol = eol;
200 }

◆ getDefaultDivision()

const char JLANG::JEquationParameters::getDefaultDivision ( ) const
inlineinherited

Get default division character.

Returns
division character

Definition at line 208 of file JEquationParameters.hh.

209 {
210 if (div.empty())
211 return '.';
212 else
213 return div[0];
214 }

◆ getDivision() [1/2]

const std::string & JLANG::JEquationParameters::getDivision ( ) const
inlineinherited

Get division characters.

Returns
division characters

Definition at line 222 of file JEquationParameters.hh.

223 {
224 return div;
225 }

◆ getDivision() [2/2]

std::string & JLANG::JEquationParameters::getDivision ( )
inlineinherited

Get division characters.

Returns
division characters

Definition at line 233 of file JEquationParameters.hh.

234 {
235 return div;
236 }

◆ setDivision()

void JLANG::JEquationParameters::setDivision ( const std::string & div)
inlineinherited

Set division characters.

Parameters
divdivision characters

Definition at line 244 of file JEquationParameters.hh.

245 {
246 this->div = div;
247 }

◆ getDefaultSkipLine()

const char JLANG::JEquationParameters::getDefaultSkipLine ( ) const
inlineinherited

Get default skip line character.

Returns
skip line character

Definition at line 255 of file JEquationParameters.hh.

256 {
257 if (skip.empty())
258 return '#';
259 else
260 return skip[0];
261 }

◆ getSkipLine() [1/2]

const std::string & JLANG::JEquationParameters::getSkipLine ( ) const
inlineinherited

Get skip line characters.

Returns
skip line characters

Definition at line 269 of file JEquationParameters.hh.

270 {
271 return skip;
272 }

◆ getSkipLine() [2/2]

std::string & JLANG::JEquationParameters::getSkipLine ( )
inlineinherited

Get skip line characters.

Returns
skip line characters

Definition at line 280 of file JEquationParameters.hh.

281 {
282 return skip;
283 }

◆ setSkipLine()

void JLANG::JEquationParameters::setSkipLine ( const std::string & skip)
inlineinherited

Set skip line characters.

Parameters
skipskip line characters

Definition at line 291 of file JEquationParameters.hh.

292 {
293 this->skip = skip;
294 }

◆ setBrackets()

void JLANG::JEquationParameters::setBrackets ( const char left,
const char right )
inlineinherited

Set brackets.

Parameters
leftleft bracket
rightright bracket

Definition at line 303 of file JEquationParameters.hh.

◆ getLeftBracket() [1/2]

char JLANG::JEquationParameters::getLeftBracket ( ) const
inlineinherited

Get left bracket.

Returns
left bracket

Definition at line 315 of file JEquationParameters.hh.

316 {
317 return left;
318 }

◆ getLeftBracket() [2/2]

char & JLANG::JEquationParameters::getLeftBracket ( )
inlineinherited

Get left bracket.

Returns
left bracket

Definition at line 326 of file JEquationParameters.hh.

327 {
328 return left;
329 }

◆ getRightBracket() [1/2]

char JLANG::JEquationParameters::getRightBracket ( ) const
inlineinherited

Get right bracket.

Returns
right bracket

Definition at line 337 of file JEquationParameters.hh.

338 {
339 return right;
340 }

◆ getRightBracket() [2/2]

char & JLANG::JEquationParameters::getRightBracket ( )
inlineinherited

Get right bracket.

Returns
right bracket

Definition at line 348 of file JEquationParameters.hh.

349 {
350 return right;
351 }

◆ getDefaultWhiteSpace()

const char JLANG::JEquationParameters::getDefaultWhiteSpace ( ) const
inlineinherited

Get default white space character.

Returns
white space character

Definition at line 359 of file JEquationParameters.hh.

360 {
361 if (ws.empty())
362 return ' ';
363 else
364 return ws[0];
365 }

◆ getWhiteSpace() [1/2]

const std::string & JLANG::JEquationParameters::getWhiteSpace ( ) const
inlineinherited

Get white space characters.

Returns
white space characters

Definition at line 373 of file JEquationParameters.hh.

374 {
375 return ws;
376 }

◆ getWhiteSpace() [2/2]

std::string & JLANG::JEquationParameters::getWhiteSpace ( )
inlineinherited

Get white space characters.

Returns
white space characters

Definition at line 384 of file JEquationParameters.hh.

385 {
386 return ws;
387 }

◆ setWhiteSpace()

void JLANG::JEquationParameters::setWhiteSpace ( const std::string & ws)
inlineinherited

Set white space characters.

Parameters
wswhite space characters

Definition at line 395 of file JEquationParameters.hh.

396 {
397 this->ws = ws;
398 }

◆ getComment() [1/2]

const std::string & JLANG::JEquationParameters::getComment ( ) const
inlineinherited

Get comment string.

Returns
comment string

Definition at line 406 of file JEquationParameters.hh.

407 {
408 return comment;
409 }

◆ getComment() [2/2]

std::string & JLANG::JEquationParameters::getComment ( )
inlineinherited

Get comment string.

Returns
comment string

Definition at line 417 of file JEquationParameters.hh.

418 {
419 return comment;
420 }

◆ setComment()

void JLANG::JEquationParameters::setComment ( const std::string & comment)
inlineinherited

Set comment string.

Parameters
commentcomment string

Definition at line 428 of file JEquationParameters.hh.

429 {
430 this->comment = comment;
431 }

◆ join() [2/2]

JEquationParameters & JLANG::JEquationParameters::join ( const JEquationParameters & value)
inlineinherited

Join equation parameters.

Parameters
valueequation parameters

Definition at line 439 of file JEquationParameters.hh.

440 {
441 using namespace std;
442
443 for (string::const_iterator i = value.sep.begin(); i != value.sep.end(); ++i) {
444 if (!isSeparator(*i)) {
445 sep += *i;
446 }
447 }
448
449 for (string::const_iterator i = value.eol.begin(); i != value.eol.end(); ++i) {
450 if (!isEndOfLine(*i)) {
451 eol += *i;
452 }
453 }
454
455 for (string::const_iterator i = value.div.begin(); i != value.div.end(); ++i) {
456 if (!isDivision(*i)) {
457 div += *i;
458 }
459 }
460
461 for (string::const_iterator i = value.skip.begin(); i != value.skip.end(); ++i) {
462 if (!isSkipLine(*i)) {
463 skip += *i;
464 }
465 }
466
467 for (string::const_iterator i = value.ws.begin(); i != value.ws.end(); ++i) {
468 if (!isWhiteSpace(*i)) {
469 ws += *i;
470 }
471 }
472
473 return *this;
474 }
bool isEndOfLine(const char c) const
Test for end of line character.
bool isSkipLine(const char c) const
Test for skip line character.
bool isWhiteSpace(const char c) const
Test for white space character.

◆ isSeparator()

bool JLANG::JEquationParameters::isSeparator ( const char c) const
inlineinherited

Test for separator character.

Parameters
ccharacter
Returns
true if separator; else false

Definition at line 483 of file JEquationParameters.hh.

484 {
485 return sep .find(c) != std::string::npos;
486 }

◆ isEndOfLine()

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 495 of file JEquationParameters.hh.

495{ return eol .find(c) != std::string::npos; }

◆ isDivision()

bool JLANG::JEquationParameters::isDivision ( const char c) const
inlineinherited

Test for division character.

Parameters
ccharacter
Returns
true if division; else false

Definition at line 504 of file JEquationParameters.hh.

505 {
506 return div .find(c) != std::string::npos;
507 }

◆ isSkipLine()

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 516 of file JEquationParameters.hh.

517 {
518 return skip.find(c) != std::string::npos;
519 }

◆ isLeftBracket()

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 528 of file JEquationParameters.hh.

529 {
530 return c == left;
531 }

◆ isRightBracket()

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 540 of file JEquationParameters.hh.

541 {
542 return c == right;
543 }

◆ isWhiteSpace()

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 552 of file JEquationParameters.hh.

553 {
554 return ws .find(c) != std::string::npos;
555 }

Friends And Related Symbol Documentation

◆ operator>>

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

Stream input.

Parameters
ininput stream
propertiesproperties
Returns
input stream

Definition at line 1061 of file JProperties.hh.

1062 {
1063 return properties.read(in);
1064 }

◆ operator<<

std::ostream & operator<< ( std::ostream & out,
const JProperties & properties )
friend

Stream output.

Parameters
outoutput stream
propertiesproperties
Returns
output stream

Definition at line 1074 of file JProperties.hh.

1075 {
1076 return properties.write(out);
1077 }

Member Data Documentation

◆ sep

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

Definition at line 558 of file JEquationParameters.hh.

◆ eol

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

Definition at line 559 of file JEquationParameters.hh.

◆ div

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

Definition at line 560 of file JEquationParameters.hh.

◆ skip

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

Definition at line 561 of file JEquationParameters.hh.

◆ left

char JLANG::JEquationParameters::left
protectedinherited

Definition at line 562 of file JEquationParameters.hh.

◆ right

char JLANG::JEquationParameters::right
protectedinherited

Definition at line 563 of file JEquationParameters.hh.

◆ ws

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

Definition at line 564 of file JEquationParameters.hh.

◆ comment

std::string JLANG::JEquationParameters::comment
protectedinherited

Definition at line 565 of file JEquationParameters.hh.

◆ debug

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

debug level (default is off).

Definition at line 45 of file JMessage.hh.


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