Fawkes API Fawkes Development Version
camargp.h
1
2/***************************************************************************
3 * camargp.h - Camera argument parser
4 *
5 * Created: Wed Apr 11 15:44:51 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#ifndef _FIREVISION_FVUTILS_SYSTEM_CAMARGP_H_
25#define _FIREVISION_FVUTILS_SYSTEM_CAMARGP_H_
26
27#include <fvcams/camera.h>
28
29#include <map>
30#include <string>
31#include <vector>
32
33namespace firevision {
34
36{
37public:
38 CameraArgumentParser(const char *as);
40
41 bool has(std::string s) const;
42 std::string get(std::string s) const;
43 long int get_int(std::string s) const;
44 double get_float(std::string s) const;
45 std::map<std::string, std::string> parameters() const;
46 std::vector<std::string> arguments() const;
47 std::string cam_id() const;
48 std::string cam_type() const;
49
50private:
51 std::string _cam_type;
52 std::string _cam_id;
53 std::map<std::string, std::string> values;
54 std::vector<std::string> args;
55};
56
57} // end namespace firevision
58
59#endif
Camera argument parser.
Definition: camargp.h:36
long int get_int(std::string s) const
Get the value of the given parameter as integer.
Definition: camargp.cpp:175
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
bool has(std::string s) const
Check if an parameter was given.
Definition: camargp.cpp:145
std::string get(std::string s) const
Get the value of the given parameter.
Definition: camargp.cpp:156
double get_float(std::string s) const
Get the value of the given parameter as integer.
Definition: camargp.cpp:198
CameraArgumentParser(const char *as)
Constructor.
Definition: camargp.cpp:68
std::map< std::string, std::string > parameters() const
Get a map of parameters.
Definition: camargp.cpp:226