git.stg.codes
/
stg.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Ticket. Get() function added.
[stg.git]
/
projects
/
sgconf
/
api_action.h
diff --git
a/projects/sgconf/api_action.h
b/projects/sgconf/api_action.h
index e10840cfabc63931f1bc06f6ba8d20cea914ec86..f27715ca5f58bf65b042f8591796a71f5bbc185f 100644
(file)
--- a/
projects/sgconf/api_action.h
+++ b/
projects/sgconf/api_action.h
@@
-63,6
+63,13
@@
class API_ACTION : public ACTION
public:
struct PARAM
{
public:
struct PARAM
{
+ PARAM(const std::string & n,
+ const std::string & s,
+ const std::string & l)
+ : name(n),
+ shortDescr(s),
+ longDescr(l)
+ {}
std::string name;
std::string shortDescr;
std::string longDescr;
std::string name;
std::string shortDescr;
std::string longDescr;
@@
-88,7
+95,7
@@
class API_ACTION : public ACTION
virtual std::string ParamDescription() const { return m_description; }
virtual std::string DefaultDescription() const { return ""; }
virtual OPTION_BLOCK & Suboptions() { return m_suboptions; }
virtual std::string ParamDescription() const { return m_description; }
virtual std::string DefaultDescription() const { return ""; }
virtual OPTION_BLOCK & Suboptions() { return m_suboptions; }
- virtual PARSER_STATE Parse(int argc, char ** argv);
+ virtual PARSER_STATE Parse(int argc, char ** argv
, void * /*data*/
);
private:
COMMANDS & m_commands;
private:
COMMANDS & m_commands;
@@
-108,6
+115,14
@@
ACTION * MakeAPIAction(COMMANDS & commands,
return new API_ACTION(commands, paramDescription, true, params, funPtr);
}
return new API_ACTION(commands, paramDescription, true, params, funPtr);
}
+inline
+ACTION * MakeAPIAction(COMMANDS & commands,
+ const std::vector<API_ACTION::PARAM> & params,
+ API_FUNCTION funPtr)
+{
+return new API_ACTION(commands, "", false, params, funPtr);
+}
+
inline
ACTION * MakeAPIAction(COMMANDS & commands,
const std::string & paramDescription,
inline
ACTION * MakeAPIAction(COMMANDS & commands,
const std::string & paramDescription,