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 /
18 rasdaman 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 {
41 public:
44  {
48  };
61  r_Parse_Params(void) = default;
63  explicit r_Parse_Params(unsigned int num);
65  ~r_Parse_Params(void);
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);
79  int process(const char *str) const;
81  int process(const char *str, char separator, bool withWhiteSpaces) const;
87 protected:
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}
109 extern std::ostream &operator<<(std::ostream &s, const r_Parse_Params::parse_param_type &d);
110 
111 #endif
r_Parse_Params::parse_params_t::key
const char * key
Definition: parseparams.hh:92
r_Parse_Params::parse_param_type
parse_param_type
the possible parameter types used for add()
Definition: parseparams.hh:43
r_Parse_Params::param_type_int
@ param_type_int
Definition: parseparams.hh:45
r_Parse_Params::param_type_double
@ param_type_double
Definition: parseparams.hh:46
r_Parse_Params::parse_params_t
process the parameter string.
Definition: parseparams.hh:90
r_Parse_Params::parse_params_t::type
parse_param_type type
Definition: parseparams.hh:94
r_Parse_Params::r_Parse_Params
r_Parse_Params(void)=default
Possible parameter types and their corresponding C types are.
operator<<
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.
r_Parse_Params::maxnum
unsigned int maxnum
Definition: parseparams.hh:99
r_Parse_Params::~r_Parse_Params
~r_Parse_Params(void)
destructor
r_Parse_Params::parse_params_t::store
void * store
Definition: parseparams.hh:93
r_Parse_Params::param_type_string
@ param_type_string
Definition: parseparams.hh:47
r_Parse_Params::number
unsigned int number
Definition: parseparams.hh:100
r_Parse_Params::add
int add(const char *key, void *store, parse_param_type type)
add parameters to the list
r_Parse_Params
Class for parsing a string consisting of key=value pairs separated by ",".
Definition: parseparams.hh:39
r_Parse_Params::params
parse_params_t * params
Definition: parseparams.hh:98
r_Parse_Params::process
int process(const char *str) const
Add a parameter to the list.
r_Parse_Params::granularity
static const unsigned int granularity
Definition: parseparams.hh:102