Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

include/om/omsettings.h

Go to the documentation of this file.
00001 
00004 /* ----START-LICENCE----
00005  * Copyright 1999,2000,2001 BrightStation PLC
00006  * Copyright 2002 Ananova Ltd
00007  *
00008  * This program is free software; you can redistribute it and/or
00009  * modify it under the terms of the GNU General Public License as
00010  * published by the Free Software Foundation; either version 2 of the
00011  * License, or (at your option) any later version.
00012  *
00013  * This program is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  * GNU General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU General Public License
00019  * along with this program; if not, write to the Free Software
00020  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00021  * USA
00022  * -----END-LICENCE-----
00023  */
00024 
00025 #ifndef OM_HGUARD_OMSETTINGS_H
00026 #define OM_HGUARD_OMSETTINGS_H
00027 
00028 #include <string>
00029 
00034 class OmSettings {
00035     public:
00036         class Internal;
00038         Internal *internal;
00039 
00042         OmSettings();
00043 
00044         // Maybe add method/constructor to read settings from file?
00045 
00050         OmSettings(const OmSettings &other);
00052         void operator=(const OmSettings &other);
00053 
00055         ~OmSettings();
00056 
00063         void set(const std::string &key, const std::string &value);
00064 
00071         void set(const std::string &key, const char *value);
00072     
00079         void set(const std::string &key, int value);
00080 
00087         void set(const std::string &key, double value);
00088 
00095         void set(const std::string &key, bool value);
00096 
00103         std::string get(const std::string &key) const;
00104 
00109         std::string get(const std::string &key, std::string def) const;
00110 
00117         int get_int(const std::string &key) const;
00118 
00123         int get_int(const std::string &key, int def) const;
00124 
00131         bool get_bool(const std::string &key) const;
00132 
00137         bool get_bool(const std::string &key, bool def) const;
00138 
00145         double get_real(const std::string &key) const;
00146 
00151         double get_real(const std::string &key, double def) const;
00152 
00156         std::string get_description() const;
00157 };
00158 
00159 #endif // OM_HGUARD_OMSETTINGS_H

Documentation for Xapian (version 0.6.1).
Generated on 7 Dec 2002 by Doxygen 1.2.15.