From 29d8fd4c02944c3cd55e863715b2d2c906067e8a Mon Sep 17 00:00:00 2001 From: <> Date: Fri, 16 Jun 2017 13:08:46 -0700 Subject: [PATCH] Added feedback couts, inactive program arguments. --- ReflexToQ3/main.cpp | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/ReflexToQ3/main.cpp b/ReflexToQ3/main.cpp index eab8f06..4fa2d4c 100644 --- a/ReflexToQ3/main.cpp +++ b/ReflexToQ3/main.cpp @@ -17,12 +17,32 @@ using namespace std; int main(const int _kiArgC, const char** _kppcArgv) { - // Check we have correct number of parameters +#define ARG_POS_BRUSHDEF 5 +#define ARG_POS_ENTITYCONV 4 + // Minimum: program, input file, output file if(_kiArgC < 3) { return(3); } +/* // placeholder argument parsing until something more robust is decided upon + // optional arg #1: brush definition - gtkradiant or netradiant style + void (*brushdef) (std::stringstream &, const std::vector &); + brushdef = ((string(_kppcArgv[ARG_POS_BRUSHDEF - 1])).compare("-gtk") == 0) ? + &brushdef_gtk: &brushdef_net; - convertmap(_kppcArgv[1], _kppcArgv[2], &brushdef_net); + // optional arg #2: entity mapping file - enables entity conversion + const char * const entitymap = (_kiArgC < ARG_POS_ENTITYCONV) ? + _kppcArgv[ARG_POS_ENTITYCONV - 1]: NULL; */ + + bool status = convertmap(_kppcArgv[1], _kppcArgv[2], &brushdef_net); + if (status) { + cout << "Successfully converted map " + << _kppcArgv[1] + << " to " + << _kppcArgv[2] + << endl; + } else { + cout << "Failed to convert map." << endl; + } return(0); -} \ No newline at end of file +}