qa_camargp.cpp

00001
00002 /***************************************************************************
00003  *  qa_camargp.h - QA for camera argument parser
00004  *
00005  *  Generated: Wed Apr 11 16:02:33 2007
00006  *  Copyright  2005-2007  Tim Niemueller [www.niemueller.de]
00007  *
00008  ****************************************************************************/
00009
00010 /*  This program is free software; you can redistribute it and/or modify
00011  *  it under the terms of the GNU General Public License as published by
00012  *  the Free Software Foundation; either version 2 of the License, or
00013  *  (at your option) any later version. A runtime exception applies to
00014  *  this software (see LICENSE.GPL_WRE file mentioned below for details).
00015  *
00016  *  This program is distributed in the hope that it will be useful,
00017  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  *  GNU Library General Public License for more details.
00020  *
00021  *  Read the full text in the LICENSE.GPL_WRE file in the doc directory.
00022  */
00023 
00024 /// @cond QA
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 /// @endcond