diff options
author | Alexis211 <alexis211@gmail.com> | 2009-12-17 11:18:19 +0100 |
---|---|---|
committer | Alexis211 <alexis211@gmail.com> | 2009-12-17 11:18:19 +0100 |
commit | 4f9078c0f06e0cf0cb7bb164fc72fb9918c68e6a (patch) | |
tree | 34815307b54bf8639ba89f2efddf03e96ee4c0d0 /Source/Library/Userland/App/ShellApp.proto.h | |
parent | 3d5aca66b9712758aecb2e80bc5b2fb3df6256a4 (diff) | |
download | Melon-4f9078c0f06e0cf0cb7bb164fc72fb9918c68e6a.tar.gz Melon-4f9078c0f06e0cf0cb7bb164fc72fb9918c68e6a.zip |
Added some option handling featurs to the default ShellApp class
Diffstat (limited to 'Source/Library/Userland/App/ShellApp.proto.h')
-rw-r--r-- | Source/Library/Userland/App/ShellApp.proto.h | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/Source/Library/Userland/App/ShellApp.proto.h b/Source/Library/Userland/App/ShellApp.proto.h index 846f2b1..5575112 100644 --- a/Source/Library/Userland/App/ShellApp.proto.h +++ b/Source/Library/Userland/App/ShellApp.proto.h @@ -4,14 +4,35 @@ #include <App/Application.proto.h> #include <Binding/VirtualTerminal.class.h> +#define FT_BOOL 1 +#define FT_STR 2 +#define FT_INT 3 + +struct flag_t { + WChar sName; + String lName, desc; + int type; + String strVal; + int intVal; + bool boolVal; +}; + class ShellApp : public Application { public: VirtualTerminal invt, outvt; - - ShellApp() : Application(), invt(VirtualTerminal::getIn()), outvt(VirtualTerminal::getOut()) { - if (!invt.valid()) exit(1); - if (!outvt.valid()) exit(2); - } + Vector<String> args; + Vector<flag_t> flags; + String appName, appDesc; + ShellApp(String name, String desc); + + virtual void init(); + + //Flag handling + flag_t* getFlag(String name); + void addFlag(WChar sName, String lName, String desc, int type = FT_BOOL, String deflt = ""); + String sFlag(String name); + int iFlag(String name); + bool bFlag(String name); }; #endif |