diff --git a/.travis.yml b/.travis.yml index d0d587369..eb167d29a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,6 +25,11 @@ before_install: services: - mongodb - redis-server + - postgresql + +addons: + postgresql: "9.3" + notifications: slack: @@ -50,7 +55,7 @@ matrix: - export CC="clang" - export CXX="clang++" - clang++ -x c++ /dev/null -dM -E - - ./configure --everything --omit=Data/ODBC,Data/MySQL,Data/SQLite && make -s -j2 + - ./configure --everything --omit=Data/ODBC,Data/MySQL,Data/SQLite,Data/PostgreSQL && make -s -j2 - sudo make install - ./travis/OSX/runtests.sh @@ -145,7 +150,7 @@ matrix: # TODO osx build # TODO run test suite # script: - # - ./configure && make -s -j2 + # - ./configure && make -s -i -j2 # - sudo ifconfig -a # - sudo ifconfig venet0 multicast # - sudo ifconfig -a diff --git a/CMakeLists.txt b/CMakeLists.txt index 6919fa8f3..1f76640bf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,6 +70,7 @@ option(ENABLE_CRYPTO "Enable Crypto" ON) option(ENABLE_DATA "Enable Data" ON) option(ENABLE_DATA_SQLITE "Enable Data SQlite" ON) option(ENABLE_DATA_MYSQL "Enable Data MySQL" ON) +option(ENABLE_DATA_POSTGRESQL "Enable Data PosgreSQL" ON) option(ENABLE_DATA_ODBC "Enable Data ODBC" ON) option(ENABLE_SEVENZIP "Enable SevenZip" OFF) option(ENABLE_ZIP "Enable Zip" ON) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 9c74a2d7f..d22f95fc5 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -48,12 +48,13 @@ Christopher Baker Scott Davis Jeff Adams Martin Osborne -Björn Schramke +Björn Schramke Jonathan Seeley Tor Lillqvist Alexander Bychuk -Francisco Ramírez +Francisco Ramirez Francis André Benoît Bleuzé +Kostya Lutsenko -- $Id$ diff --git a/Crypto/include/Poco/Crypto/X509Certificate.h b/Crypto/include/Poco/Crypto/X509Certificate.h index 72d39ca0c..f4e09cdbf 100644 --- a/Crypto/include/Poco/Crypto/X509Certificate.h +++ b/Crypto/include/Poco/Crypto/X509Certificate.h @@ -130,6 +130,14 @@ public: /// Returns true if verification against the issuer certificate /// was successful, false otherwise. + bool equals(const X509Certificate& otherCertificate) const; + /// Checks whether the certificate is equal to + /// the other certificate, by comparing the hashes + /// of both certificates. + /// + /// Returns true if both certificates are identical, + /// otherwise false. + const X509* certificate() const; /// Returns the underlying OpenSSL certificate. diff --git a/Crypto/src/X509Certificate.cpp b/Crypto/src/X509Certificate.cpp index f2263dcfd..0137c6bfc 100644 --- a/Crypto/src/X509Certificate.cpp +++ b/Crypto/src/X509Certificate.cpp @@ -284,4 +284,12 @@ bool X509Certificate::issuedBy(const X509Certificate& issuerCertificate) const } +bool X509Certificate::equals(const X509Certificate& otherCertificate) const +{ + X509* pCert = const_cast(_pCert); + X509* pOtherCert = const_cast(otherCertificate.certificate()); + return X509_cmp(pCert, pOtherCert) == 0; +} + + } } // namespace Poco::Crypto diff --git a/Crypto/testsuite/src/CryptoTest.cpp b/Crypto/testsuite/src/CryptoTest.cpp index c5e46512d..ae3c58525 100644 --- a/Crypto/testsuite/src/CryptoTest.cpp +++ b/Crypto/testsuite/src/CryptoTest.cpp @@ -304,6 +304,11 @@ void CryptoTest::testCertificate() // fails with recent OpenSSL versions: // assert (cert.issuedBy(cert)); + + std::istringstream otherCertStream(APPINF_PEM); + X509Certificate otherCert(otherCertStream); + + assert (cert.equals(otherCert)); } diff --git a/DLLVersion.rc b/DLLVersion.rc index 5f0dd0591..9c2920005 100644 --- a/DLLVersion.rc +++ b/DLLVersion.rc @@ -4,8 +4,8 @@ #include "winres.h" -#define POCO_VERSION 1,7,0,0 -#define POCO_VERSION_STR "1.7.0" +#define POCO_VERSION 2,0,0,0 +#define POCO_VERSION_STR "2.0.0" VS_VERSION_INFO VERSIONINFO FILEVERSION POCO_VERSION @@ -28,7 +28,7 @@ BEGIN VALUE "FileDescription", "This file is part of the POCO C++ Libraries." VALUE "FileVersion", POCO_VERSION_STR VALUE "InternalName", "POCO" - VALUE "LegalCopyright", "Copyright (C) 2004-2015, Applied Informatics Software Engineering GmbH and Contributors." + VALUE "LegalCopyright", "Copyright (C) 2004-2016, Applied Informatics Software Engineering GmbH and Contributors." VALUE "ProductName", "POCO C++ Libraries - http://pocoproject.org" VALUE "ProductVersion", POCO_VERSION_STR END diff --git a/Data/CMakeLists.txt b/Data/CMakeLists.txt index 3d6044ab9..2c06eca4f 100644 --- a/Data/CMakeLists.txt +++ b/Data/CMakeLists.txt @@ -55,6 +55,17 @@ if(ENABLE_DATA_MYSQL) endif(MYSQL_FOUND) endif(ENABLE_DATA_MYSQL) +if(ENABLE_DATA_POSTGRESQL) + find_package(PostgreSQL) + if(POSTGRESQL_FOUND) + include_directories("${POSTGRESQL_INCLUDE_DIR}") + message(STATUS "PostgreSQL Support Enabled") + add_subdirectory( PostgreSQL ) + else() + message(STATUS "PostgreSQL Support Disabled - no PostgreSQL library") + endif(POSTGRESQL_FOUND) +endif(ENABLE_DATA_POSTGRESQL) + if(ENABLE_DATA_ODBC) find_package(ODBC) if(WIN32 AND NOT WINCE) diff --git a/Data/Data_vs120.vcxproj b/Data/Data_vs120.vcxproj index c79317c55..621e408a1 100644 --- a/Data/Data_vs120.vcxproj +++ b/Data/Data_vs120.vcxproj @@ -1,4 +1,4 @@ - + @@ -32,7 +32,7 @@ Data Win32Proj - + StaticLibrary MultiByte @@ -63,27 +63,27 @@ MultiByte v120 - - + + - + - + - + - + - + - + - + <_ProjectFileVersion>12.0.30501.0 PocoDatad @@ -125,17 +125,18 @@ .\include;..\Foundation\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_WINDOWS;_USRDLL;Data_EXPORTS;%(PreprocessorDefinitions) true - true + false EnableFastChecks MultiThreadedDebugDLL true true true true - + Level3 ProgramDatabase Default + true ..\bin\PocoDatad.dll @@ -163,9 +164,9 @@ true true true - + Level3 - + Default @@ -186,18 +187,19 @@ .\include;..\Foundation\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions) true - true + false EnableFastChecks MultiThreadedDebug true true true true - + ..\lib\PocoDatamtd.pdb Level3 ProgramDatabase Default + true ..\lib\PocoDatamtd.lib @@ -218,9 +220,9 @@ true true true - + Level3 - + Default @@ -233,18 +235,19 @@ .\include;..\Foundation\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions) true - true + false EnableFastChecks MultiThreadedDebugDLL true true true true - + ..\lib\PocoDatamdd.pdb Level3 ProgramDatabase Default + true ..\lib\PocoDatamdd.lib @@ -265,10 +268,10 @@ true true true - + ..\lib\PocoDatamd.pdb Level3 - + Default @@ -365,6 +368,6 @@ - - + + diff --git a/Data/Data_x64_vs120.vcxproj b/Data/Data_x64_vs120.vcxproj index 75d41a25b..256bf3644 100644 --- a/Data/Data_x64_vs120.vcxproj +++ b/Data/Data_x64_vs120.vcxproj @@ -1,4 +1,4 @@ - + @@ -32,7 +32,7 @@ Data Win32Proj - + StaticLibrary MultiByte @@ -63,27 +63,27 @@ MultiByte v120 - - + + - + - + - + - + - + - + - + <_ProjectFileVersion>12.0.30501.0 PocoData64d @@ -125,18 +125,19 @@ .\include;..\Foundation\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_WINDOWS;_USRDLL;Data_EXPORTS;%(PreprocessorDefinitions) true - true + false EnableFastChecks MultiThreadedDebugDLL true true true true - + Level3 ProgramDatabase Default /bigobj %(AdditionalOptions) + true ..\bin64\PocoData64d.dll @@ -164,11 +165,12 @@ true true true - + Level3 - + Default /bigobj %(AdditionalOptions) + true ..\bin64\PocoData64.dll @@ -188,19 +190,20 @@ .\include;..\Foundation\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions) true - true + false EnableFastChecks MultiThreadedDebug true true true true - + ..\lib64\PocoDatamtd.pdb Level3 ProgramDatabase Default /bigobj %(AdditionalOptions) + true ..\lib64\PocoDatamtd.lib @@ -221,11 +224,12 @@ true true true - + Level3 - + Default /bigobj %(AdditionalOptions) + true ..\lib64\PocoDatamt.lib @@ -237,19 +241,20 @@ .\include;..\Foundation\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_WINDOWS;POCO_STATIC;%(PreprocessorDefinitions) true - true + false EnableFastChecks MultiThreadedDebugDLL true true true true - + ..\lib64\PocoDatamdd.pdb Level3 ProgramDatabase Default /bigobj %(AdditionalOptions) + true ..\lib64\PocoDatamdd.lib @@ -270,11 +275,12 @@ true true true - + Level3 - + Default /bigobj %(AdditionalOptions) + true ..\lib64\PocoDatamd.lib @@ -370,6 +376,6 @@ - - + + diff --git a/Data/MySQL/include/Poco/Data/MySQL/Binder.h b/Data/MySQL/include/Poco/Data/MySQL/Binder.h index 6f6374acd..5c1c15752 100644 --- a/Data/MySQL/include/Poco/Data/MySQL/Binder.h +++ b/Data/MySQL/include/Poco/Data/MySQL/Binder.h @@ -42,71 +42,71 @@ public: virtual ~Binder(); /// Destroys the Binder. - virtual void bind(std::size_t pos, const Poco::Int8& val, Direction dir); + virtual void bind(std::size_t pos, const Poco::Int8& val, Direction dir, const WhenNullCb& nullCb); /// Binds an Int8. - virtual void bind(std::size_t pos, const Poco::UInt8& val, Direction dir); + virtual void bind(std::size_t pos, const Poco::UInt8& val, Direction dir, const WhenNullCb& nullCb); /// Binds an UInt8. - virtual void bind(std::size_t pos, const Poco::Int16& val, Direction dir); + virtual void bind(std::size_t pos, const Poco::Int16& val, Direction dir, const WhenNullCb& nullCb); /// Binds an Int16. - virtual void bind(std::size_t pos, const Poco::UInt16& val, Direction dir); + virtual void bind(std::size_t pos, const Poco::UInt16& val, Direction dir, const WhenNullCb& nullCb); /// Binds an UInt16. - virtual void bind(std::size_t pos, const Poco::Int32& val, Direction dir); + virtual void bind(std::size_t pos, const Poco::Int32& val, Direction dir, const WhenNullCb& nullCb); /// Binds an Int32. - virtual void bind(std::size_t pos, const Poco::UInt32& val, Direction dir); + virtual void bind(std::size_t pos, const Poco::UInt32& val, Direction dir, const WhenNullCb& nullCb); /// Binds an UInt32. - virtual void bind(std::size_t pos, const Poco::Int64& val, Direction dir); + virtual void bind(std::size_t pos, const Poco::Int64& val, Direction dir, const WhenNullCb& nullCb); /// Binds an Int64. - virtual void bind(std::size_t pos, const Poco::UInt64& val, Direction dir); + virtual void bind(std::size_t pos, const Poco::UInt64& val, Direction dir, const WhenNullCb& nullCb); /// Binds an UInt64. #ifndef POCO_LONG_IS_64_BIT - virtual void bind(std::size_t pos, const long& val, Direction dir = PD_IN); + virtual void bind(std::size_t pos, const long& val, Direction dir, const WhenNullCb& nullCb); /// Binds a long. - virtual void bind(std::size_t pos, const unsigned long& val, Direction dir = PD_IN); + virtual void bind(std::size_t pos, const unsigned long& val, Direction dir, const WhenNullCb& nullCb); /// Binds an unsigned long. #endif // POCO_LONG_IS_64_BIT - virtual void bind(std::size_t pos, const bool& val, Direction dir); + virtual void bind(std::size_t pos, const bool& val, Direction dir, const WhenNullCb& nullCb); /// Binds a boolean. - virtual void bind(std::size_t pos, const float& val, Direction dir); + virtual void bind(std::size_t pos, const float& val, Direction dir, const WhenNullCb& nullCb); /// Binds a float. - virtual void bind(std::size_t pos, const double& val, Direction dir); + virtual void bind(std::size_t pos, const double& val, Direction dir, const WhenNullCb& nullCb); /// Binds a double. - virtual void bind(std::size_t pos, const char& val, Direction dir); + virtual void bind(std::size_t pos, const char& val, Direction dir, const WhenNullCb& nullCb); /// Binds a single character. - virtual void bind(std::size_t pos, const std::string& val, Direction dir); + virtual void bind(std::size_t pos, const std::string& val, Direction dir, const WhenNullCb& nullCb); /// Binds a string. - virtual void bind(std::size_t pos, const Poco::Data::BLOB& val, Direction dir); + virtual void bind(std::size_t pos, const Poco::Data::BLOB& val, Direction dir, const WhenNullCb& nullCb); /// Binds a BLOB. - virtual void bind(std::size_t pos, const Poco::Data::CLOB& val, Direction dir); + virtual void bind(std::size_t pos, const Poco::Data::CLOB& val, Direction dir, const WhenNullCb& nullCb); /// Binds a CLOB. - virtual void bind(std::size_t pos, const DateTime& val, Direction dir); + virtual void bind(std::size_t pos, const DateTime& val, Direction dir, const WhenNullCb& nullCb); /// Binds a DateTime. - virtual void bind(std::size_t pos, const Date& val, Direction dir); + virtual void bind(std::size_t pos, const Date& val, Direction dir, const WhenNullCb& nullCb); /// Binds a Date. - virtual void bind(std::size_t pos, const Time& val, Direction dir); + virtual void bind(std::size_t pos, const Time& val, Direction dir, const WhenNullCb& nullCb); /// Binds a Time. - virtual void bind(std::size_t pos, const NullData& val, Direction dir); + virtual void bind(std::size_t pos, const NullData& val, Direction dir, const std::type_info& bindType); /// Binds a null. @@ -212,11 +212,11 @@ public: virtual void bind(std::size_t pos, const std::list