From 5e386890b41fe043e2639b25b613831ef8362e7b Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Thu, 29 Jun 2006 02:50:56 +0000 Subject: Completely removed the old, crappy pproc and replaced it with the new, shiny ParamProc class...it's soooo much better it makes me wanna' throw things... --- src/test/param.cpp | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src/test/param.cpp (limited to 'src/test/param.cpp') diff --git a/src/test/param.cpp b/src/test/param.cpp new file mode 100644 index 0000000..0641f90 --- /dev/null +++ b/src/test/param.cpp @@ -0,0 +1,40 @@ +#include "param.h" +#include + +Param::Param() +{ + addParam( "name", 's', mkproc( Param::printStuff ), &str ); + //addParam( "name", &str ); + addParam( "job", 'U', mkproc( Param::printStuff ) ); + + // --name=Bobo + // --job hello +} + +Param::~Param() +{ +} + +int Param::printStuff( int argc, char *argv[] ) +{ + printf("------------%02d-------------\n", argc ); + for( int j = 0; j < argc; j++ ) + { + printf("%d: %s\n", j, argv[j] ); + } + printf("---------------------------\n" ); + printf("SETVAR===\"%s\"\n", str.c_str() ); + + return 1; +} + +int main( int argc, char *argv[] ) +{ + printf("Starting...\n"); + Param p; + p.process( argc, argv ); + + //printf("Calling by hand...\n"); + //p.printStuff(); +} + -- cgit v1.2.3