00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __CMD_Args_H__
00021 #define __CMD_Args_H__
00022
00023 #include "CMD_API.h"
00024 #include <iostream.h>
00025 #include <UT/UT_Args.h>
00026 #include <UT/UT_String.h>
00027
00028 class CMD_Manager;
00029 class CMD_Source;
00030 class CMD_Command;
00031
00032 #define CMD_MAX_OPTIONS UT_MAX_OPTIONS
00033
00034 class CMD_API CMD_Args : public UT_Args {
00035 public:
00036 CMD_Args();
00037 virtual ~CMD_Args();
00038
00039 ostream &out() { return *my_out; }
00040 ostream &err(int show_line_number = 1);
00041
00042 void quietErrors() { myFirstError = 0; }
00043 void showUsage();
00044 void callBaseClassCommand();
00045
00046 UT_String commandName();
00047
00048 protected:
00049 private:
00050 void init(ostream *os, ostream *es, CMD_Source *src);
00051
00052 ostream *my_out;
00053 ostream *my_err;
00054 UT_String myFilename;
00055 int myLineNumber;
00056 CMD_Command *myCommand;
00057 int myFirstError;
00058
00059 friend class CMD_Manager;
00060 };
00061 #endif