gxProperties.h

Go to the documentation of this file.
00001 /*  Copyright (C) 2004  Guido Simone
00002  *
00003  *  This program is free software; you can redistribute it and/or modify
00004  *  it under the terms of the GNU General Public License as published by
00005  *  the Free Software Foundation; either version 2 of the License, or
00006  *  (at your option) any later version.
00007  *
00008  *  This program is distributed in the hope that it will be useful,
00009  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00010  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00011  *  GNU General Public License for more details.
00012 
00013  *  You should have received a copy of the GNU General Public License
00014  *  along with this program; if not, write to the Free Software
00015  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00016  */
00017 
00018 #ifndef GXLIB_GXPROPERTIES_H
00019 #define GXLIB_GXPROPERTIES_H
00020 
00021 #include "../gx.h"
00030 class gxProperties
00031 {
00032 public:
00033    gxProperties();
00034    virtual ~gxProperties();
00035 
00036    typedef std::list<std::string> keys_t;
00037 
00041    void clear();
00042 
00047    bool containsKey( const char * key );
00048 
00052    std::string get( const char * key, const char * defaultValue = "" );
00056    std::string get( const std::string & key, const char * defaultValue = "" );
00057 
00058 
00062    keys_t keys();
00063 
00064 
00068    void put( const char * key, const char * value );
00069 
00074    void put( const char * key, long value );
00075 
00079    void put( const std::string & key, const char * value );
00080 
00084    void put( const std::string & key, long value );
00085 
00089    int size();
00090 private:
00091    // use a string to string map to do the actual storage.
00092    typedef std::map<std::string,std::string> properties_t;
00093    properties_t m_properties;
00094 
00095    gxProperties( const gxProperties & rhs);
00096    gxProperties & operator=( const gxProperties & rhs);
00097 };
00098 #endif

Generated on Mon Nov 21 01:01:35 2005 for gxLib by  doxygen 1.4.5