OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimPreferences.h
Go to the documentation of this file.
1 //*******************************************************************
2 //
3 // License: See top level LICENSE.txt file.
4 //
5 // DESCRIPTION:
6 // Contains declaration of class ossimPreferences. This class provides
7 // a static keywordlist for global preferences. Objects needing access to
8 // application-wide global parameters shall do so through this class.
9 //
10 // SOFTWARE HISTORY:
11 //>
12 // 23Apr2001 Oscar Kramer
13 // Initial coding.
14 //<
15 //*****************************************************************************
16 
17 #ifndef ossimPreferences_HEADER
18 #define ossimPreferences_HEADER
19 
22 
23 /*!****************************************************************************
24  *
25  * CLASS: ossimPreferences
26  *
27  *****************************************************************************/
29 {
30 public:
31  // This is only here so we can swig wrap this. The destructor should never be called directly.
37  static ossimPreferences* instance();
38 
44  bool loadPreferences();
45  bool loadPreferences(const ossimFilename& pathname);
46 
52  bool savePreferences() const;
53  bool savePreferences(const ossimFilename& pathname);
54 
59  const char* findPreference(const char* key) const {return theKWL.find(key);}
60 
61 
67  void addPreference(const char* key,
68  const char* value);
69 
77  const ossimKeywordlist& preferencesKWL() const { return theKWL; }
78 
86  ossimKeywordlist& preferencesKWL() { return theKWL; }
87 
88  void addPreferences(const ossimKeywordlist& kwl,
89  const char* prefix=0,
90  bool stripPrefix=true);
91 
93  ossimFilename getPreferencesFilename() const;
94 
95 protected:
101 
102  void operator = (const ossimPreferences&) const {}
103 
107  mutable bool theInstanceIsModified;
108 };
109 
110 #endif
const ossimKeywordlist & preferencesKWL() const
#define OSSIMDLLEXPORT
Represents serializable keyword/value map.
ossimKeywordlist & preferencesKWL()
ossimKeywordlist theKWL
ossimPreferences(const ossimPreferences &)
const char * findPreference(const char *key) const
static ossimPreferences * theInstance
ossimFilename thePrefFilename