configuration::OperatorHinter Class Reference

#include <operatorhinter.h>

Inheritance diagram for configuration::OperatorHinter:
rulesmanager::RulesManager< std::string, std::string >

List of all members.

Public Types

typedef IConfigurationParser
< std::string, std::string > 
ConfParser

Public Member Functions

 OperatorHinter ()
 OperatorHinter (const std::string &defHint)
virtual ~OperatorHinter ()
virtual std::string setDefaultHint (const std::string &defaultHint)
virtual std::string getDefaultHint () const
virtual std::string & getHint (std::string &operatorName, std::string &hintText)

Private Attributes

std::string defaultHint
rulesmanager::IRuleMatcher
< std::string > * 
stringMatcher

Detailed Description

RulesManager specialized for operation to hints mapping.

Keeps string rules which are associated with string hints. Rules stands for operators names (from content stream) and hints are help texts to understand what is operator goot for or how it should be used.
Uses StringMatcher internally to check rules.
Configuration can be loaded from file by loadFromFile method.

See also:
RulesManager::loadFromFile

Member Typedef Documentation

Type for Configuration parser. Use this parser type in loadFromFile method.


Constructor & Destructor Documentation

configuration::OperatorHinter::OperatorHinter (  )  [inline]

Default constructor. Initializes defaultHint to empty string and allocates StringMatcher which is used to set matcher for RulesManager (uses setRuleMatcher method).

References rulesmanager::RulesManager< std::string, std::string >::setRuleMatcher(), and stringMatcher.

configuration::OperatorHinter::OperatorHinter ( const std::string &  defHint  )  [inline]

Initialization constructor. Initializes defaultHint to given string and allocates StringMatcher which is used to set matcher for RulesManager (uses setRuleMatcher method).

References rulesmanager::RulesManager< std::string, std::string >::setRuleMatcher(), and stringMatcher.

virtual configuration::OperatorHinter::~OperatorHinter (  )  [inline, virtual]

Virtual destructor. Deallocates stringMatcher created in constructor.

References stringMatcher.


Member Function Documentation

virtual std::string configuration::OperatorHinter::getDefaultHint (  )  const [inline, virtual]

Returns defaultHint field value.

Returns:
defaultHint string.

References defaultHint.

virtual std::string& configuration::OperatorHinter::getHint ( std::string &  operatorName,
std::string &  hintText 
) [inline, virtual]

Gets hint for given operator name.

Parameters:
operatorName Name of the operator to search hint for.
hintText String where to put hint for given operator.

Uses findMatching with given operatorName and if finds matches, sets hintText string value and returns reference to it.

Returns:
reference to given hintText.

References defaultHint, and rulesmanager::RulesManager< std::string, std::string >::findMatching().

virtual std::string configuration::OperatorHinter::setDefaultHint ( const std::string &  defaultHint  )  [inline, virtual]

Sets defaultHint field.

Parameters:
defaultHint String to use for defaultHint field.
Returns:
previous value of defaultHint field.

Member Data Documentation

Default hint string. This string is used when no rule matches given one. It can be set either in constructor or by setDefaultHint method.

Referenced by getDefaultHint(), and getHint().

Matcher implementation for RulesManager.

Referenced by OperatorHinter(), and ~OperatorHinter().


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