|
OpenADFortTk (basic)
|
00001 // ########################################################## 00002 // # This file is part of OpenADFortTk. # 00003 // # The full COPYRIGHT notice can be found in the top # 00004 // # level directory of the OpenADFortTk source tree. # 00005 // # For more information visit # 00006 // # http://www.mcs.anl.gov/openad # 00007 // ########################################################## 00008 00009 #ifndef Args_h 00010 #define Args_h 00011 00012 #include <iostream> 00013 #include <string> 00014 00015 #include "CmdLineParser.h" 00016 #include "xaif2whirl.h" 00017 00018 class Args { 00019 public: 00020 Args(); 00021 Args(int argc, const char* const argv[]); 00022 ~Args(); 00023 00024 // Parse the command line 00025 void Parse(int argc, const char* const argv[]); 00026 00027 // Version and Usage information 00028 void PrintVersion(std::ostream& os) const; 00029 void PrintUsage(std::ostream& os) const; 00030 00031 // Error 00032 void PrintError(std::ostream& os, const char* msg) const; 00033 void PrintError(std::ostream& os, const std::string& msg) const; 00034 00035 // Dump 00036 void Dump(std::ostream& os = std::cerr) const; 00037 void DDump() const; 00038 00039 public: 00040 // Parsed Data: Command 00041 const std::string& GetCmd() const { return parser.GetCmd(); } 00042 00043 // Parsed Data: optional arguments 00044 xaif2whirl::AlgorithmType algorithm; // default: ALG_NULL 00045 int debug; // default: 0 (off) 00046 00047 // Parsed Data: arguments 00048 std::string inWhirlFileNm; 00049 std::string outWhirlFileNm; 00050 std::string xaifFileNm; 00051 static std::string ourActiveTypeNm; 00052 static const unsigned short ourActiveTypeNmLength=27; 00053 bool validate; 00054 00055 static TYPE_ID ourDefaultMTypeInt; 00056 static TYPE_ID ourDefaultMTypeUInt; 00057 static TYPE_ID ourDefaultMTypeReal; 00058 00059 bool myNoCleanUpFlag; 00060 00061 private: 00062 void Ctor(); 00063 00064 private: 00065 static CmdLineParser::OptArgDesc optArgs[]; 00066 CmdLineParser parser; 00067 }; 00068 00069 #endif