From 2a45589132802628d7e61b40a8fb510d5d5e19d1 Mon Sep 17 00:00:00 2001 From: Wolf Bergenheim Date: Wed, 25 Aug 2010 11:28:10 +0300 Subject: Replaced printf with QTextStream --- resourceqt-client/client.cpp | 165 ++++++++++++++++++++++++------------------- 1 file changed, 94 insertions(+), 71 deletions(-) (limited to 'resourceqt-client/client.cpp') diff --git a/resourceqt-client/client.cpp b/resourceqt-client/client.cpp index f1e17d2..6276155 100644 --- a/resourceqt-client/client.cpp +++ b/resourceqt-client/client.cpp @@ -1,5 +1,6 @@ #include #include +#include #include #include @@ -9,10 +10,40 @@ using namespace ResourcePolicy; +QMap Client::commandList; + +CommandListArgs::CommandListArgs() + :args(), help() +{ +} + + +CommandListArgs::CommandListArgs(const QString &arguments, const QString &helpText) + :args(arguments), help(helpText) +{ +} + +CommandListArgs::~CommandListArgs() +{ +} + Client::Client() - : QObject(), standardInput(stdin, QFile::ReadOnly), applicationClass(), resourceSet(NULL) + : QObject(), standardInput(stdin, QFile::ReadOnly), applicationClass(), + resourceSet(NULL), output(stdout) { mainTimerID = startTimer(0); + commandList["help"] = CommandListArgs("", "print this help message"); + commandList["quit"] = CommandListArgs("", "exit application"); + commandList["free"] = CommandListArgs("", "destroy and free the resources"); + commandList["acquire"] = CommandListArgs("", "acquire required resources"); + commandList["release"] = CommandListArgs("", "release resources"); + commandList["update"] = CommandListArgs("", "update modified resource set after add or remove command"); + commandList["add"] = CommandListArgs("reslist [-o]","add reosurce list, if -o provided, set as optional"); + commandList["remove"] = CommandListArgs("reslist [-o]","remove reosurce list, if -o provided, removed only optional flag"); + commandList["audio"] = CommandListArgs("pid | group