X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/d3b6a58593b94c9ff41c30a7517086d607f28f10..29e9a2de0b45893850bbf56ee38e7fd235a6df15:/projects/sgconf/api_action.cpp?ds=inline diff --git a/projects/sgconf/api_action.cpp b/projects/sgconf/api_action.cpp deleted file mode 100644 index 420f5f0a..00000000 --- a/projects/sgconf/api_action.cpp +++ /dev/null @@ -1,40 +0,0 @@ -#include "api_action.h" - -#include "actions.h" -#include "parser_state.h" - -SGCONF::PARSER_STATE SGCONF::API_ACTION::Parse(int argc, char ** argv) -{ -PARSER_STATE state(false, argc, argv); -if (!m_argument.empty()) - { - if (argc == 0 || - argv == NULL || - *argv == NULL) - throw ERROR("Missing argument."); - m_argument = *argv; - --state.argc; - ++state.argv; - } -m_suboptions.Parse(state.argc, state.argv); -m_commands.Add(m_funPtr, m_argument, m_params); -return state; -} - -SGCONF::API_ACTION::API_ACTION(COMMANDS & commands, - const std::string & paramDescription, - bool needArgument, - const std::vector & params, - API_FUNCTION funPtr) - : m_commands(commands), - m_description(paramDescription), - m_argument(needArgument ? "1" : ""), // Hack - m_funPtr(funPtr) -{ -std::vector::const_iterator it(params.begin()); -while (it != params.end()) - { - m_suboptions.Add(it->name, MakeKVAction(it->name, m_params, it->shortDescr), it->longDescr); - ++it; - } -}