aboutsummaryrefslogtreecommitdiffstats
path: root/native/dicttoolkit/src/utils/command_utils.h
diff options
context:
space:
mode:
authorKeisuke Kuroyanagi <ksk@google.com>2014-11-08 21:36:24 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-11-08 21:36:25 +0000
commit61280c0b7fc87cf901272f38b75d12c5193b33ff (patch)
treecec830641a141be7cc461b85607174da9ed71884 /native/dicttoolkit/src/utils/command_utils.h
parentd2a47cceb290769e2c1c38ee3b77c9413ff0af3e (diff)
parentbd48963bdf20aa58b2f4d0cca762aba0f2917858 (diff)
downloadlatinime-61280c0b7fc87cf901272f38b75d12c5193b33ff.tar.gz
latinime-61280c0b7fc87cf901272f38b75d12c5193b33ff.tar.xz
latinime-61280c0b7fc87cf901272f38b75d12c5193b33ff.zip
Merge "Add CommandExecutor for dicttoolkit."
Diffstat (limited to 'native/dicttoolkit/src/utils/command_utils.h')
-rw-r--r--native/dicttoolkit/src/utils/command_utils.h16
1 files changed, 4 insertions, 12 deletions
diff --git a/native/dicttoolkit/src/utils/command_utils.h b/native/dicttoolkit/src/utils/command_utils.h
index 7df0dd970..4a181f194 100644
--- a/native/dicttoolkit/src/utils/command_utils.h
+++ b/native/dicttoolkit/src/utils/command_utils.h
@@ -17,7 +17,8 @@
#ifndef LATINIME_DICT_TOOLKIT_COMMAND_UTILS_H
#define LATINIME_DICT_TOOLKIT_COMMAND_UTILS_H
-#include <cstdio>
+#include <functional>
+#include <memory>
#include <string>
#include "dict_toolkit_defines.h"
@@ -37,21 +38,12 @@ enum class CommandType : int {
class CommandUtils {
public:
static CommandType getCommandType(const std::string &commandName);
-
static void printCommandUnknownMessage(const std::string &programName,
- const std::string &commandName) {
- fprintf(stderr, "Command '%s' is unknown. Try '%s %s' for more information.\n",
- commandName.c_str(), programName.c_str(), COMMAND_NAME_HELP);
- }
+ const std::string &commandName);
+ static std::function<int(int, char **)> getCommandExecutor(const CommandType commandType);
private:
DISALLOW_IMPLICIT_CONSTRUCTORS(CommandUtils);
-
- static const char *const COMMAND_NAME_INFO;
- static const char *const COMMAND_NAME_DIFF;
- static const char *const COMMAND_NAME_MAKEDICT;
- static const char *const COMMAND_NAME_HEADER;
- static const char *const COMMAND_NAME_HELP;
};
} // namespace dicttoolkit
} // namespace latinime