rasdaman client API 10.6.3
The Array Analytics Engine: Datacubes at Your Fingertips
parseparams.hh
Go to the documentation of this file.
1/*
2* This file is part of rasdaman community.
3*
4* Rasdaman community is free software: you can redistribute it and/or modify
5* it under the terms of the GNU General Public License as published by
6* the Free Software Foundation, either version 3 of the License, or
7* (at your option) any later version.
8*
9* Rasdaman community is distributed in the hope that it will be useful,
10* but WITHOUT ANY WARRANTY; without even the implied warranty of
11* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12* GNU General Public License for more details.
13*
14* You should have received a copy of the GNU General Public License
15* along with rasdaman community. If not, see <http://www.gnu.org/licenses/>.
16*
17* Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009 Peter Baumann /
18rasdaman GmbH.
19*
20* For more information please see <http://www.rasdaman.org>
21* or contact Peter Baumann via <baumann@rasdaman.com>.
22*/
23
24#ifndef PARSE_PARAMS_HH_
25#define PARSE_PARAMS_HH_
26
27#include <iosfwd>
28#include <string>
29
30//@ManMemo: Module {\bf raslib}
40{
41public:
61 r_Parse_Params(void) = default;
63 explicit r_Parse_Params(unsigned int num);
67 int add(const char *key, void *store, parse_param_type type);
68 int add(const std::string &key, void *store, parse_param_type type);
80 int process(const char *str) const;
81 int process(const char *str, char separator, bool withWhiteSpaces) const;
87protected:
88 //@Man: The parameter descriptor
91 {
92 const char *key = NULL;
93 void *store = NULL;
95 };
97
99 unsigned int maxnum{};
100 unsigned int number{};
101
102 static const unsigned int granularity;
103};
104
105//@ManMemo: Module: {\bf raslib}
109extern std::ostream &operator<<(std::ostream &s, const r_Parse_Params::parse_param_type &d);
110
111#endif
Class for parsing a string consisting of key=value pairs separated by ",".
Definition parseparams.hh:40
parse_param_type
the possible parameter types used for add()
Definition parseparams.hh:44
@ param_type_double
Definition parseparams.hh:46
@ param_type_int
Definition parseparams.hh:45
@ param_type_string
Definition parseparams.hh:47
int process(const char *str, char separator, bool withWhiteSpaces) const
unsigned int number
Definition parseparams.hh:100
static const unsigned int granularity
Definition parseparams.hh:102
int add(const char *key, void *store, parse_param_type type)
add parameters to the list
parse_params_t * params
Definition parseparams.hh:98
int process(const char *str) const
Add a parameter to the list.
~r_Parse_Params(void)
destructor
unsigned int maxnum
Definition parseparams.hh:99
r_Parse_Params(unsigned int num)
constructor, gets descriptor of the values to scan for
r_Parse_Params(void)=default
Possible parameter types and their corresponding C types are.
int add(const std::string &key, void *store, parse_param_type type)
std::ostream & operator<<(std::ostream &s, const r_Parse_Params::parse_param_type &d)
Output stream operator for objects of type const r_Parse_Params::parse_param_type.
process the parameter string.
Definition parseparams.hh:91
const char * key
Definition parseparams.hh:92
parse_param_type type
Definition parseparams.hh:94
void * store
Definition parseparams.hh:93