summaryrefslogtreecommitdiff
path: root/resourceqt-client/commandlineparser.h
diff options
context:
space:
mode:
authorWolf Bergenheim <ext-wolf.2.bergenheim@nokia.com>2010-08-23 12:15:15 +0300
committerWolf Bergenheim <ext-wolf.2.bergenheim@nokia.com>2010-09-06 14:36:28 +0300
commit0bcbc969c7dfa362cfffad3f92d375329fee289f (patch)
tree7f1897a8e359091b112cacaea0c8fd4fbf3a4c5f /resourceqt-client/commandlineparser.h
parenta83adabf1dd858d3dab0cc141fc51fdcb9388d44 (diff)
* Moved CommandLineParser to its own files
* Removed broken timer, replaced it with a simpler timer made in C * Sanitized the use of resources (Use Qt types instead of custom bitmap) * Added a MessageHandler so we can later play with verbosity level
Diffstat (limited to 'resourceqt-client/commandlineparser.h')
-rw-r--r--resourceqt-client/commandlineparser.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/resourceqt-client/commandlineparser.h b/resourceqt-client/commandlineparser.h
new file mode 100644
index 0000000..c799f9b
--- /dev/null
+++ b/resourceqt-client/commandlineparser.h
@@ -0,0 +1,47 @@
+#ifndef COMMANDLINEPARSER_H
+#define COMMANDLINEPARSER_H
+#include <QString>
+#include <QList>
+#include <QSet>
+#include <QHash>
+#include <QTextStream>
+#include <policy/resource.h>
+
+class CommandLineParser
+{
+public:
+ CommandLineParser();
+ ~CommandLineParser();
+
+public:
+ bool parseArguments();
+
+ static bool parseResourceList(const QString &resourceListStr,
+ QSet<ResourcePolicy::ResourceType> &resourceList);
+
+ const QSet<ResourcePolicy::ResourceType>& resources() const;
+ const QSet<ResourcePolicy::ResourceType>& optionalResources() const;
+ QString resourceApplicationClass() const;
+ bool shouldAutoRelease() const;
+ bool shouldAlwaysReply() const;
+ bool shouldBeVerbose() const;
+
+private:
+ QSet<ResourcePolicy::ResourceType> allResources;
+ QSet<ResourcePolicy::ResourceType> optResources;
+ static QHash<QString, ResourcePolicy::ResourceType> resourceValues;
+ QString applicationClass;
+ bool autoRelease;
+ bool alwaysReply;
+ bool verbose;
+ bool allowUnkownResourceClass;
+ QTextStream output;
+
+ bool parseClassString(const QString &str);
+ bool parseModeValues(const QString &modeListStr);
+
+ void usage();
+
+};
+#endif
+