OSSIM - Open Source Software Image Map
Version 1.9.0 (20180803)
|
#include <ossimPreferences.h>
Public Member Functions | |
~ossimPreferences () | |
bool | loadPreferences () |
bool | loadPreferences (const ossimFilename &pathname) |
bool | savePreferences () const |
bool | savePreferences (const ossimFilename &pathname) |
const char * | findPreference (const char *key) const |
void | addPreference (const char *key, const char *value) |
const ossimKeywordlist & | preferencesKWL () const |
ossimKeywordlist & | preferencesKWL () |
void | addPreferences (const ossimKeywordlist &kwl, const char *prefix=0, bool stripPrefix=true) |
ossimFilename | getPreferencesFilename () const |
Static Public Member Functions | |
static ossimPreferences * | instance () |
Protected Member Functions | |
ossimPreferences () | |
ossimPreferences (const ossimPreferences &) | |
void | operator= (const ossimPreferences &) const |
Protected Attributes | |
ossimKeywordlist | theKWL |
ossimFilename | thePrefFilename |
bool | theInstanceIsModified |
Static Protected Attributes | |
static ossimPreferences * | theInstance = NULL |
ossimPreferences::~ossimPreferences | ( | ) |
Definition at line 45 of file ossimPreferences.cpp.
References theInstance.
|
protected |
Override the compiler default constructors:
If is found in the preferences file, expand it in place.
Definition at line 35 of file ossimPreferences.cpp.
References loadPreferences(), ossimKeywordlist::setExpandEnvVarsFlag(), and theKWL.
Referenced by instance().
|
inlineprotected |
Definition at line 100 of file ossimPreferences.h.
void ossimPreferences::addPreference | ( | const char * | key, |
const char * | value | ||
) |
METHOD: addPreference() Inserts keyword/value pair into the in-memory preferences KWL. It does save to disk. App must do a savePreferences() for changes to be saved.
Definition at line 247 of file ossimPreferences.cpp.
References ossimKeywordlist::add(), theInstanceIsModified, and theKWL.
void ossimPreferences::addPreferences | ( | const ossimKeywordlist & | kwl, |
const char * | prefix = 0 , |
||
bool | stripPrefix = true |
||
) |
Definition at line 253 of file ossimPreferences.cpp.
References ossimKeywordlist::add(), theInstanceIsModified, and theKWL.
Referenced by ossimIgen::initializeAttributes().
|
inline |
METHOD: findPreference() Performs a lookup for the specified keyword in the preferences KWL:
Definition at line 59 of file ossimPreferences.h.
Referenced by ossimGdalTileSource::getDefaults(), ossim::getNumberOfThreads(), ossimOverviewBuilderBase::initializePreferenceSettings(), ossimImageHandlerRegistry::initializeStateCache(), ossimAppTileCache::instance(), ossimOrthoIgen::ossimOrthoIgen(), ossimStdOutProgress::ossimStdOutProgress(), and ossimImageChainMtAdaptor::setNumberOfThreads().
ossimFilename ossimPreferences::getPreferencesFilename | ( | ) | const |
Definition at line 261 of file ossimPreferences.cpp.
References thePrefFilename.
Referenced by ossimInfo::printConfiguration().
|
static |
METHOD: instance() The static singleton instance of this object is accessed via this method:
METHOD: ossimPreferences::instance()
This is the method by which run-time objects access this singleton instance
Simply return the instance if already created:
Create the static instance of this class:
Definition at line 56 of file ossimPreferences.cpp.
References ossimPreferences(), and theInstance.
Referenced by ossim::computeLevels(), ossimplugins::ossimGeometricSarSensorModel::createReplacementOCG(), ossim::defaultTileSize(), ossimGdalOgrVectorAnnotation::getDefaults(), ossimGdalTileSource::getDefaults(), ossimTool::getKwlTemplate(), ossim::getNumberOfThreads(), ossim::AwsStreamFactory::initClient(), ossimEpsgProjectionDatabase::initialize(), ossimIgen::initializeAttributes(), ossimNitfWriterBase::initializeDefaultsFromConfigFile(), ossimInit::initializePlugins(), ossimOverviewBuilderBase::initializePreferenceSettings(), ossimImageHandlerRegistry::initializeStateCache(), ossimAppTileCache::instance(), ossim::JsonConfig::JsonConfig(), ossimWktProjectionFactory::loadRecords(), ossimDtedElevationDatabase::loadState(), ossimDemTool::ossimDemTool(), ossimFilterResampler::ossimFilterResampler(), ossimH5Options::ossimH5Options(), ossimOrthoIgen::ossimOrthoIgen(), ossimStdOutProgress::ossimStdOutProgress(), ossimNitfFileHeaderV2_1::parseStream(), ossimNitfXmlDataContentDes::print(), ossimNitfDesInformation::print(), ossimInfo::printConfiguration(), ossimDemToolConfig::readConfig(), ATP::AtpConfig::readConfig(), ossim::S3StreamBuffer::S3StreamBuffer(), and ossimImageChainMtAdaptor::setNumberOfThreads().
bool ossimPreferences::loadPreferences | ( | ) |
METHOD: loadPreferences() These methods clear the current preferences and load either the default preferences file or the specified file. Returns TRUE if loaded properly:
METHOD: loadPreferences()
Loads the preferences file specified in the runtime environment.
Fetch preferences file name from environment:
Load the preferences file into the static keywordlist object:
Check for error opening KWL:
Definition at line 78 of file ossimPreferences.cpp.
Referenced by ossimPreferences().
bool ossimPreferences::loadPreferences | ( | const ossimFilename & | pathname | ) |
METHOD: loadPreferences(filename)
Loads the preferences file specified in the arg.
First clear the existing KWL:
Load the preferences file into the static keywordlist object:
Check for error opening KWL:
Definition at line 134 of file ossimPreferences.cpp.
|
inlineprotected |
Definition at line 102 of file ossimPreferences.h.
|
inline |
METHOD: preferencesKWL() An alternative to utilizing findPreference(), for objects derived from ossimObject, is to access the preferences KWL with this method (typically during construction) and provide it to the object's loadState() method.
Definition at line 77 of file ossimPreferences.h.
Referenced by ossimEpsgProjectionDatabase::initialize(), ossimInit::initializeLogFile(), ossimInit::initializePlugins(), ossimWktProjectionFactory::loadRecords(), ossimDtedElevationDatabase::loadState(), and ossimInfo::printConfiguration().
|
inline |
METHOD: preferencesKWL() An alternative to utilizing findPreference(), for objects derived from ossimObject, is to access the preferences KWL with this method (typically during construction) and provide it to the object's loadState() method.
Definition at line 86 of file ossimPreferences.h.
bool ossimPreferences::savePreferences | ( | ) | const |
METHOD: savePrefences() This method permits saving the preferences file to the default location or to a specified location:
METHOD: ossimPreferences::savePreferences()
Saves KWL to the current filename.
Save the file to current preferences filename:
Definition at line 184 of file ossimPreferences.cpp.
bool ossimPreferences::savePreferences | ( | const ossimFilename & | pathname | ) |
METHOD: ossimPreferences::savePreferences(filename)
Saves KWL to the specified filename.
Save the file to the specified preferences filename:
Definition at line 219 of file ossimPreferences.cpp.
|
staticprotected |
Definition at line 104 of file ossimPreferences.h.
Referenced by instance(), and ~ossimPreferences().
|
mutableprotected |
Definition at line 107 of file ossimPreferences.h.
Referenced by addPreference(), and addPreferences().
|
protected |
Definition at line 105 of file ossimPreferences.h.
Referenced by addPreference(), addPreferences(), and ossimPreferences().
|
protected |
Definition at line 106 of file ossimPreferences.h.
Referenced by getPreferencesFilename().