Qore Programming Language  0.8.3
include/qore/ParseOptionMap.h (4311)
00001 /* -*- mode: c++; indent-tabs-mode: nil -*- */
00002 /*
00003  ParseOptionMap.h
00004  
00005  Qore Programming language
00006  
00007  Copyright 2003 - 2011 David Nichols
00008  
00009  This library is free software; you can redistribute it and/or
00010  modify it under the terms of the GNU Lesser General Public
00011  License as published by the Free Software Foundation; either
00012  version 2.1 of the License, or (at your option) any later version.
00013  
00014  This library is distributed in the hope that it will be useful,
00015  but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017  Lesser General Public License for more details.
00018  
00019  You should have received a copy of the GNU Lesser General Public
00020  License along with this library; if not, write to the Free Software
00021  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00022  */
00023 
00024 #ifndef _QORE_PARSEOPTIONMAP_H
00025 #define _QORE_PARSEOPTIONMAP_H
00026 
00027 #include <qore/Restrictions.h>
00028 
00029 typedef std::map<const char *, int, ltstr> opt_map_t;
00030 typedef std::map<int, const char *> rev_opt_map_t;
00031 
00033 class ParseOptionMap {
00034    private:
00035       DLLLOCAL static opt_map_t map;
00036       DLLLOCAL static rev_opt_map_t rmap;
00037 
00038       // not implemented
00039       DLLLOCAL ParseOptionMap(const ParseOptionMap&);
00040       DLLLOCAL ParseOptionMap& operator=(const ParseOptionMap&);
00041       
00042    public:
00043       DLLLOCAL ParseOptionMap();
00044       DLLLOCAL static void static_init();
00045 
00047       DLLEXPORT static const char *find_name(int code);
00048 
00050       DLLEXPORT static int find_code(const char *name);
00051 
00053       DLLEXPORT static void list_options();
00054 };
00055 
00056 #endif
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines