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