aboutsummaryrefslogtreecommitdiff
path: root/src/test/param.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2006-06-29 02:50:56 +0000
committerMike Buland <eichlan@xagasoft.com>2006-06-29 02:50:56 +0000
commit5e386890b41fe043e2639b25b613831ef8362e7b (patch)
tree60da93a6ade1db5ed2620fbe47b472291459a1a1 /src/test/param.cpp
parentac98da8eacbf1147d69e378db62432db05e8c73e (diff)
downloadlibbu++-5e386890b41fe043e2639b25b613831ef8362e7b.tar.gz
libbu++-5e386890b41fe043e2639b25b613831ef8362e7b.tar.bz2
libbu++-5e386890b41fe043e2639b25b613831ef8362e7b.tar.xz
libbu++-5e386890b41fe043e2639b25b613831ef8362e7b.zip
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...
Diffstat (limited to 'src/test/param.cpp')
-rw-r--r--src/test/param.cpp40
1 files changed, 40 insertions, 0 deletions
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 @@
1#include "param.h"
2#include <stdio.h>
3
4Param::Param()
5{
6 addParam( "name", 's', mkproc( Param::printStuff ), &str );
7 //addParam( "name", &str );
8 addParam( "job", 'U', mkproc( Param::printStuff ) );
9
10 // --name=Bobo
11 // --job hello
12}
13
14Param::~Param()
15{
16}
17
18int Param::printStuff( int argc, char *argv[] )
19{
20 printf("------------%02d-------------\n", argc );
21 for( int j = 0; j < argc; j++ )
22 {
23 printf("%d: %s\n", j, argv[j] );
24 }
25 printf("---------------------------\n" );
26 printf("SETVAR===\"%s\"\n", str.c_str() );
27
28 return 1;
29}
30
31int main( int argc, char *argv[] )
32{
33 printf("Starting...\n");
34 Param p;
35 p.process( argc, argv );
36
37 //printf("Calling by hand...\n");
38 //p.printStuff();
39}
40