UNIVERS
15.3
UNIVERS base processing software API
|
#include <textfile_parser.hpp>
Public Member Functions | |
virtual void | set_value (const char *)=0 throw (param_exception) |
const std::string & | get_name () const |
bool | is_inited () const |
bool | is_unique () const |
Protected Member Functions | |
Parameter (const char *name, bool unique=true) | |
Protected Attributes | |
bool | is_init |
bool | is_uniq |
const TextFileParser * | parser |
Friends | |
class | TextFileParser |
Abstract class for TextFileParser. This class represents parameter with it's value in text file. Parameter with it's value represented as pair of first word (token) and all remaining string before character '#' on current line. This first word is a parameter's name and other string is a parameters' value. For example:
velocity 34 # This is velocity of the vehicle.
In this example velocity is a parameter's name and 34 is a parameter's value. Part of string after '#' character is ignored. Functions of Parameter class is in keeping parameter's name and parsing parameter's value from given charstring (see set_value() method). You can't create instances of this class directly. You should create your own subclasses for specific parameters or use ready subclasses for primitive types (See Int_Parameter class for example).
|
protected |
Constructor of this class is protected.
name | Parameter's name |
unique | Give false here, if multiple parameters with this name are accepted. |
|
inline |
Returns parameter's name.
|
inline |
Returns true, if parameter was already read during current parse operation. Inner flag sets to true automatically by TextFileParser.
|
inline |
Returns true if parameter with such name must be unique in text file. (This feature of parameter specifies in constructor)
|
pure virtual |
Method for parsing value from given char string. (See example in Int_Parameter class)
Implemented in CharUndelimString_Parameter, CharString_Parameter, UnsignedDouble_Parameter, Double_Parameter, UnsignedInt_Parameter, and Int_Parameter.