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);}