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
00032 int
00033 main(int argc, char **argv)
00034 {
00035 const char *s = "firewire:funny ID:mode=xy:test=test2:blub";
00036 if ( argc > 1 ) {
00037 s = argv[1];
00038 }
00039
00040 CameraArgumentParser *argp = new CameraArgumentParser(s);
00041
00042 cout << "Camera Type: " << argp->cam_type() << endl;
00043 cout << "Camera ID: " << argp->cam_id() << endl;
00044
00045 map<string, string> values = argp->parameters();
00046 map<string, string>::iterator i;
00047 for (i = values.begin(); i != values.end(); ++i) {
00048 cout << "values[" << (*i).first << "] = " << (*i).second << endl;
00049 }
00050
00051 vector<string> args = argp->arguments();
00052 vector<string>::iterator j;
00053 for (j = args.begin(); j != args.end(); ++j) {
00054 cout << "arg: " << (*j) << endl;
00055 }
00056
00057 delete argp;
00058
00059 return 0;
00060 }
00061
00062
00063
00064