summaryrefslogtreecommitdiff
path: root/src/command_manager.hh
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2012-08-23 23:56:35 +0200
committerMaxime Coste <frrrwww@gmail.com>2012-08-23 23:56:35 +0200
commite4fd839ddaaf3fc68df2cb502a633a2ae6a9f86f (patch)
tree681b2a63eb9b9497b97697e3f1479a7b20270427 /src/command_manager.hh
parent0d8cce272831cd896d0e69d7c86cc9afc521eb11 (diff)
use a strongly typed int CharCount for character counts
Diffstat (limited to 'src/command_manager.hh')
-rw-r--r--src/command_manager.hh8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/command_manager.hh b/src/command_manager.hh
index 113bac3e..cbc6a2c7 100644
--- a/src/command_manager.hh
+++ b/src/command_manager.hh
@@ -28,13 +28,13 @@ typedef std::function<void (const CommandParameters&,
typedef std::function<CandidateList (const Context& context,
const CommandParameters&,
- size_t, size_t)> CommandCompleter;
+ size_t, CharCount)> CommandCompleter;
class PerArgumentCommandCompleter
{
public:
typedef std::function<CandidateList (const Context&,
- const String&, size_t)> ArgumentCompleter;
+ const String&, CharCount)> ArgumentCompleter;
typedef memoryview<ArgumentCompleter> ArgumentCompleterList;
PerArgumentCommandCompleter(const ArgumentCompleterList& completers)
@@ -43,7 +43,7 @@ public:
CandidateList operator()(const Context& context,
const CommandParameters& params,
size_t token_to_complete,
- size_t pos_in_token) const;
+ CharCount pos_in_token) const;
private:
std::vector<ArgumentCompleter> m_completers;
@@ -56,7 +56,7 @@ public:
const EnvVarMap& env_vars = EnvVarMap());
Completions complete(const Context& context,
- const String& command_line, size_t cursor_pos);
+ const String& command_line, CharCount cursor_pos);
bool command_defined(const String& command_name) const;