From 11735b42b3ad263379980380affbeca2b6a1e18f Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Sat, 9 May 2015 19:32:48 +0200 Subject: bindings: move some code from .h to .cpp file --- src/bindings.h | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) (limited to 'src/bindings.h') diff --git a/src/bindings.h b/src/bindings.h index 0ec75332..f76132f8 100644 --- a/src/bindings.h +++ b/src/bindings.h @@ -132,31 +132,13 @@ class BindingsConfiguration public: typedef BindingsMap::value_type::second_type::iterator BindingIterator; typedef BindingsMap::value_type::second_type::const_iterator ConstBindingIterator; - + typedef std::pair BindingIteratorPair; + bool read(const std::string &file); void generateDefaults(); - const Command *findCommand(const std::string &name) { - const Command *ptr = 0; - auto it = m_commands.find(name); - if (it != m_commands.end()) - ptr = &it->second; - return ptr; - } - - std::pair get(const Key &k) { - std::pair result; - auto it = m_bindings.find(k); - if (it != m_bindings.end()) { - result.first = it->second.begin(); - result.second = it->second.end(); - } else { - auto list_end = m_bindings.begin()->second.end(); - result.first = list_end; - result.second = list_end; - } - return result; - } + const Command *findCommand(const std::string &name); + BindingIteratorPair get(const Key &k); BindingsMap::const_iterator begin() const { return m_bindings.begin(); } BindingsMap::const_iterator end() const { return m_bindings.end(); } -- cgit v1.2.3