/************************************************************************* This file is part of libresourceqt Copyright (C) 2010 Nokia Corporation. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation version 2.1 of the License. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *************************************************************************/ #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), pendingAddAudio(false), applicationClass(), resourceSet(NULL), output(stdout) { 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