diff options
author | Mike Buland <eichlan@xagasoft.com> | 2009-12-16 20:10:58 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2009-12-16 20:10:58 +0000 |
commit | f72c6e4b97afeb69d9ea4d743c0c302d647ea424 (patch) | |
tree | 48d9d94db520455324e902759e887c0d98de976a /src/tests/optparser.cpp | |
parent | 5eba456f0147b12a6247cd7aa41e55d121962358 (diff) | |
download | libbu++-f72c6e4b97afeb69d9ea4d743c0c302d647ea424.tar.gz libbu++-f72c6e4b97afeb69d9ea4d743c0c302d647ea424.tar.bz2 libbu++-f72c6e4b97afeb69d9ea4d743c0c302d647ea424.tar.xz libbu++-f72c6e4b97afeb69d9ea4d743c0c302d647ea424.zip |
The new signal/slots system is in place, and works from 0-5 parameters right
now, I'll probably add more later on...
I've also started on the replacement for ParamProc, OptParser. It should do
everything that ParamProc did, only with less code, and much better.
Diffstat (limited to 'src/tests/optparser.cpp')
-rw-r--r-- | src/tests/optparser.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/tests/optparser.cpp b/src/tests/optparser.cpp new file mode 100644 index 0000000..9168af8 --- /dev/null +++ b/src/tests/optparser.cpp | |||
@@ -0,0 +1,27 @@ | |||
1 | #include <bu/optparser.h> | ||
2 | #include <bu/sio.h> | ||
3 | using namespace Bu; | ||
4 | |||
5 | class Opts : public Bu::OptParser | ||
6 | { | ||
7 | public: | ||
8 | Opts() : | ||
9 | iBob( 542 ) | ||
10 | { | ||
11 | callback( this, &Opts::cb ); | ||
12 | } | ||
13 | |||
14 | int cb( int argc, char *argv[] ) | ||
15 | { | ||
16 | sio << "Hey, cb was called, here's a class var: " << iBob << sio.nl; | ||
17 | return 5; | ||
18 | } | ||
19 | |||
20 | int iBob; | ||
21 | }; | ||
22 | |||
23 | int main( int argc, char *argv[] ) | ||
24 | { | ||
25 | Opts o; | ||
26 | } | ||
27 | |||