Fawkes API Fawkes Development Version
qa_camargp.cpp
1
2/***************************************************************************
3 * qa_camargp.h - QA for camera argument parser
4 *
5 * Generated: Wed Apr 11 16:02:33 2007
6 * Copyright 2005-2007 Tim Niemueller [www.niemueller.de]
7 *
8 ****************************************************************************/
9
10/* This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version. A runtime exception applies to
14 * this software (see LICENSE.GPL_WRE file mentioned below for details).
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Library General Public License for more details.
20 *
21 * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22 */
23
24/// @cond QA
25
26#include <fvutils/system/camargp.h>
27
28#include <iostream>
29
30using namespace std;
31using namespace firevision;
32
33int
34main(int argc, char **argv)
35{
36 const char *s = "firewire:funny ID:mode=xy:test=test2:blub";
37 if (argc > 1) {
38 s = argv[1];
39 }
40
42
43 cout << "Camera Type: " << argp->cam_type() << endl;
44 cout << "Camera ID: " << argp->cam_id() << endl;
45
46 map<string, string> values = argp->parameters();
47 map<string, string>::iterator i;
48 for (i = values.begin(); i != values.end(); ++i) {
49 cout << "values[" << (*i).first << "] = " << (*i).second << endl;
50 }
51
52 vector<string> args = argp->arguments();
53 vector<string>::iterator j;
54 for (j = args.begin(); j != args.end(); ++j) {
55 cout << "arg: " << (*j) << endl;
56 }
57
58 delete argp;
59
60 return 0;
61}
62
63/// @endcond
Camera argument parser.
Definition: camargp.h:36
std::vector< std::string > arguments() const
Get the arguments.
Definition: camargp.cpp:217
std::string cam_id() const
Get camera ID.
Definition: camargp.cpp:133
std::string cam_type() const
Get camera type.
Definition: camargp.cpp:122
std::map< std::string, std::string > parameters() const
Get a map of parameters.
Definition: camargp.cpp:226