Skip to content

Commit

Permalink
Merge branch 'main' into stack-trace
Browse files Browse the repository at this point in the history
  • Loading branch information
aleks-f authored Oct 9, 2024
2 parents d75d0df + 13bbea7 commit b0ea609
Show file tree
Hide file tree
Showing 70 changed files with 6,472 additions and 4,989 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ jobs:
make all -s -j4 ARCHFLAGS="-mcpu=cortex-a8 -mfloat-abi=hard -mfpu=neon" TOOL=arm-linux-gnueabihf
macos-clang-make:
runs-on: macos-12
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- run: brew install [email protected] mysql-client unixodbc libpq
Expand Down Expand Up @@ -284,8 +284,8 @@ jobs:
./ci/runtests.sh
macos-clang-make-visibility-hidden:
# macos-12 runs on Intel CPU
runs-on: macos-12
# macos-13 runs on Intel CPU
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- run: brew install [email protected] mysql-client unixodbc libpq
Expand Down Expand Up @@ -314,9 +314,9 @@ jobs:
EXCLUDE_TESTS="Redis Data/MySQL Data/ODBC Data/PostgreSQL MongoDB PDF"
./ci/runtests.sh
macos-clang-cmake-openssl-trace:
# macos-14 runs on Apple Silicon
runs-on: macos-14
macos-clang-cmake-openssl:
# macos-latest runs on Apple Silicon
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- run: brew install [email protected] mysql-client unixodbc libpq
Expand All @@ -341,7 +341,7 @@ jobs:
ctest --output-on-failure -E "(DataMySQL)|(DataODBC)|(PostgreSQL)|(MongoDB)|(Redis)"
macos-clang-cmake-openssl3:
runs-on: macos-14
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- run: brew install openssl@3 mysql-client unixodbc libpq
Expand All @@ -366,7 +366,7 @@ jobs:
ctest --output-on-failure -E "(DataMySQL)|(DataODBC)|(PostgreSQL)|(MongoDB)|(Redis)"
macos-clang-cmake-openssl3-visibility-hidden:
runs-on: macos-14
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- run: brew install openssl@3 mysql-client unixodbc libpq
Expand All @@ -391,7 +391,7 @@ jobs:
ctest --output-on-failure -E "(DataMySQL)|(DataODBC)|(PostgreSQL)|(MongoDB)|(Redis)"
macos-clang-make-openssl3-tsan:
runs-on: macos-14
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- run: brew install openssl@3
Expand Down Expand Up @@ -421,7 +421,7 @@ jobs:
./ci/runtests.sh TSAN
macos-clang-make-openssl3-ubsan:
runs-on: macos-12
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- run: brew install openssl@3 mysql-client unixodbc libpq
Expand Down Expand Up @@ -451,7 +451,7 @@ jobs:
./ci/runtests.sh
macos-clang-make-openssl3-asan:
runs-on: macos-12
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- run: brew install openssl@3 mysql-client unixodbc libpq
Expand Down
10 changes: 9 additions & 1 deletion Data/include/Poco/Data/LOB.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,15 @@ class LOB
{
}

LOB(const std::basic_string<T>& content):
template<typename U = T>
LOB(const std::enable_if_t<std::is_same_v<T, U> && std::is_same_v<U, char>, std::string>& content):
_pContent(new std::vector<T>(content.begin(), content.end()))
/// Creates a LOB from a string.
{
}

template<typename U = T>
LOB(const std::enable_if_t<std::is_same_v<T, U> && std::is_same_v<U, wchar_t>, std::wstring>& content):
_pContent(new std::vector<T>(content.begin(), content.end()))
/// Creates a LOB from a string.
{
Expand Down
7 changes: 1 addition & 6 deletions Foundation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ else()
POCO_SOURCES(SRCS pcre2
src/pcre2_auto_possess.c
src/pcre2_chartables.c
src/pcre2_chkdint.c
src/pcre2_compile.c
src/pcre2_config.c
src/pcre2_context.c
Expand Down Expand Up @@ -69,12 +70,6 @@ else()
src/pcre2_xclass.c
)

# zlib
POCO_HEADERS(SRCS zlib
include/Poco/zconf.h
include/Poco/zlib.h
)

POCO_SOURCES(SRCS zlib
src/adler32.c
src/compress.c
Expand Down
1 change: 1 addition & 0 deletions Foundation/Foundation_vs160.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1047,6 +1047,7 @@
<ClCompile Include="src\PatternFormatter.cpp" />
<ClCompile Include="src\pcre2_auto_possess.c" />
<ClCompile Include="src\pcre2_chartables.c" />
<ClCompile Include="src\pcre2_chkdint.c" />
<ClCompile Include="src\pcre2_compile.c" />
<ClCompile Include="src\pcre2_config.c" />
<ClCompile Include="src\pcre2_context.c" />
Expand Down
3 changes: 3 additions & 0 deletions Foundation/Foundation_vs160.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -846,6 +846,9 @@
<ClCompile Include="src\pcre2_chartables.c">
<Filter>RegularExpression\PCRE2 Source Files</Filter>
</ClCompile>
<ClCompile Include="src\pcre2_chkdint.c">
<Filter>RegularExpression\PCRE2 Source Files</Filter>
</ClCompile>
<ClCompile Include="src\pcre2_compile.c">
<Filter>RegularExpression\PCRE2 Source Files</Filter>
</ClCompile>
Expand Down
1 change: 1 addition & 0 deletions Foundation/Foundation_vs170.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1509,6 +1509,7 @@
<ClCompile Include="src\PatternFormatter.cpp" />
<ClCompile Include="src\pcre2_auto_possess.c" />
<ClCompile Include="src\pcre2_chartables.c" />
<ClCompile Include="src\pcre2_chkdint.c" />
<ClCompile Include="src\pcre2_compile.c" />
<ClCompile Include="src\pcre2_config.c" />
<ClCompile Include="src\pcre2_context.c" />
Expand Down
3 changes: 3 additions & 0 deletions Foundation/Foundation_vs170.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -846,6 +846,9 @@
<ClCompile Include="src\pcre2_chartables.c">
<Filter>RegularExpression\PCRE2 Source Files</Filter>
</ClCompile>
<ClCompile Include="src\pcre2_chkdint.c">
<Filter>RegularExpression\PCRE2 Source Files</Filter>
</ClCompile>
<ClCompile Include="src\pcre2_compile.c">
<Filter>RegularExpression\PCRE2 Source Files</Filter>
</ClCompile>
Expand Down
2 changes: 1 addition & 1 deletion Foundation/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ objects = ArchiveStrategy Ascii ASCIIEncoding AsyncChannel AsyncNotificationCent
zlib_objects = adler32 compress crc32 deflate \
infback inffast inflate inftrees trees zutil

pcre_objects = pcre2_auto_possess pcre2_chartables pcre2_compile pcre2_config \
pcre_objects = pcre2_auto_possess pcre2_chartables pcre2_chkdint pcre2_compile pcre2_config \
pcre2_context pcre2_convert pcre2_dfa_match pcre2_error pcre2_extuni \
pcre2_find_bracket pcre2_jit_compile pcre2_maketables pcre2_match \
pcre2_match_data pcre2_newline pcre2_ord2utf pcre2_pattern_info \
Expand Down
9 changes: 8 additions & 1 deletion Foundation/include/Poco/DateTime.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ class Foundation_API DateTime
/// Notes:
/// * Zero is a valid year (in accordance with ISO 8601 and astronomical year numbering)
/// * Year zero (0) is a leap year
/// * Negative years (years preceding 1 BC) are not supported
/// * Minimum date/time that can be represented is 12:00:00 UTC Monday, 1 January 4713 BC
/// (Julian Day 0, Gregorian -4713-11-24 12:00:00)
///
/// For more information, please see:
/// * http://en.wikipedia.org/wiki/Gregorian_Calendar
Expand Down Expand Up @@ -254,6 +255,12 @@ class Foundation_API DateTime
/// Returns true if all arguments are valid, false otherwise.

protected:
void checkValid();
/// Checks if the given date and time is valid (all arguments are within a proper range).
/// Expects all members to be set.
///
/// Throws Poco::InvalidArgumentException if any of the arguments is not valid.

static double toJulianDay(Timestamp::UtcTimeVal utcTime);
/// Computes the Julian day for an UTC time.

Expand Down
36 changes: 22 additions & 14 deletions Foundation/include/Poco/DeflatingStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,8 @@
#include "Poco/BufferedStreamBuf.h"
#include <istream>
#include <ostream>
#if defined(POCO_UNBUNDLED)
#include <zlib.h>
#else
#include "Poco/zlib.h"
#endif

struct z_stream_s;


namespace Poco {
Expand All @@ -47,6 +44,17 @@ class Foundation_API DeflatingStreamBuf: public BufferedStreamBuf
STREAM_GZIP /// Create a gzip header, use CRC-32 checksum.
};

enum CompressionLevel
/// Constants for compression levels.
/// Note to maintainers: These must be kept in sync with the constants
/// defined by zlib.
{
DEFAULT_COMPRESSION = -1,
NO_COMPRESSION = 0,
BEST_SPEED = 1,
BEST_COMPRESSION = 9
};

DeflatingStreamBuf(std::istream& istr, StreamType type, int level);
/// Creates a DeflatingStreamBuf for compressing data read
/// from the given input stream.
Expand Down Expand Up @@ -89,11 +97,11 @@ class Foundation_API DeflatingStreamBuf: public BufferedStreamBuf
DEFLATE_BUFFER_SIZE = 32768
};

std::istream* _pIstr;
std::ostream* _pOstr;
char* _buffer;
z_stream _zstr;
bool _eof;
std::istream* _pIstr;
std::ostream* _pOstr;
char* _buffer;
z_stream_s* _pZstr;
bool _eof;
};


Expand All @@ -104,7 +112,7 @@ class Foundation_API DeflatingIOS: public virtual std::ios
/// order of the stream buffer and base classes.
{
public:
DeflatingIOS(std::ostream& ostr, DeflatingStreamBuf::StreamType type = DeflatingStreamBuf::STREAM_ZLIB, int level = Z_DEFAULT_COMPRESSION);
DeflatingIOS(std::ostream& ostr, DeflatingStreamBuf::StreamType type = DeflatingStreamBuf::STREAM_ZLIB, int level = DeflatingStreamBuf::DEFAULT_COMPRESSION);
/// Creates a DeflatingIOS for compressing data passed
/// through and forwarding it to the given output stream.

Expand All @@ -115,7 +123,7 @@ class Foundation_API DeflatingIOS: public virtual std::ios
/// Please refer to the zlib documentation of deflateInit2() for a description
/// of the windowBits parameter.

DeflatingIOS(std::istream& istr, DeflatingStreamBuf::StreamType type = DeflatingStreamBuf::STREAM_ZLIB, int level = Z_DEFAULT_COMPRESSION);
DeflatingIOS(std::istream& istr, DeflatingStreamBuf::StreamType type = DeflatingStreamBuf::STREAM_ZLIB, int level = DeflatingStreamBuf::DEFAULT_COMPRESSION);
/// Creates a DeflatingIOS for compressing data read
/// from the given input stream.

Expand Down Expand Up @@ -150,7 +158,7 @@ class Foundation_API DeflatingOutputStream: public std::ostream, public Deflatin
/// ostr.close();
{
public:
DeflatingOutputStream(std::ostream& ostr, DeflatingStreamBuf::StreamType type = DeflatingStreamBuf::STREAM_ZLIB, int level = Z_DEFAULT_COMPRESSION);
DeflatingOutputStream(std::ostream& ostr, DeflatingStreamBuf::StreamType type = DeflatingStreamBuf::STREAM_ZLIB, int level = DeflatingStreamBuf::DEFAULT_COMPRESSION);
/// Creates a DeflatingOutputStream for compressing data passed
/// through and forwarding it to the given output stream.

Expand Down Expand Up @@ -179,7 +187,7 @@ class Foundation_API DeflatingInputStream: public std::istream, public Deflating
/// using zlib's deflate algorithm.
{
public:
DeflatingInputStream(std::istream& istr, DeflatingStreamBuf::StreamType type = DeflatingStreamBuf::STREAM_ZLIB, int level = Z_DEFAULT_COMPRESSION);
DeflatingInputStream(std::istream& istr, DeflatingStreamBuf::StreamType type = DeflatingStreamBuf::STREAM_ZLIB, int level = DeflatingStreamBuf::DEFAULT_COMPRESSION);
/// Creates a DeflatingIOS for compressing data read
/// from the given input stream.

Expand Down
36 changes: 36 additions & 0 deletions Foundation/include/Poco/Dynamic/VarIterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,18 @@ class Foundation_API VarIterator
bool operator != (const VarIterator& other) const;
/// Inequality operator.

bool operator < (const VarIterator& other) const;
/// Less than operator.

bool operator > (const VarIterator& other) const;
/// Greater than operator.

bool operator <= (const VarIterator& other) const;
/// Less than or equal to operator.

bool operator >= (const VarIterator& other) const;
/// Greater than or equal to operator.

Var& operator * () const;
/// Returns value at the current position.

Expand Down Expand Up @@ -138,6 +150,30 @@ inline bool VarIterator::operator != (const VarIterator& other) const
}


inline bool VarIterator::operator < (const VarIterator& other) const
{
return _position < other._position;
}


inline bool VarIterator::operator > (const VarIterator& other) const
{
return _position > other._position;
}


inline bool VarIterator::operator <= (const VarIterator& other) const
{
return _position <= other._position;
}


inline bool VarIterator::operator >= (const VarIterator& other) const
{
return _position >= other._position;
}


} } // namespace Poco::Dynamic


Expand Down
8 changes: 7 additions & 1 deletion Foundation/include/Poco/Exception.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,15 @@ class Foundation_API Exception: public std::exception
private:
std::string _msg;
Exception* _pNested;
int _code;
int _code;
};

#if defined(_HAS_EXCEPTIONS)
// Size of Poco::Exception depends on the exception settings (like _HAS_EXCEPTIONS)
// that might influence size of std::exception from which Poco::Exception is derived from.
// It is expected that Poco libraries and application using Poco have the same settings.
static_assert(_HAS_EXCEPTIONS != 0);
#endif

//
// inlines
Expand Down
19 changes: 8 additions & 11 deletions Foundation/include/Poco/InflatingStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,8 @@
#include "Poco/BufferedStreamBuf.h"
#include <istream>
#include <ostream>
#if defined(POCO_UNBUNDLED)
#include <zlib.h>
#else
#include "Poco/zlib.h"
#endif

struct z_stream_s;


namespace Poco {
Expand Down Expand Up @@ -92,12 +89,12 @@ class Foundation_API InflatingStreamBuf: public BufferedStreamBuf
INFLATE_BUFFER_SIZE = 32768
};

std::istream* _pIstr;
std::ostream* _pOstr;
char* _buffer;
z_stream _zstr;
bool _eof;
bool _check;
std::istream* _pIstr;
std::ostream* _pOstr;
char* _buffer;
z_stream_s* _pZstr;
bool _eof;
bool _check;
};


Expand Down
1 change: 0 additions & 1 deletion Foundation/include/Poco/UUIDGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ class Foundation_API UUIDGenerator

protected:
Timestamp::UtcTimeVal timeStamp();
void getNode();

private:
FastMutex _mutex;
Expand Down
2 changes: 1 addition & 1 deletion Foundation/src/Checksum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#if defined(POCO_UNBUNDLED)
#include <zlib.h>
#else
#include "Poco/zlib.h"
#include "zlib.h"
#endif


Expand Down
Loading

0 comments on commit b0ea609

Please sign in to comment.