openModeller  Version 1.4.0
Settings Class Reference

#include <Settings.hh>

Collaboration diagram for Settings:

List of all members.

Public Member Functions

 ~Settings ()

Static Public Member Functions

static void loadConfig (const std::string configFile)
static std::string get (const std::string &key)
static int count (const std::string &key)
static std::vector< std::string > getAll (const std::string &key)

Private Member Functions

 Settings ()

Static Private Member Functions

static Settings_getInstance ()
static void _loadConfig (Settings *settings, const std::string configFile)

Private Attributes

FileParser_fp

Detailed Description

Declaration of Settings class.

Author:
Renato De Giovanni (renato (at) cria . org . br)
Id:

LICENSE INFORMATION

Copyright(c) 2013 by CRIA - Centro de Referencia em Informacao Ambiental

http://www.cria.org.br

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details:

http://www.gnu.org/copyleft/gpl.html Class used to access openModeller settings stored in a key = value configuration file.

Definition at line 42 of file Settings.hh.


Constructor & Destructor Documentation

Definition at line 53 of file Settings.cpp.

References _fp, and _getInstance().

Here is the call graph for this function:

Settings::Settings ( ) [private]

Definition at line 45 of file Settings.cpp.


Member Function Documentation

Settings & Settings::_getInstance ( ) [static, private]

Definition at line 66 of file Settings.cpp.

References _fp, and _loadConfig().

Referenced by count(), get(), getAll(), loadConfig(), and ~Settings().

Here is the call graph for this function:

void Settings::_loadConfig ( Settings settings,
const std::string  configFile 
) [static, private]

Definition at line 87 of file Settings.cpp.

References _fp.

Referenced by _getInstance(), and loadConfig().

int Settings::count ( const std::string &  key) [static]

Return the number of times that a certain key appears in the file.

Parameters:
keyKey to be searched.
Returns:
Number of times that the key was found.

Definition at line 127 of file Settings.cpp.

References _fp, _getInstance(), and FileParser::count().

Referenced by CacheManager::initialize(), initialPluginPath(), RemoteRaster::isFromRejectedSource(), and omDataPath().

Here is the call graph for this function:

std::string Settings::get ( const std::string &  key) [static]

Get the value of a key (case insensitive).

Parameters:
keyKey to be searched.
Returns:
Corresponding Key value.

Definition at line 112 of file Settings.cpp.

References _fp, _getInstance(), and FileParser::get().

Referenced by CacheManager::initialize(), initialPluginPath(), and omDataPath().

Here is the call graph for this function:

std::vector< std::string > Settings::getAll ( const std::string &  key) [static]

Get a set of values with the same key specified in the argument.

Parameters:
keyKey to be searched.
Returns:
Vector of key values.

Definition at line 142 of file Settings.cpp.

References _fp, _getInstance(), and FileParser::getAll().

Referenced by RemoteRaster::isFromRejectedSource().

Here is the call graph for this function:

void Settings::loadConfig ( const std::string  configFile) [static]

Load configuration from file.

Parameters:
configFileConfiguration file (full path)

Definition at line 100 of file Settings.cpp.

References _getInstance(), _loadConfig(), Log::debug(), and Log::instance().

Referenced by main().

Here is the call graph for this function:


Member Data Documentation

Definition at line 79 of file Settings.hh.

Referenced by _getInstance(), _loadConfig(), count(), get(), getAll(), and ~Settings().


The documentation for this class was generated from the following files: