00001
00002
00003
00004
00005
00006
00007
00009 #ifndef JOBCOMMMAND_H
00010 #define JOBCOMMMAND_H
00011 #ifndef VECTOR
00012 #include <vector>
00013 #define VECTOR
00014 #endif
00015 #ifndef STRING
00016 #include <string>
00017 #define STRING
00018 #endif
00019
00020 class Registry;
00021
00022 using namespace std;
00023
00024 class JobCommand
00025 {
00026 friend ostream& operator<<(ostream& os, const JobCommand& jc);
00027 public:
00028 JobCommand();
00029 JobCommand(const char *cmd);
00030 ~JobCommand();
00031
00032 bool HaveCmd() const;
00033 bool HaveOpt() const;
00034
00035 const char *PopCmd();
00036 const char *PopOpt();
00037 const char *PushCmd();
00038 const char *PushOpt();
00039 int PopIntOpt();
00040 double PopFloatOpt();
00041
00042 static void SplitLine(const char *line, char sep, string& a, string& b);
00043 static void StringTok(std::vector<std::string>& ls,
00044 const std::string& str,
00045 const std::string& tok);
00046 static bool IsBool(const char* value);
00047 static bool IsInt(const char* s);
00048 static bool IsFloat(const char* s);
00049 static void StringToRegistry(Registry& r, const char* s);
00050 static bool atob(const char* value);
00051
00052 private:
00053
00054 void Parse(const char *cmd);
00055
00056
00057 vector<string> fCmdList;
00058 vector<string>::iterator fItrCmdList;
00059 vector<string> fOptList;
00060 vector<string>::iterator fItrOptList;
00061 };
00062 #endif // JOBCOMMMAND_H
00063