summaryrefslogtreecommitdiffhomepage
path: root/wfpctl/src/extras/cli/subcommanddispatcher.cpp
diff options
context:
space:
mode:
authorOdd Stranne <odd@mullvad.net>2018-05-25 11:22:01 +0200
committerOdd Stranne <odd@mullvad.net>2018-05-25 11:22:01 +0200
commit32e1bd67dd67652c89762a327e44ba3d47780c48 (patch)
treef0ae4de1b7d5703a500209f876d35530f3dcb9fc /wfpctl/src/extras/cli/subcommanddispatcher.cpp
parent835342bcd9ccffc092825b1c96077f6af1eb9878 (diff)
downloadmullvadvpn-32e1bd67dd67652c89762a327e44ba3d47780c48.tar.xz
mullvadvpn-32e1bd67dd67652c89762a327e44ba3d47780c48.zip
Move wfpctl -> windows/winfw
Diffstat (limited to 'wfpctl/src/extras/cli/subcommanddispatcher.cpp')
-rw-r--r--wfpctl/src/extras/cli/subcommanddispatcher.cpp27
1 files changed, 0 insertions, 27 deletions
diff --git a/wfpctl/src/extras/cli/subcommanddispatcher.cpp b/wfpctl/src/extras/cli/subcommanddispatcher.cpp
deleted file mode 100644
index 4bb7868cd7..0000000000
--- a/wfpctl/src/extras/cli/subcommanddispatcher.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
-#include "stdafx.h"
-#include "subcommanddispatcher.h"
-#include "libcommon/string.h"
-#include <sstream>
-#include <stdexcept>
-#include <utility>
-
-void SubcommandDispatcher::addSubcommand(const std::wstring &command, Handler handler)
-{
- m_commands.insert(std::make_pair(command, handler));
-}
-
-void SubcommandDispatcher::dispatch(const std::wstring &command, const std::vector<std::wstring> &arguments)
-{
- auto selectedCommand = m_commands.find(command);
-
- if (m_commands.end() == selectedCommand)
- {
- std::wstringstream ss;
-
- ss << L"Unsupported subcommand '" << command << "'. Cannot complete request.";
-
- throw std::runtime_error(common::string::ToAnsi(ss.str()).c_str());
- }
-
- selectedCommand->second(common::string::SplitKeyValuePairs(arguments));
-}