diff options
author | Attila Molnar <attilamolnar@hush.com> | 2014-02-20 13:34:27 +0100 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2014-02-20 13:34:27 +0100 |
commit | 5303501b930d3d6c765c24ff69edb722d8a6b5f1 (patch) | |
tree | f19fab0754dfe58e548ed389fa0e669b4af4ee48 /src/mode.cpp | |
parent | f66d05dbda78c44b9af40e3e6f4e1a50f802d054 (diff) |
Add a ModeParser::FindMode() overload that takes a mode name and a mode type
Diffstat (limited to 'src/mode.cpp')
-rw-r--r-- | src/mode.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mode.cpp b/src/mode.cpp index e70df5479..17379b620 100644 --- a/src/mode.cpp +++ b/src/mode.cpp @@ -708,6 +708,16 @@ bool ModeParser::DelMode(ModeHandler* mh) return true; } +ModeHandler* ModeParser::FindMode(const std::string& modename, ModeType mt) +{ + ModeHandlerMap& mhmap = modehandlersbyname[mt]; + ModeHandlerMap::const_iterator it = mhmap.find(modename); + if (it != mhmap.end()) + return it->second; + + return NULL; +} + ModeHandler* ModeParser::FindMode(unsigned const char modeletter, ModeType mt) { if ((modeletter < 'A') || (modeletter > 'z')) |