Jpp
|
General purpose equation class. More...
#include <JEquation.hh>
Classes | |
struct | equation_type |
Auxiliary data structure for equation. More... | |
Public Member Functions | |
JEquation () | |
Default constructor. More... | |
JEquation (const std::string &buffer, const JEquationFacet &facet) | |
Constructor. More... | |
const std::string & | getKey () const |
Get key. More... | |
const char | getSeparator () const |
Get separator. More... | |
const std::string & | getValue () const |
Get value. More... | |
JEquation & | setEquation (const std::string &buffer, const JEquationFacet &facet) |
Set equation. More... | |
JEquation & | setEquation (const JEquationFacet &facet) |
Set this equation to its value. More... | |
std::string | toString () const |
Convert equation to string. More... | |
Static Public Member Functions | |
template<class T > | |
static equation_type< T > | make_equation (const std::string &key, const T &value) |
Auxiliary method to create equation type. More... | |
static JEquation | valueOf (const std::string &buffer, const JEquationFacet &facet) |
Extract equation. More... | |
Protected Attributes | |
JString | key |
char | sep |
JString | value |
Friends | |
std::istream & | operator>> (std::istream &in, JEquation &equation) |
Read equation from input stream. More... | |
std::ostream & | operator<< (std::ostream &out, const JEquation &equation) |
Write equation to output stream. More... | |
General purpose equation class.
An equation could have the following formats:
<skip line> "comment" <end of line> <skip line> "comment" <end of line> <key> <separator> <value> <end of line> <key> <separator> <left bracket> <value> <value> <right bracket> <end of line> <key><division><key> <separator> <value> <end of line>
In this:
key
is the key of the equation;value
is the value of the equation; and' '
could be any of the specified white space characters.In case of a division of the key, the value of the equation will include the following key up to the end of line. The special characters are defined in the JEquationParameters class. The use of this class for I/O is handled via the JEquationFacet class.
Definition at line 47 of file JEquation.hh.
|
inline |
|
inline |
Constructor.
facet | facet |
buffer | input |
Definition at line 139 of file JEquation.hh.
|
inlinestatic |
Auxiliary method to create equation type.
key | key |
value | value |
Definition at line 117 of file JEquation.hh.
|
inline |
|
inline |
|
inline |
|
inline |
Set equation.
buffer | input |
facet | facet |
Definition at line 304 of file JEquation.hh.
|
inline |
Set this equation to its value.
facet | facet |
Definition at line 324 of file JEquation.hh.
|
inlinestatic |
Extract equation.
buffer | input |
facet | facet |
Definition at line 339 of file JEquation.hh.
|
inline |
Convert equation to string.
Definition at line 350 of file JEquation.hh.
|
friend |
Read equation from input stream.
in | input stream |
equation | equation |
Definition at line 185 of file JEquation.hh.
|
friend |
Write equation to output stream.
out | output stream |
equation | equation |
Definition at line 265 of file JEquation.hh.
|
protected |
Definition at line 362 of file JEquation.hh.
|
protected |
Definition at line 363 of file JEquation.hh.
|
protected |
Definition at line 364 of file JEquation.hh.