|
OpenADFortTk (basic)
|
00001 // -*-Mode: C++;-*- 00002 // $Header: /m_home/m_utkej/Argonne/cvs2svn/cvs/OpenADFortTk/src/sexp2whirl/Args.h,v 1.2 2007-10-08 18:28:33 utke Exp $ 00003 00004 #ifndef Args_h 00005 #define Args_h 00006 00007 #include <iostream> 00008 #include <string> 00009 00010 #include "CmdLineParser.h" 00011 00012 00013 class Args { 00014 public: 00015 Args(); 00016 Args(int argc, const char* const argv[]); 00017 ~Args(); 00018 00019 // Parse the command line 00020 void Parse(int argc, const char* const argv[]); 00021 00022 // Version and Usage information 00023 void PrintVersion(std::ostream& os) const; 00024 void PrintUsage(std::ostream& os) const; 00025 00026 // Error 00027 void PrintError(std::ostream& os, const char* msg) const; 00028 void PrintError(std::ostream& os, const std::string& msg) const; 00029 00030 // Dump 00031 void Dump(std::ostream& os = std::cerr) const; 00032 void DDump() const; 00033 00034 public: 00035 // Parsed Data: Command 00036 const std::string& GetCmd() const { return parser.GetCmd(); } 00037 00038 // Parsed Data: optional arguments 00039 std::string whirlFileNm; 00040 int debug; // default: 0 (off) 00041 00042 // Parsed Data: arguments 00043 std::string sexpFileNm; 00044 00045 private: 00046 void Ctor(); 00047 00048 private: 00049 static CmdLineParser::OptArgDesc optArgs[]; 00050 CmdLineParser parser; 00051 }; 00052 00053 #endif