Matrix Science header
Public Member Functions

ms_parseoptions Class Reference
[Mascot configuration files module]

Represents the PARSE section of mascot.dat. More...

#include <ms_parserule.hpp>

Inheritance diagram for ms_parseoptions:
Inheritance graph
[legend]
Collaboration diagram for ms_parseoptions:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ms_parseoptions ()
 Default constructor.
 ms_parseoptions (const ms_parseoptions &src)
 Copying constructor.
 ~ms_parseoptions ()
 Destructor.
void clearParseRules ()
 Makes all rules unavailable.
void copyFrom (const ms_parseoptions *right)
 Can be used to copy content from another instance.
void defaultValues ()
 Initializes the instance.
void dropParseRule (const int index)
 Makes a parse rule with the specified index unavailable.
int getNumberOfParseRules () const
 Can be used to get upper limit for a parse rule number.
const ms_parserulegetParseRule (const int index) const
 Returns a parse rule by number.
std::string getPreceedingComments () const
 Returns any comments preceeding the section.
bool isSectionAvailable () const
 Check whether the section has been actually read from the file.
ms_parseoptionsoperator= (const ms_parseoptions &right)
 Assignment operator for C++ client applications.
void setParseRule (const int index, const ms_parserule *rule)
 Set a new parse rule for a given number.
void setPreceedingComments (const std::string &comments)
 Sets any comments preceeding the section.
void setSectionAvailable (const bool value)
 Changes availability of the section, i.e. whether it should be saved in a file.

Detailed Description

Represents the PARSE section of mascot.dat.

Also get yourselves acquainted with the base class ms_customproperty. It facilitates the following tasks:

More functionality is described in the documentation for ms_customproperty.

Examples:

config_mascotdat.cpp.


Member Function Documentation

void dropParseRule ( const int  index )

Makes a parse rule with the specified index unavailable.

Unavailable rules are not shown in the file any more and are not valid entries. In order to make it available again, create a new rule and put it in using setParseRule() member.

Parameters:
indexof rule to drop
int getNumberOfParseRules (  ) const

Can be used to get upper limit for a parse rule number.

The limit is currently hard-coded. Use this function to retrieve its value.

Returns:
max number of parse rules
Examples:
config_mascotdat.cpp.
const ms_parserule * getParseRule ( const int  index ) const

Returns a parse rule by number.

Parse rules are not not stored consecutively. They are stored according to their numbers explicitly specified in the file. So, not every number will yield an available rule. See ms_parserule::isAvailable().

Parameters:
indexa number from 0 to (getNumberOfParseRules()-1).
Returns:
an instance of ms_parserule class representing a rule. See Maintaining object references: two rules of thumb.
Examples:
config_mascotdat.cpp.
std::string getPreceedingComments (  ) const [inherited]

Returns any comments preceeding the section.

Sections in the mascot.dat file may have comments preceeding them. In most cases, these comments need to stay 'attached' to the section.

Multiple line comments are supported by having a single string with newline characters

See also:
setPreceedingComments()
Returns:
any comments preceeding the section
bool isSectionAvailable (  ) const

Check whether the section has been actually read from the file.

By default the PARSE section is unavailable until it has been set to a different state.

Returns:
true if the section is available, false otherwise
Examples:
config_mascotdat.cpp.
void setPreceedingComments ( const std::string &  comments ) [inherited]

Sets any comments preceeding the section.

Sections in the mascot.dat file may have comments preceeding them. In most cases, these comments need to stay 'attached' to the section.

Multiple line comments are supported by having a single string with newline characters

See also:
getPreceedingComments()
Parameters:
commentsany comments preceeding the section

The documentation for this class was generated from the following files:
Copyright © 2016 Matrix Science Ltd.  All Rights Reserved. Generated on Fri Jun 2 2017 01:44:53