#include <operatorhinter.h>
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 |
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.
| typedef IConfigurationParser<std::string, std::string> configuration::OperatorHinter::ConfParser |
Type for Configuration parser. Use this parser type in loadFromFile method.
| 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.
| virtual std::string configuration::OperatorHinter::getDefaultHint | ( | ) | const [inline, virtual] |
| virtual std::string& configuration::OperatorHinter::getHint | ( | std::string & | operatorName, | |
| std::string & | hintText | |||
| ) | [inline, virtual] |
Gets hint for given operator name.
| 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.
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.
| defaultHint | String to use for defaultHint field. |
std::string configuration::OperatorHinter::defaultHint [private] |
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().
rulesmanager::IRuleMatcher<std::string>* configuration::OperatorHinter::stringMatcher [private] |
Matcher implementation for RulesManager.
Referenced by OperatorHinter(), and ~OperatorHinter().