![]() |
PVL: Parameter Value Language
|
A Parameter is a general-purpose, abstract, named parameter entity. More...
#include <Parameter.hh>
Public Types | |
typedef Integer | Default_Value |
Default Value type for an Assignment. | |
enum | MODE { Verbatim_Strings, Indenting, TOTAL_LOCAL_MODES } |
Mode selectors. More... | |
enum | MODE_STATE { MODE_FALSE = 0, MODE_TRUE = 1, MODE_INHERITED = 2 } |
States for local/inherited modes. More... | |
enum | Type { ASSIGNMENT = (Value::ARRAY << 1), TOKEN, AGGREGATE = (ASSIGNMENT << 1), GROUP, OBJECT, END = (AGGREGATE << 1), END_GROUP, END_OBJECT } |
Type specifications. More... | |
enum | WHICH_MODE { LOCAL_MODE_SET = 0, DEFAULT_MODE_SET = 1, RECURSIVE_MODE_SET = 2 } |
Selects which mode set is applicable. More... | |
Public Member Functions | |
bool | at_pathname (std::string pathname, bool case_sensitive, const Parameter *root=NULL) const |
Test if the Parameter is at an optionally case-insensitive pathname, possibly from a specific root Parameter. | |
bool | at_pathname (std::string pathname) const |
Test if the Parameter is at a pathname from the top of the Parameter heirarchy. | |
bool | at_pathname (std::string pathname, bool case_sensitive, const Parameter &root) const |
Test if the Parameter is at an optionally case-insensitive pathname from from a root Parameter. | |
virtual Parameter * | clone () const =0 |
Creates a Parameter clone of the Parameter. | |
std::string | comment () const |
Gets the Parameter comment. | |
Parameter & | comment (const std::string &comment) |
Sets the Parameter comment. | |
virtual int | compare (const Parameter ¶meter) const =0 |
Compares this Parameter with another Parameter. | |
bool | has_children () const |
Parameter & | indenting (const MODE_STATE state, const WHICH_MODE which=LOCAL_MODE_SET) |
Enable or disable indenting. | |
Parameter & | indenting (const bool enable) |
Enable or disable indenting for this Parameter. | |
MODE_STATE | indenting (const WHICH_MODE which=RECURSIVE_MODE_SET) const |
Test if indenting will be used. | |
virtual bool | is (const Type type) const =0 |
Test if the Parameter is of some Type. | |
virtual bool | is_Aggregate () const |
Test if the Parameter is an Aggregate. | |
virtual bool | is_Assignment () const |
Test if the Parameter is an Assignment. | |
virtual bool | is_Group () const |
Test if the Parameter is a Group Aggregate. | |
virtual bool | is_Object () const |
Test if the Parameter is an Object Aggregate. | |
virtual bool | is_Token () const |
Test if the Parameter is a Token Assignment. | |
Parameter & | mode_state (const MODE mode, const MODE_STATE state, const WHICH_MODE which=LOCAL_MODE_SET) |
Sets the state of a syntax mode. | |
const MODE_STATE * | mode_state (const WHICH_MODE which=LOCAL_MODE_SET) const |
Gets the array of syntax mode states. | |
MODE_STATE | mode_state (const MODE mode, const WHICH_MODE which=RECURSIVE_MODE_SET) const |
Gets the state of a syntax mode. | |
Parameter & | mode_state (const MODE_STATE *const modes, const WHICH_MODE which=LOCAL_MODE_SET) |
Sets the state of all syntax modes. | |
std::string | name () const |
Gets the name of the Parameter. | |
Parameter & | name (const std::string &name) |
Sets the Parameter's name. | |
bool | operator!= (const Parameter ¶meter) const |
Test if a Parameter is logically not equivalent to another Parameter. | |
bool | operator< (const Parameter ¶meter) const |
Test if this Parameter is logically less than another Parameter. | |
bool | operator<= (const Parameter ¶meter) const |
Test if a Parameter is logically less than or equal to another Parameter. | |
virtual Parameter & | operator= (const Value &value)=0 |
Assigns a Value to this Parameter. | |
virtual Parameter & | operator= (const Parameter ¶meter)=0 |
Assigns the defining characteristics of another Parameter to this Parameter. | |
bool | operator== (const Parameter ¶meter) const |
Test if this Parameter is logically equivalent to another Parameter. | |
bool | operator> (const Parameter ¶meter) const |
Test if a Parameter is logically greater than another Parameter. | |
bool | operator>= (const Parameter ¶meter) const |
Test if a Parameter is logically greater than or equal to another Parameter. | |
virtual Parameter & | operator[] (unsigned int index) |
Array notation accessor. | |
virtual const Parameter & | operator[] (unsigned int index) const |
Array notation accessor. | |
Parameter (const Parameter ¶meter) | |
Parameter copy constructor. | |
Parameter (const std::string &name="") | |
Constructs a Parameter base class. | |
Aggregate * | parent () const |
Gets the Parameter's parent. | |
std::string | pathname (const Parameter *root=NULL) const |
Gets the fully qualified (absolute) pathname of the Parameter, optionally from some root Parameter. | |
std::string | pathname (const Parameter &root) const |
Gets the fully qualified (absolute) pathname of the Parameter from some root Parameter. | |
std::string | pathname_to (const Parameter *root=NULL) const |
Gets the pathname to the Parameter without the Parameter's name. | |
std::string | pathname_to (const Parameter &root) const |
Gets the pathname to the Parameter without the Parameter's name. | |
std::ostream & | print (std::ostream &out=std::cout) const |
Prints the Parameter on an output stream using PVL syntax. | |
virtual void | read (std::istream &in=std::cin)=0 |
Reads an input stream parsed as PVL syntax into this Parameter. | |
virtual void | read (Parser &parser)=0 |
Assigns the next Parameter from a Parser to this Parameter. | |
Aggregate * | root () const |
Gets the root Aggregate enclosing this Parameter. | |
virtual Type | type () const =0 |
Gets the Parameter's Type specification. | |
virtual Parameter & | type (const int type)=0 |
Sets the Parameter's Type specification. | |
virtual std::string | type_name () const =0 |
Gets the Parameter's Type specification name. | |
virtual Value & | value () const =0 |
Gets the Value of an Assignment. | |
MODE_STATE | verbatim_strings (const WHICH_MODE which=RECURSIVE_MODE_SET) const |
Test if quoted strings will be written verbatim. | |
Parameter & | verbatim_strings (const bool enable) |
Enable or disable verbatim quoted strings for this Parameter. | |
Parameter & | verbatim_strings (const MODE_STATE state, const WHICH_MODE which=LOCAL_MODE_SET) |
Enable or disable verbatim quoted strings in PVL syntax. | |
unsigned int | write (std::ostream &out=std::cout, int depth=0) const |
Writes the Parameter on an output stream using PVL syntax. | |
virtual | ~Parameter () |
Virtual destructor. | |
Static Public Member Functions | |
static bool | case_sensitive () |
Gets the default case sensitivity state. | |
static bool | case_sensitive (bool enable) |
Sets the default case sensitivity state. | |
static char | path_delimiter (const char delimiter) |
Sets the pathname delimiter. | |
static char | path_delimiter () |
Gets the current Path_Name delimiter. | |
static std::string | type_name (const Type type) |
Gets name of a Type specification. | |
Static Public Attributes | |
static const bool | DEFAULT_CASE_SENSITIVITY |
Default case sensitivity. | |
static const char | DEFAULT_PATHNAME_DELIMITER |
Default pathname delimiter. | |
static const char *const | ID |
Class identification name with source code version and date. | |
Protected Attributes | |
std::string | Comment |
Comment string associated with the Parameter. | |
MODE_STATE | Modes [TOTAL_LOCAL_MODES] |
Local mode states. | |
std::string | Name |
The Parameter name. | |
Aggregate * | Parent |
The Parameter parent Aggregate (NULL if none). | |
Static Protected Attributes | |
static bool | Case_Sensitive |
Default case sensitivity. | |
static MODE_STATE | DEFAULT_MODES [TOTAL_LOCAL_MODES] |
Default mode states. | |
static char | Path_Delimiter |
Delimter character for pathname components. | |
Friends | |
class | Aggregate |
class | Assignment |
A Parameter is a general-purpose, abstract, named parameter entity.
Every Parameter has a name, which is a string of zero or more characters. A Parameter may also have a comment string associated with it that contains any descriptive text.
There are two types of Parameter implementations: an Assignment has a Value; an Aggregate is a list of Parameters. Because Parameters are typically grouped into Aggregate hierarchical structures, each Parameter contains a pointer to its parent Aggregate; Parameters that are not contained within an Aggregate have a NULL parent. Parameters in an Aggregate hierarchy may be referred to by their pathname - as in a filename directory hierachy - in either an absolute or relative manner. N.B.: The name of a Parameter need not be unique within an Aggregate list; as a result pathnames need not be unique either.
A Parser is used for interpreting the Parameter Value Language syntax text into Parameter objects. A Lister is used for generating Parameter Value Language syntax from Parameter objects. There are also syntax modes that may be set for each Parameter to control the operation of the Lister. These modes may be specific to the Parameter object or inherited from a parent Parameter or a static default setting.
typedef Integer Default_Value |
Default Value type for an Assignment.
enum Type |
Type specifications.
There are two specific implementations of Parameter: Assignment and Aggregate. However, a Parameter can also be distinguished in the way it is represented with the PVL syntax. Since this distinction is not functional - in fact is a characteristic that can be readily changed - additional subclasses are not used. Instead, a Type code is provided and used as a "subtype" characteristic, in addition to offering a convenient means of identifying the general type (class) of a Parameter:
Type specification codes are bit flags. These are organized such that the general Type bit is present for all specific members: A TOKEN contains the ASSIGNMENT bit, both GROUP and OBJECT contain the AGGREGATE bit, and both END_GROUP and END_OBJECT contain the END bit.
Note: Parameter Type codes are guaranteed to be distinct from Value Type codes: they occupy completely separate bit fields and can not be accidently confused.
enum MODE |
enum MODE_STATE |
enum WHICH_MODE |
Parameter | ( | const std::string & | name = "" | ) | [explicit] |
virtual ~Parameter | ( | ) | [inline, virtual] |
Virtual destructor.
virtual Parameter* clone | ( | ) | const [pure virtual] |
std::string name | ( | ) | const [inline] |
Parameter& name | ( | const std::string & | name | ) | [inline] |
Sets the Parameter's name.
name | The name string. |
References Parameter::name().
Referenced by Parameter::name().
Aggregate* parent | ( | ) | const [inline] |
Gets the Parameter's parent.
Note: The parent of a Parameter should only be set by using a containing Aggregate's Vectal interface methods (for convenience, see the Aggregate's add and remove methods).
References Parameter::Parent.
bool has_children | ( | ) | const [inline] |
References Parameter::is_Aggregate().
Aggregate* root | ( | ) | const |
std::string pathname | ( | const Parameter * | root = NULL | ) | const |
Gets the fully qualified (absolute) pathname of the Parameter, optionally from some root Parameter.
A Parameter pathname is the name of the Parameter preceeded by the current path_delimiter character. If this Parameter has a parent that is not the root Parameter then the delimiter is preceeded by the parent's pathname. This recursion produces a pathname that starts with the path_delimiter character and includes the names of each Parameter from, but not including, the root up to, and including, this Parameter, with each name separated by the path_delimiter character.
If no root Parameter is specified (or the root is NULL), the first segment of the pathname will be the name of the Parameter with no parent; this is an "absolute" pathname. N.B.: As a special case when no root is specified the Aggregate named Parser::CONTAINER_NAME (see Parser::get_parameters()) will qualify as the root. If a (non-NULL) root is found the pathname is relative to the specified root. If the root Parameter does not enclose this Parameter - i.e. the root is not in the path to this Parameter - an Invalid_Argument exception will be thrown.
root | A pointer to a pathname root Parameter. |
Invalid_Argument | If the root Parameter is not in the path of this Parameter. |
std::string pathname | ( | const Parameter & | root | ) | const [inline] |
Gets the fully qualified (absolute) pathname of the Parameter from some root Parameter.
root | A parent of this Parameter. |
References Parameter::pathname().
Referenced by Parameter::pathname().
std::string pathname_to | ( | const Parameter * | root = NULL | ) | const |
Gets the pathname to the Parameter without the Parameter's name.
The trailing path_delimiter character is included.
root | A pointer to a parent of this Parameter. [Default: NULL; the top Parameter of the hierarchy] |
std::string pathname_to | ( | const Parameter & | root | ) | const [inline] |
Gets the pathname to the Parameter without the Parameter's name.
root | A parent of this Parameter. |
Invalid_Argument | If the root Parameter is not in the path of this Parameter. |
References Parameter::pathname_to().
Referenced by Parameter::pathname_to().
bool at_pathname | ( | std::string | pathname, |
bool | case_sensitive, | ||
const Parameter * | root = NULL |
||
) | const |
Test if the Parameter is at an optionally case-insensitive pathname, possibly from a specific root Parameter.
The pathname string argument may be a full (absolute) or partial (relative) name of the form:
[/]Name[/Name[...]]
A pathname string beginning with a path_delimiter character is "absolute". In this case a Parameter will test true when the pathname from the specified root Parameter exists and matches the specified pathname using the case_sensitive criteria. Note: This is the only case in which the root argument is used; it provides the absolute anchor for the pathname argument.
A pathname string that does not begin with a path_delimiter character is "relative". In this case a Parameter will test true when the pathname string matches (again, using the case_sensitive criteria) an ending substring of the Parameter pathname that is also preceded by a path_delimiter character. The basic form of a relative pathname is a simple name that contains no path_delimiter character.
pathname | The pathname string to be matched. |
case_sensitive | true if case sensitive string matching is to be applied; false otherwise. |
root | A Parameter pointer for the root Parameter of of an absolute pathname. [Default: NULL; the top Parameter of the hierarchy] |
bool at_pathname | ( | std::string | pathname, |
bool | case_sensitive, | ||
const Parameter & | root | ||
) | const [inline] |
Test if the Parameter is at an optionally case-insensitive pathname from from a root Parameter.
pathname | The pathname string to be matched. |
case_sensitive | true if case sensitive string matching is to be applied; false otherwise. |
root | A root Parameter of of an absolute pathname. |
References Parameter::at_pathname().
Referenced by Parameter::at_pathname().
bool at_pathname | ( | std::string | pathname | ) | const [inline] |
Test if the Parameter is at a pathname from the top of the Parameter heirarchy.
The case sensitivity is determined by the current case_sensitive state.
pathname | The pathname string to be matched. |
References Parameter::at_pathname().
Referenced by Parameter::at_pathname().
static char path_delimiter | ( | ) | [inline, static] |
Gets the current Path_Name delimiter.
References Parameter::Path_Delimiter.
static char path_delimiter | ( | const char | delimiter | ) | [static] |
Sets the pathname delimiter.
Note: The delimiter is a static class variable that applies to all Parameters.
delimiter | The delimiter char. |
static bool case_sensitive | ( | ) | [inline, static] |
Gets the default case sensitivity state.
References Parameter::Case_Sensitive.
static bool case_sensitive | ( | bool | enable | ) | [static] |
Sets the default case sensitivity state.
enable | true, if the default state is case sensitive; false otherwise. |
std::string comment | ( | ) | const [inline] |
Gets the Parameter comment.
References Parameter::Comment.
Parameter& comment | ( | const std::string & | comment | ) | [inline] |
Sets the Parameter comment.
comment | A string used to provide any commentary about the Parameter. |
References Parameter::comment().
Referenced by Parameter::comment().
virtual bool is_Assignment | ( | ) | const [inline, virtual] |
Test if the Parameter is an Assignment.
Reimplemented in Assignment.
virtual bool is_Token | ( | ) | const [inline, virtual] |
Test if the Parameter is a Token Assignment.
Reimplemented in Assignment.
virtual bool is_Aggregate | ( | ) | const [inline, virtual] |
Test if the Parameter is an Aggregate.
Reimplemented in Aggregate.
Referenced by Parameter::has_children().
virtual bool is_Group | ( | ) | const [inline, virtual] |
virtual bool is_Object | ( | ) | const [inline, virtual] |
virtual bool is | ( | const Type | type | ) | const [pure virtual] |
Test if the Parameter is of some Type.
The test is the logical AND of the Parameter Subtype and the specified Type value. Thus, conceptually, the test is if the Parameter is any one of a possible combination of Types. For example, parameter.is (GROUP | OBJECT)
will be true for any AGGREGATE parameter, which could just as easily be tested by parameter.is (AGGREGATE)
; and parameter.is (ASSIGNMENT | AGGREGATE)
can be expected to always be true.
type | The Type specification code against which to test the Parameter. |
Implemented in Aggregate.
virtual Type type | ( | ) | const [pure virtual] |
Gets the Parameter's Type specification.
Implemented in Assignment, and Aggregate.
Referenced by Aggregate::is(), and Assignment::is().
virtual Parameter& type | ( | const int | type | ) | [pure virtual] |
Sets the Parameter's Type specification.
type | A Type specification code. |
Invalid_Argument | If the Parameter's implementing class can not accept the specified Type. |
Implemented in Assignment, and Aggregate.
virtual std::string type_name | ( | ) | const [pure virtual] |
Gets the Parameter's Type specification name.
Implemented in Assignment, and Aggregate.
Referenced by Aggregate::type_name(), and Assignment::type_name().
static std::string type_name | ( | const Type | type | ) | [static] |
Gets name of a Type specification.
A Type specification name is the same as its token name (except only the first letter is capitalized). If the specified value is not a valid Parameter Type specification code, then "Invalid" is returned.
type | A Type specification code. |
virtual Value& value | ( | ) | const [pure virtual] |
Gets the Value of an Assignment.
Invalid_Argument | if the Parameter is not an Assignment. |
Implemented in Assignment, and Aggregate.
virtual Parameter& operator[] | ( | unsigned int | index | ) | [virtual] |
Array notation accessor.
Invalid_Argument | If the Parameter is not an Aggregate. |
Reimplemented in Aggregate.
Referenced by Aggregate::operator[]().
virtual const Parameter& operator[] | ( | unsigned int | index | ) | const [virtual] |
Array notation accessor.
Invalid_Argument | If the Parameter is not an Aggregate. |
Reimplemented in Aggregate.
Assigns the defining characteristics of another Parameter to this Parameter.
The name, comment and Type specification are copied, but not the parent. Assignment Parameters clone the assigned Value. Aggregate Parameters clone the assigned Aggregate's Parameter list.
parameter | The Parameter to be assigned. |
Invalid_Argument | If the Parameter to be assigned is not of the same implementing class as this Parameter. |
Implemented in Assignment, and Aggregate.
Referenced by Aggregate::operator=().
Assigns a Value to this Parameter.
The current Value is deleted and the assigned Value is cloned in its place. A token Parameter becomes an Assignment.
value | The Value to be assigned. |
Invalid_Argument | If this Parameter is not an Assignment (or token). |
Implemented in Assignment, and Aggregate.
virtual int compare | ( | const Parameter & | parameter | ) | const [pure virtual] |
Compares this Parameter with another Parameter.
parameter | The Parameter to compare against. |
Implemented in Assignment, and Aggregate.
Referenced by Parameter::operator!=(), Parameter::operator<(), Parameter::operator<=(), Parameter::operator==(), Parameter::operator>(), and Parameter::operator>=().
bool operator== | ( | const Parameter & | parameter | ) | const [inline] |
Test if this Parameter is logically equivalent to another Parameter.
parameter | The Parameter to compare against. |
References Parameter::compare().
Referenced by Aggregate::Depth_Iterator::operator!=().
bool operator< | ( | const Parameter & | parameter | ) | const [inline] |
Test if this Parameter is logically less than another Parameter.
parameter | The Parameter to compare against. |
References Parameter::compare().
bool operator!= | ( | const Parameter & | parameter | ) | const [inline] |
Test if a Parameter is logically not equivalent to another Parameter.
parameter | The Parameter to compare against. |
References Parameter::compare().
bool operator> | ( | const Parameter & | parameter | ) | const [inline] |
Test if a Parameter is logically greater than another Parameter.
parameter | The Parameter to compare against. |
References Parameter::compare().
bool operator<= | ( | const Parameter & | parameter | ) | const [inline] |
Test if a Parameter is logically less than or equal to another Parameter.
parameter | The Parameter to compare against. |
References Parameter::compare().
bool operator>= | ( | const Parameter & | parameter | ) | const [inline] |
Test if a Parameter is logically greater than or equal to another Parameter.
parameter | The Parameter to compare against. |
References Parameter::compare().
unsigned int write | ( | std::ostream & | out = std::cout , |
int | depth = 0 |
||
) | const |
Writes the Parameter on an output stream using PVL syntax.
out | The ostream to receive the PVL syntax. |
depth | The indenting depth. |
Referenced by Parameter::print().
std::ostream& print | ( | std::ostream & | out = std::cout | ) | const [inline] |
Prints the Parameter on an output stream using PVL syntax.
out | The ostream to receive the PVL syntax. |
References Parameter::write().
virtual void read | ( | std::istream & | in = std::cin | ) | [pure virtual] |
Reads an input stream parsed as PVL syntax into this Parameter.
in | The istream to be parsed for PVL syntax. |
Implemented in Assignment, and Aggregate.
virtual void read | ( | Parser & | parser | ) | [pure virtual] |
Parameter& mode_state | ( | const MODE | mode, |
const MODE_STATE | state, | ||
const WHICH_MODE | which = LOCAL_MODE_SET |
||
) |
Sets the state of a syntax mode.
mode | The selected MODE. |
state | The MODE_STATE to be set. For the DEFAULT_MODE_SET MODE_INHERITED is equivalent to MODE_TRUE. |
which | DEFAULT_MODE_SET if the mode applies to the DEFAULT_MODES; LOCAL_MODE_SET if the mode only applies to this Parameter; RECURSIVE_MODE_SET if the mode also applies to all children of an Aggregate (if the Parameter is not an Aggregate only the LOCAL_MODE_SET applies). |
Referenced by Parameter::indenting(), and Parameter::verbatim_strings().
MODE_STATE mode_state | ( | const MODE | mode, |
const WHICH_MODE | which = RECURSIVE_MODE_SET |
||
) | const |
Gets the state of a syntax mode.
mode | The selected MODE. |
which | DEFAULT_MODE_SET if the mode applies to the DEFAULT_MODES; LOCAL_MODE_SET if the mode only applies to this Parameter; RECURSIVE_MODE_SET if the mode also applies to any inherited mode when the local mode state is MODE_INHERITED. |
Parameter& mode_state | ( | const MODE_STATE *const | modes, |
const WHICH_MODE | which = LOCAL_MODE_SET |
||
) |
Sets the state of all syntax modes.
modes | A pointer to an array of syntax modes. If NULL the local modes will all be reset to MODE_INHERITED; the DEFAULT_MODES will be set to built-in defaults; |
which | DEFAULT_MODE_SET if the mode applies to the DEFAULT_MODES; LOCAL_MODE_SET if the mode only applies to this Parameter; RECURSIVE_MODE_SET if the mode also applies to all children of an Aggregate (if the Parameter is not an Aggregate only the LOCAL_MODE_SET applies). |
const MODE_STATE* mode_state | ( | const WHICH_MODE | which = LOCAL_MODE_SET | ) | const [inline] |
Gets the array of syntax mode states.
which | DEFAULT_MODE_SET if the DEFAULT_MODES are to be obtained; otherwise the local modes for this Parameter are to be obtained. |
References Parameter::DEFAULT_MODE_SET, Parameter::DEFAULT_MODES, and Parameter::Modes.
Parameter& verbatim_strings | ( | const MODE_STATE | state, |
const WHICH_MODE | which = LOCAL_MODE_SET |
||
) | [inline] |
Enable or disable verbatim quoted strings in PVL syntax.
When disabled (the default initial condition) multi-line quoted strings in PVL statements have white space surrounding the line breaks compressed to a single space character - except when the last non-white space character on the line is a dash ("-"), in which case no space is included. This is because output formatting is expected to be controlled by embedded format characters which are processed by the Parameter's write method:
\n - line break. \t - horizontal tab. \f - form feed (page break). \ - backslash character. \v - verbatim (no formatting) till next \v.
When enabled all string values written as-is.
state | The MODE_STATE to be set. For the DEFAULT_MODE_SET MODE_INHERITED is equivalent to MODE_TRUE. |
which | DEFAULT_MODE_SET if the mode applies to the DEFAULT_MODES; LOCAL_MODE_SET if the mode only applies to this Parameter; RECURSIVE_MODE_SET if the mode also applies to all children of an Aggregate (if the Parameter is not an Aggregate only the LOCAL_MODE_SET applies). |
References Parameter::mode_state(), and Parameter::Verbatim_Strings.
Parameter& verbatim_strings | ( | const bool | enable | ) | [inline] |
Enable or disable verbatim quoted strings for this Parameter.
This is equivalent to using the corresponding method with a MODE_STATE of either MODE_TRUE or MODE_FALSE if enable is true or false, respectively and WHICH_MODE of LOCAL_MODE_SET;
enable | true if the mode is to be enabled; false otherwise. |
References Parameter::LOCAL_MODE_SET, Parameter::MODE_FALSE, Parameter::mode_state(), Parameter::MODE_TRUE, and Parameter::Verbatim_Strings.
MODE_STATE verbatim_strings | ( | const WHICH_MODE | which = RECURSIVE_MODE_SET | ) | const [inline] |
Test if quoted strings will be written verbatim.
If the mode is not set locally, then the state of the inherited mode, whether from a parent or the default, will be used.
which | DEFAULT_MODE_SET if the mode applies to the DEFAULT_MODES; LOCAL_MODE_SET if the mode only applies to this Parameter; RECURSIVE_MODE_SET if the mode also applies to any inherited mode when the local mode state is MODE_INHERITED. |
References Parameter::mode_state(), and Parameter::Verbatim_Strings.
Parameter& indenting | ( | const MODE_STATE | state, |
const WHICH_MODE | which = LOCAL_MODE_SET |
||
) | [inline] |
Enable or disable indenting.
state | The MODE_STATE to be set. For the DEFAULT_MODE_SET MODE_INHERITED is equivalent to MODE_TRUE. |
which | DEFAULT_MODE_SET if the mode applies to the DEFAULT_MODES; LOCAL_MODE_SET if the mode only applies to this Parameter; RECURSIVE_MODE_SET if the mode also applies to all children of an Aggregate (if the Parameter is not an Aggregate only the LOCAL_MODE_SET applies). |
References Parameter::Indenting, and Parameter::mode_state().
Parameter& indenting | ( | const bool | enable | ) | [inline] |
Enable or disable indenting for this Parameter.
This is equivalent to using the corresponding method with a MODE_STATE of either MODE_TRUE or MODE_FALSE if enable is true or false, respectively and WHICH_MODE of LOCAL_MODE_SET;
enable | true if the mode is to be enabled; false otherwise. |
References Parameter::Indenting, Parameter::LOCAL_MODE_SET, Parameter::MODE_FALSE, Parameter::mode_state(), and Parameter::MODE_TRUE.
MODE_STATE indenting | ( | const WHICH_MODE | which = RECURSIVE_MODE_SET | ) | const [inline] |
Test if indenting will be used.
If the mode is not set locally, then the state of the inherited mode, whether from a parent or the default, will be used.
which | DEFAULT_MODE_SET if the mode applies to the DEFAULT_MODES; LOCAL_MODE_SET if the mode only applies to this Parameter; RECURSIVE_MODE_SET if the mode also applies to any inherited mode when the local mode state is MODE_INHERITED. |
References Parameter::Indenting, and Parameter::mode_state().
friend class Assignment [friend] |
Referenced by Assignment::clone().
friend class Aggregate [friend] |
Referenced by Aggregate::clone().
const char* const ID [static] |
Class identification name with source code version and date.
const char DEFAULT_PATHNAME_DELIMITER [static] |
Default pathname delimiter.
const bool DEFAULT_CASE_SENSITIVITY [static] |
Default case sensitivity.
The Parameter parent Aggregate (NULL if none).
Referenced by Parameter::parent().
std::string Name [protected] |
The Parameter name.
Referenced by Parameter::name().
char Path_Delimiter [static, protected] |
Delimter character for pathname components.
Referenced by Parameter::path_delimiter().
bool Case_Sensitive [static, protected] |
Default case sensitivity.
Referenced by Parameter::case_sensitive().
std::string Comment [protected] |
Comment string associated with the Parameter.
Referenced by Parameter::comment().
MODE_STATE DEFAULT_MODES[TOTAL_LOCAL_MODES] [static, protected] |
Default mode states.
Referenced by Parameter::mode_state().
MODE_STATE Modes[TOTAL_LOCAL_MODES] [protected] |
Local mode states.
Referenced by Parameter::mode_state().