#include #include #include #include #include #include #include "client.h" #define outputln output << "\n" 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, QIODevice::ReadOnly), stdInNotifier(0, QSocketNotifier::Read), 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 resource list, if -o provided, set as optional"); commandList["remove"] = CommandListArgs("reslist [-o]", "remove resource list, if -o provided, removed only optional flag"); commandList["audio"] = CommandListArgs("pid | group