* Lumiera source code always was copyrighted by individual contributors * there is no entity "Lumiera.org" which holds any copyrights * Lumiera source code is provided under the GPL Version 2+ == Explanations == Lumiera as a whole is distributed under Copyleft, GNU General Public License Version 2 or above. For this to become legally effective, the ''File COPYING in the root directory is sufficient.'' The licensing header in each file is not strictly necessary, yet considered good practice; attaching a licence notice increases the likeliness that this information is retained in case someone extracts individual code files. However, it is not by the presence of some text, that legally binding licensing terms become effective; rather the fact matters that a given piece of code was provably copyrighted and published under a license. Even reformatting the code, renaming some variables or deleting parts of the code will not alter this legal situation, but rather creates a derivative work, which is likewise covered by the GPL! The most relevant information in the file header is the notice regarding the time of the first individual copyright claim. By virtue of this initial copyright, the first author is entitled to choose the terms of licensing. All further modifications are permitted and covered by the License. The specific wording or format of the copyright header is not legally relevant, as long as the intention to publish under the GPL remains clear. The extended wording was based on a recommendation by the FSF. It can be shortened, because the full terms of the license are provided alongside the distribution, in the file COPYING.
97 lines
2.8 KiB
C++
97 lines
2.8 KiB
C++
/*
|
||
CONFIGFACADE - C++ convenience wrapper and startup of the config system
|
||
|
||
Copyright (C)
|
||
2008, Hermann Vosseler <Ichthyostega@web.de>
|
||
|
||
**Lumiera** 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. See the file COPYING for further details.
|
||
|
||
*/
|
||
|
||
/** @file config-facade.h
|
||
** The lumiera::Config wrapper class addresses two issues.
|
||
** First, it registers startup and shutdown hooks to bring up the config system
|
||
** as early as possible. Later, on application main initialisation, the global
|
||
** config interface is opened and wrapped for convenient access from C++ code.
|
||
**
|
||
** @note This was created as part of a first draft towards an application
|
||
** wide configuration system. Later (around 2012) it became clear that
|
||
** we can not judge the requirements for such a system yet, so we deferred
|
||
** the topic altogether. Meanwhile, this facade is sporadically used to
|
||
** mark the necessity to retrieve some "parametrisation values".
|
||
** @warning as a preliminary solution, the original configuration system draft
|
||
** was detached and replaced by an _ini file solution_ based on lib Boost.
|
||
**
|
||
** @todo there ought to be an external Interface for the Config subsystem.
|
||
** But the full-blown Config system isn't implemented yet anyway
|
||
**
|
||
** @see config.h
|
||
** @see lumiera::AppState
|
||
** @see main.cpp
|
||
*/
|
||
|
||
|
||
#ifndef INTERFACE_CONFIGFACADE_H
|
||
#define INTERFACE_CONFIGFACADE_H
|
||
|
||
|
||
|
||
|
||
|
||
#ifdef __cplusplus /* ============== C++ Interface ================= */
|
||
|
||
#include "lib/depend.hpp"
|
||
#include "lib/symbol.hpp"
|
||
|
||
#include <string>
|
||
|
||
|
||
namespace lumiera {
|
||
|
||
using std::string;
|
||
|
||
|
||
/*****************************************************************//**
|
||
* C++ wrapper for convenient access to the Lumiera config system.
|
||
*
|
||
* @warning Config system not fully implemented yet. Thus for now
|
||
* this facade is wired with the setup.ini and will just
|
||
* fetch the values from there.
|
||
*/
|
||
class Config
|
||
{
|
||
public:
|
||
static string get (lib::Literal key);
|
||
|
||
static lib::Depend<Config> instance;
|
||
|
||
|
||
private:
|
||
Config();
|
||
~Config();
|
||
friend class lib::DependencyFactory<Config>;
|
||
};
|
||
|
||
|
||
|
||
} // namespace lumiera
|
||
|
||
|
||
|
||
#else /* =========================== C Interface ====================== */
|
||
|
||
|
||
/** retrieve the default plugin search path from the
|
||
* basic applications setup.ini
|
||
* @return a fully expanded string suitable to be fed
|
||
* to the lumiera_config_setdefault function
|
||
* @see lumiera_plugin_discover
|
||
*/
|
||
const char* lumiera_get_plugin_path_default ();
|
||
|
||
|
||
#endif
|
||
#endif
|