From 837399ab0a9aff03a52013b2dfdb43b986af674a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9F=D0=B5=D0=BB=D0=B8=D0=BF=D0=B5=D0=BD=D0=BA=D0=BE=20?= =?UTF-8?q?=D0=98=D0=B2=D0=B0=D0=BD?= Date: Tue, 10 Jan 2017 14:00:42 +0000 Subject: [PATCH] git-svn-id: svn://db.shs.com.ru/pip@301 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5 --- src/core/piinit.cpp | 44 +++++++++++++++++++++++++++++++++++++++++ src/core/piinit.h | 11 +++++++++++ src/io/pibasetransfer.h | 2 ++ 3 files changed, 57 insertions(+) diff --git a/src/core/piinit.cpp b/src/core/piinit.cpp index a74d901e..2e94649d 100644 --- a/src/core/piinit.cpp +++ b/src/core/piinit.cpp @@ -275,6 +275,50 @@ PIInit::~PIInit() { } +bool PIInit::isBuildOptionEnabled(PIInit::BuildOption o) { + switch (o) { + case ICU: return +#ifdef PIP_ICU + true; +#else + false; +#endif + case USB: return +#ifdef PIP_USB + true; +#else + false; +#endif + case STL: return +#ifdef PIP_CONTAINERS_STL + true; +#else + false; +#endif + case Crypt: return +#ifdef PIP_CRYPT + true; +#else + false; +#endif + case IntrospectionContainers: return +#ifdef PIP_INTROSPECTION_CONTAINERS + true; +#else + false; +#endif + case IntrospectionThreads: return +#ifdef PIP_INTROSPECTION_THREADS + true; +#else + false; +#endif + default: return false; + } + return false; +} + + void PIInit::setFileCharset(const char *charset) { if (file_charset) delete file_charset; file_charset = 0; diff --git a/src/core/piinit.h b/src/core/piinit.h index b2a9fccf..f6a46315 100644 --- a/src/core/piinit.h +++ b/src/core/piinit.h @@ -45,7 +45,18 @@ class PIInit { public: PIInit(); ~PIInit(); + + //! \brief Build options which PIP library was built + enum BuildOption { + ICU /*! Unicode support */ = 0x01, + USB /*! USB support */ = 0x02, + STL /*! STL containers implementation */ = 0x04, + Crypt /*! Crypt support */ = 0x08, + IntrospectionContainers /*! Containers introspection */ = 0x010, + IntrospectionThreads /*! Threads introspection */ = 0x20 + }; static PIInit * instance() {return __PIInit_Initializer__::__instance__;} + static bool isBuildOptionEnabled(BuildOption o); private: void setFileCharset(const char *charset); bool fileExists(const PIString & p); diff --git a/src/io/pibasetransfer.h b/src/io/pibasetransfer.h index e709f5d1..55b7ae4c 100644 --- a/src/io/pibasetransfer.h +++ b/src/io/pibasetransfer.h @@ -74,6 +74,8 @@ public: const llong * bytesCur_ptr() const {return &bytes_cur;} const PIDiagnostics &diagnostic() {return diag;} + static uint packetSignature() {return signature;} + EVENT_HANDLER1(void, received, PIByteArray, data); EVENT_HANDLER(void, stop) {stopSend(); stopReceive();} EVENT_HANDLER(void, pause) {setPause(true);}