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

include/om/omsettings.h

00001 /* omsettings.h: "global" settings object
00002  *
00003  * ----START-LICENCE----
00004  * Copyright 1999,2000,2001 BrightStation PLC
00005  * Copyright 2002 Ananova Ltd
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License as
00009  * published by the Free Software Foundation; either version 2 of the
00010  * License, or (at your option) any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00020  * USA
00021  * -----END-LICENCE-----
00022  */
00023 
00024 #ifndef OM_HGUARD_OMSETTINGS_H
00025 #define OM_HGUARD_OMSETTINGS_H
00026 
00027 #include <string>
00028 
00030 // OmSettings class
00031 // ================
00032 
00037 class OmSettings {
00038     public:
00039         class Internal;
00041         Internal *internal;
00042 
00045         OmSettings();
00046 
00047         // Maybe add method/constructor to read settings from file?
00048 
00053         OmSettings(const OmSettings &other);
00055         void operator=(const OmSettings &other);
00056 
00058         ~OmSettings();
00059 
00066         void set(const std::string &key, const std::string &value);
00067 
00074         void set(const std::string &key, const char *value);
00075     
00082         void set(const std::string &key, int value);
00083 
00090         void set(const std::string &key, double value);
00091 
00098         void set(const std::string &key, bool value);
00099 
00106         std::string get(const std::string &key) const;
00107 
00112         std::string get(const std::string &key, std::string def) const;
00113 
00120         int get_int(const std::string &key) const;
00121 
00126         int get_int(const std::string &key, int def) const;
00127 
00134         bool get_bool(const std::string &key) const;
00135 
00140         bool get_bool(const std::string &key, bool def) const;
00141 
00148         double get_real(const std::string &key) const;
00149 
00154         double get_real(const std::string &key, double def) const;
00155 
00159         std::string get_description() const;
00160 };
00161 
00162 #endif // OM_HGUARD_OMSETTINGS_H

Documentation for Xapian (version 0.5.5).
Generated on 4 Dec 2002 by Doxygen 1.2.15.