Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

JobCommand.h

Go to the documentation of this file.
00001 
00002 // $Id: JobCommand.h,v 1.11 2002/01/20 18:57:34 messier Exp $
00003 //
00004 // Convert text strings to command paths and options and provide easy
00005 // access to the command path and options to clients
00006 //
00007 // messier@huhepl.harvard.edu
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   // Methods
00054   void Parse(const char *cmd);
00055 
00056   // Data
00057   vector<string>           fCmdList;    // Command path
00058   vector<string>::iterator fItrCmdList; // Current position in command path 
00059   vector<string>           fOptList;    // Options for this command
00060   vector<string>::iterator fItrOptList; // Current position in option list
00061 };
00062 #endif // JOBCOMMMAND_H
00063 

Generated on Mon Feb 15 11:06:49 2010 for loon by  doxygen 1.3.9.1