summaryrefslogtreecommitdiff
path: root/src/bindings.h
diff options
context:
space:
mode:
authorAndrzej Rybczak <electricityispower@gmail.com>2015-05-09 19:32:48 +0200
committerAndrzej Rybczak <electricityispower@gmail.com>2015-05-09 19:32:48 +0200
commit11735b42b3ad263379980380affbeca2b6a1e18f (patch)
treee3e1fd1b9828d192dea6c60e8df2ab9ba7ea6ae0 /src/bindings.h
parent043e309e24f16c7d8c333d0c0a059f8de54ec911 (diff)
bindings: move some code from .h to .cpp file
Diffstat (limited to 'src/bindings.h')
-rw-r--r--src/bindings.h26
1 files changed, 4 insertions, 22 deletions
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<BindingIterator, BindingIterator> 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<BindingIterator, BindingIterator> get(const Key &k) {
- std::pair<BindingIterator, BindingIterator> 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(); }