101 lines
4.0 KiB
C++
101 lines
4.0 KiB
C++
//! \~\ingroup Core
|
|
//! \~\file piinit.h
|
|
//! \~\brief
|
|
//! \~english Library initialization
|
|
//! \~russian Инициализация библиотеки
|
|
//! \details
|
|
//! \~english This file provides initialization and build information for the PIP library.
|
|
//! \~russian Этот файл предоставляет инициализацию и информацию о сборке для библиотеки PIP.//! \}
|
|
|
|
/*
|
|
PIP - Platform Independent Primitives
|
|
Initialization
|
|
Ivan Pelipenko peri4ko@yandex.ru
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
it under the terms of the GNU Lesser General Public License as published by
|
|
the Free Software Foundation, either version 3 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 Lesser General Public License for more details.
|
|
|
|
You should have received a copy of the GNU Lesser General Public License
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
#ifndef PIINIT_H
|
|
#define PIINIT_H
|
|
|
|
#include "pibase.h"
|
|
|
|
#ifndef MICRO_PIP
|
|
|
|
# include "piincludes.h"
|
|
|
|
|
|
class PIFile;
|
|
class PIStringList;
|
|
|
|
class PIP_EXPORT __PIInit_Initializer__ {
|
|
public:
|
|
__PIInit_Initializer__();
|
|
~__PIInit_Initializer__();
|
|
static int count_;
|
|
static PIInit * __instance__;
|
|
};
|
|
|
|
static __PIInit_Initializer__ __piinit_initializer__;
|
|
|
|
//! \~\ingroup Core
|
|
//! \~\brief
|
|
//! \~english Library initialization singleton and build information access point.
|
|
//! \~russian Синглтон инициализации библиотеки и точка доступа к сведениям о сборке.
|
|
class PIP_EXPORT PIInit {
|
|
friend class __PIInit_Initializer__;
|
|
friend class PIFile;
|
|
|
|
public:
|
|
~PIInit();
|
|
|
|
//! \~\ingroup Core
|
|
//! \~english Build options enabled in the current PIP library
|
|
//! \~russian Опции, включенные в текущей сборке библиотеки PIP
|
|
enum BuildOption {
|
|
boICU /*! \~english Unicode support by ICU \~russian Поддержка юникода через ICU */ = 0x01,
|
|
boUSB /*! \~english USB support \~russian Поддержка USB */ = 0x02,
|
|
boCrypt /*! \~english Crypt support \~russian Поддержка шифрования */ = 0x08,
|
|
boIntrospection /*! \~english Introspection \~russian Интроспекция */ = 0x010,
|
|
boFFTW /*! \~english FFTW3 support \~russian Поддержка FFTW3 */ = 0x40,
|
|
boCompress /*! \~english Zlib compression support \~russian Поддержка сжатия Zlib */ = 0x80,
|
|
boOpenCL /*! \~english OpenCL support \~russian Поддержка OpenCL */ = 0x100,
|
|
boCloud /*! \~english PICloud transport support \~russian Поддержка облачного транспорта PICloud */ = 0x200,
|
|
boConsole /*! \~english Console graphics support \~russian Поддержка графики в консоли */ = 0x400,
|
|
};
|
|
|
|
//! \~english Returns current global %PIInit instance.
|
|
//! \~russian Возвращает текущий глобальный экземпляр %PIInit.
|
|
static PIInit * instance() { return __PIInit_Initializer__::__instance__; }
|
|
|
|
//! \~\ingroup Core
|
|
//! \~english Returns whether build option was enabled
|
|
//! \~russian Возвращает, была ли опция включена при сборке
|
|
static bool isBuildOptionEnabled(BuildOption o);
|
|
|
|
//! \~\ingroup Core
|
|
//! \~english Returns enabled build options as string list
|
|
//! \~russian Возвращает включенные опции сборки в виде списка строк
|
|
static PIStringList buildOptions();
|
|
|
|
private:
|
|
explicit PIInit();
|
|
bool fileExists(const PIString & p);
|
|
PRIVATE_DECLARATION(PIP_EXPORT)
|
|
};
|
|
|
|
|
|
#endif // MICRO_PIP
|
|
#endif // PIINIT_H
|