Qore Programming Language  0.8.9
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ParseOptionMap.h
1 /* -*- mode: c++; indent-tabs-mode: nil -*- */
2 /*
3  ParseOptionMap.h
4 
5  Qore Programming language
6 
7  Copyright 2003 - 2013 David Nichols
8 
9  This library is free software; you can redistribute it and/or
10  modify it under the terms of the GNU Lesser General Public
11  License as published by the Free Software Foundation; either
12  version 2.1 of the License, or (at your option) any later version.
13 
14  This library is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  Lesser General Public License for more details.
18 
19  You should have received a copy of the GNU Lesser General Public
20  License along with this library; if not, write to the Free Software
21  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22  */
23 
24 #ifndef _QORE_PARSEOPTIONMAP_H
25 #define _QORE_PARSEOPTIONMAP_H
26 
27 #include <qore/Restrictions.h>
28 
29 typedef std::map<const char *, int64, ltstr> opt_map_t;
30 typedef std::map<int64, const char *> rev_opt_map_t;
31 
34  private:
35  DLLLOCAL static opt_map_t map;
36  DLLLOCAL static rev_opt_map_t rmap;
37 
38  // not implemented
39  DLLLOCAL ParseOptionMap(const ParseOptionMap&);
40  DLLLOCAL ParseOptionMap& operator=(const ParseOptionMap&);
41 
42  public:
43  DLLLOCAL ParseOptionMap();
44  DLLLOCAL static void static_init();
45 
47  DLLEXPORT static const char *find_name(int code);
48 
50 
51  DLLEXPORT static int find_code(const char *name);
52 
54  DLLEXPORT static int64 find_code64(const char *name);
55 
57  DLLEXPORT static void list_options();
58 };
59 
60 #endif
provides access to parse option information
Definition: ParseOptionMap.h:33
static DLLEXPORT const char * find_name(int code)
find a parse option name from its code
static DLLEXPORT int find_code(const char *name)
find a parse option code from its name
static DLLEXPORT int64 find_code64(const char *name)
find a parse option code from its name
static DLLEXPORT void list_options()
print out all parse optionsto stdout