rasdaman API
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 /
33 #ifndef _PARSE_PARAMS_HH_
34 #define _PARSE_PARAMS_HH_
35 
36 #include <iosfwd>
37 
38 //@ManMemo: Module {\bf raslib}
39 
40 /*@Doc:
41  Class for parsing a string consisting of key=value pairs separated by ",".
42 */
43 
45 {
46 public:
47 
50  {
54  };
65  struct parse_params_s;
66 
68  r_Parse_Params( void );
70  r_Parse_Params( unsigned int num );
72  ~r_Parse_Params( void );
74  int add( const char *key, void *store, parse_param_type type );
85  int process( const char *str ) const;
93 protected:
94  //@Man: The parameter descriptor
96  typedef struct parse_params_s
97  {
98  const char *key;
99  void *store;
101  } parse_params_t;
103 
105  unsigned int maxnum;
106  unsigned int number;
107 
108  static const unsigned int granularity;
109 };
110 
111 //@ManMemo: Module: {\bf raslib}
115 extern std::ostream& operator<<( std::ostream& s, const r_Parse_Params::parse_param_type& d );
116 
117 
118 #endif
parse_param_type type
Definition: parseparams.hh:100
const char * key
Definition: parseparams.hh:98
unsigned int number
Definition: parseparams.hh:106
int add(const char *key, void *store, parse_param_type type)
add parameters to the list
struct r_Parse_Params::parse_params_s parse_params_t
int process(const char *str) const
process parameter string
r_Parse_Params(void)
default constructor, should not be used
std::ostream & operator<<(std::ostream &s, const r_Parse_Params::parse_param_type &d)
parse_params_t * params
Definition: parseparams.hh:104
parse_param_type
the possible parameter types used for add()
Definition: parseparams.hh:49
Definition: parseparams.hh:96
static const unsigned int granularity
Definition: parseparams.hh:108
Definition: parseparams.hh:53
Definition: parseparams.hh:44
Definition: parseparams.hh:52
unsigned int maxnum
Definition: parseparams.hh:105
~r_Parse_Params(void)
destructor
Definition: parseparams.hh:51
void * store
Definition: parseparams.hh:99