#include <input_argument_parser.h>
Static Public Member Functions | |
static InputArguments | parse (int argc, char *argv[]) |
Static Private Member Functions | |
static void | print_plugins () |
static void | print_version () |
Definition at line 137 of file input_argument_parser.h.
InputArguments gpucalc::InputArgParser::parse | ( | int | argc, | |
char * | argv[] | |||
) | [static] |
Definition at line 41 of file input_argument_parser.cpp.
00042 { 00043 InputArguments result(argc, argv); 00044 for (int i = 0; i < argc; ++i) 00045 { 00046 if (std::string("--plugin") == argv[i]) 00047 { 00048 ++i; 00049 if (i < argc) 00050 { 00051 result.mPluginList.push_back(argv[i]); 00052 continue; 00053 } 00054 } 00055 00056 if (std::string("--config") == argv[i]) 00057 { 00058 ++i; 00059 if (i < argc) 00060 { 00061 result.mConfigFile = argv[i]; 00062 continue; 00063 } 00064 } 00065 00066 if (std::string("--shader") == argv[i]) 00067 { 00068 i += 2; 00069 if (i < argc) 00070 { 00071 result.mShaders.insert(std::make_pair(argv[i - 1], argv[i])); 00072 continue; 00073 } 00074 } 00075 00076 if (std::string("--log_level") == argv[i]) 00077 { 00078 ++i; 00079 if (i < argc) 00080 { 00081 if (argv[i] == std::string("low")) result.mLoggingLevel = LL_Low; 00082 if (argv[i] == std::string("normal")) result.mLoggingLevel = LL_Normal; 00083 if (argv[i] == std::string("verbose")) result.mLoggingLevel = LL_Verbose; 00084 continue; 00085 } 00086 } 00087 } 00088 return result; 00089 }
void gpucalc::InputArgParser::print_plugins | ( | ) | [static, private] |
Definition at line 133 of file input_argument_parser.cpp.
00134 { 00135 std::cerr << "Finding installed plugins is not implemented yet. InputArgParser::print_plugins()" << std::endl; 00136 00137 std::cout << "GraphicCore plugins:" << std::endl; 00138 std::cout << "\tGLGraphicCore" << std::endl; 00139 00140 std::cout << std::endl << "ShaderSystem plugins: " << std::endl; 00141 std::cout << "\tGLGLSLShaderSystem" << std::endl; 00142 std::cout << "\tGLCgShaderSystem" << std::endl; 00143 }
void gpucalc::InputArgParser::print_version | ( | ) | [static, private] |
Definition at line 92 of file input_argument_parser.cpp.
00093 { 00094 switch (COMPILER) 00095 { 00096 case COMPILER_MSVC: 00097 std::cout << "Compiled with MS C++ compiler, version is: " << COMP_VER << std::endl; 00098 break; 00099 00100 case COMPILER_GNUC: 00101 std::cout << "Compiled with GNU C++ compiler, version is: " << COMP_VER << std::endl; 00102 break; 00103 00104 case COMPILER_BORL: 00105 std::cout << "Compiled with Borland C++ compiler, version is: " << COMP_VER << std::endl; 00106 break; 00107 00108 default: 00109 std::cout << "Unknown C++ compiler." << std::endl; 00110 } 00111 00112 switch (PLATFORM) 00113 { 00114 case PLATFORM_WIN32: 00115 std::cout << "Running under Microsoft Windows." << std::endl; 00116 break; 00117 00118 case PLATFORM_APPLE: 00119 std::cout << "Running under Apple MacOS." << std::endl; 00120 break; 00121 00122 case PLATFORM_LINUX: 00123 std::cout << "Running under Unix/Linux compatible OS." << std::endl; 00124 break; 00125 00126 default: 00127 break; 00128 } 00129 std::cout << "gpucalc version is: " << gpucalc_version << std::endl; 00130 }