qa_camargp.cpp
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #include <fvutils/system/camargp.h>
00027
00028 #include <iostream>
00029
00030 using namespace std;
00031 using namespace firevision;
00032
00033 int
00034 main(int argc, char **argv)
00035 {
00036 const char *s = "firewire:funny ID:mode=xy:test=test2:blub";
00037 if ( argc > 1 ) {
00038 s = argv[1];
00039 }
00040
00041 CameraArgumentParser *argp = new CameraArgumentParser(s);
00042
00043 cout << "Camera Type: " << argp->cam_type() << endl;
00044 cout << "Camera ID: " << argp->cam_id() << endl;
00045
00046 map<string, string> values = argp->parameters();
00047 map<string, string>::iterator i;
00048 for (i = values.begin(); i != values.end(); ++i) {
00049 cout << "values[" << (*i).first << "] = " << (*i).second << endl;
00050 }
00051
00052 vector<string> args = argp->arguments();
00053 vector<string>::iterator j;
00054 for (j = args.begin(); j != args.end(); ++j) {
00055 cout << "arg: " << (*j) << endl;
00056 }
00057
00058 delete argp;
00059
00060 return 0;
00061 }
00062
00063
00064
00065