Skip to content

Commit

Permalink
Merge pull request #6 from pocoproject/develop
Browse files Browse the repository at this point in the history
Sync 28.1.2015
  • Loading branch information
mkrivos committed Jan 28, 2015
2 parents 27e7e5f + 19588c0 commit 238b12b
Show file tree
Hide file tree
Showing 43 changed files with 735 additions and 643 deletions.
20 changes: 3 additions & 17 deletions CppParser/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,10 @@ target_include_directories( "${LIBNAME}"
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src
)

install(
DIRECTORY include/Poco
DESTINATION include
COMPONENT Devel
PATTERN ".svn" EXCLUDE
)

install(
TARGETS "${LIBNAME}" EXPORT "${LIBNAME}Targets"
LIBRARY DESTINATION lib${LIB_SUFFIX}
ARCHIVE DESTINATION lib${LIB_SUFFIX}
RUNTIME DESTINATION bin
INCLUDES DESTINATION include
)

POCO_GENERATE_PACKAGE("${LIBNAME}" "${LIBNAME}Targets" "lib/cmake/${PROJECT_NAME}")
POCO_INSTALL("${LIBNAME}")
POCO_GENERATE_PACKAGE("${LIBNAME}")

if (ENABLE_TESTS)
add_subdirectory(testsuite)
add_subdirectory(testsuite)
endif ()

21 changes: 4 additions & 17 deletions Crypto/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,11 @@ target_include_directories( "${LIBNAME}"
$<INSTALL_INTERFACE:include>
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src
)
install(
DIRECTORY include/Poco
DESTINATION include
COMPONENT Devel
PATTERN ".svn" EXCLUDE
)

install(
TARGETS "${LIBNAME}" EXPORT "${LIBNAME}Targets"
LIBRARY DESTINATION lib${LIB_SUFFIX}
ARCHIVE DESTINATION lib${LIB_SUFFIX}
RUNTIME DESTINATION bin
INCLUDES DESTINATION include
)

POCO_GENERATE_PACKAGE("${LIBNAME}" "${LIBNAME}Targets" "lib/cmake/${PROJECT_NAME}")
POCO_INSTALL("${LIBNAME}")
POCO_GENERATE_PACKAGE("${LIBNAME}")

if (ENABLE_TESTS)
add_subdirectory(samples)
add_subdirectory(testsuite)
add_subdirectory(samples)
add_subdirectory(testsuite)
endif ()
63 changes: 25 additions & 38 deletions Data/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,54 +34,41 @@ target_include_directories( "${LIBNAME}"
$<INSTALL_INTERFACE:include>
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src
)
install(
DIRECTORY include/Poco
DESTINATION include
COMPONENT Devel
PATTERN ".svn" EXCLUDE
)

install(
TARGETS "${LIBNAME}" EXPORT "${LIBNAME}Targets"
LIBRARY DESTINATION lib${LIB_SUFFIX}
ARCHIVE DESTINATION lib${LIB_SUFFIX}
RUNTIME DESTINATION bin
INCLUDES DESTINATION include
)

POCO_GENERATE_PACKAGE("${LIBNAME}" "${LIBNAME}Targets" "lib/cmake/${PROJECT_NAME}")
POCO_INSTALL("${LIBNAME}")
POCO_GENERATE_PACKAGE("${LIBNAME}")

if(ENABLE_DATA_SQLITE)
# SQlite3 is built in any case
add_subdirectory( SQLite )
# SQlite3 is built in any case
add_subdirectory( SQLite )
endif(ENABLE_DATA_SQLITE)

if(ENABLE_DATA_MYSQL)
find_package(MySQL)
if(MYSQL_FOUND)
include_directories("${MYSQL_INCLUDE_DIR}")
message(STATUS "MySQL Support Enabled")
add_subdirectory( MySQL )
else()
message(STATUS "MySQL Support Disabled - no MySQL library")
endif(MYSQL_FOUND)
find_package(MySQL)
if(MYSQL_FOUND)
include_directories("${MYSQL_INCLUDE_DIR}")
message(STATUS "MySQL Support Enabled")
add_subdirectory( MySQL )
else()
message(STATUS "MySQL Support Disabled - no MySQL library")
endif(MYSQL_FOUND)
endif(ENABLE_DATA_MYSQL)

if(ENABLE_DATA_ODBC)
find_package(ODBC)
if(WIN32 AND NOT WINCE)
set(ODBC_LIBRARIES "odbc32" "odbccp32")
message(STATUS "Windows native ODBC Support Enabled")
add_subdirectory( ODBC )
else(WIN32 AND NOT WINCE)
if(ODBC_FOUND)
include_directories("${ODBC_INCLUDE_DIRECTORIES}")
message(STATUS "ODBC Support Enabled")
find_package(ODBC)
if(WIN32 AND NOT WINCE)
set(ODBC_LIBRARIES "odbc32" "odbccp32")
message(STATUS "Windows native ODBC Support Enabled")
add_subdirectory( ODBC )
else()
message(STATUS "ODBC Support Disabled - no ODBC runtime")
endif()
endif(WIN32 AND NOT WINCE)
else(WIN32 AND NOT WINCE)
if(ODBC_FOUND)
include_directories("${ODBC_INCLUDE_DIRECTORIES}")
message(STATUS "ODBC Support Enabled")
add_subdirectory( ODBC )
else()
message(STATUS "ODBC Support Disabled - no ODBC runtime")
endif()
endif(WIN32 AND NOT WINCE)
endif(ENABLE_DATA_ODBC)

if (ENABLE_TESTS)
Expand Down
17 changes: 2 additions & 15 deletions Data/MySQL/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,9 @@ target_include_directories( "${LIBNAME}"
$<INSTALL_INTERFACE:include>
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src
)
install(
DIRECTORY include/Poco
DESTINATION include
COMPONENT Devel
PATTERN ".svn" EXCLUDE
)

install(
TARGETS "${LIBNAME}" EXPORT "${LIBNAME}Targets"
LIBRARY DESTINATION lib${LIB_SUFFIX}
ARCHIVE DESTINATION lib${LIB_SUFFIX}
RUNTIME DESTINATION bin
INCLUDES DESTINATION include
)

POCO_GENERATE_PACKAGE("${LIBNAME}" "${LIBNAME}Targets" "lib/cmake/${PROJECT_NAME}")
POCO_INSTALL("${LIBNAME}")
POCO_GENERATE_PACKAGE("${LIBNAME}")

if (ENABLE_TESTS)
add_subdirectory(testsuite)
Expand Down
17 changes: 2 additions & 15 deletions Data/ODBC/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,9 @@ target_include_directories( "${LIBNAME}"
$<INSTALL_INTERFACE:include>
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src
)
install(
DIRECTORY include/Poco
DESTINATION include
COMPONENT Devel
PATTERN ".svn" EXCLUDE
)

install(
TARGETS "${LIBNAME}" EXPORT "${LIBNAME}Targets"
LIBRARY DESTINATION lib${LIB_SUFFIX}
ARCHIVE DESTINATION lib${LIB_SUFFIX}
RUNTIME DESTINATION bin
INCLUDES DESTINATION include
)

POCO_GENERATE_PACKAGE("${LIBNAME}" "${LIBNAME}Targets" "lib/cmake/${PROJECT_NAME}")
POCO_INSTALL("${LIBNAME}")
POCO_GENERATE_PACKAGE("${LIBNAME}")

if (ENABLE_TESTS)
add_subdirectory(testsuite)
Expand Down
17 changes: 2 additions & 15 deletions Data/SQLite/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,9 @@ target_include_directories( "${LIBNAME}"
$<INSTALL_INTERFACE:include>
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src
)
install(
DIRECTORY include/Poco
DESTINATION include
COMPONENT Devel
PATTERN ".svn" EXCLUDE
)

install(
TARGETS "${LIBNAME}" EXPORT "${LIBNAME}Targets"
LIBRARY DESTINATION lib${LIB_SUFFIX}
ARCHIVE DESTINATION lib${LIB_SUFFIX}
RUNTIME DESTINATION bin
INCLUDES DESTINATION include
)

POCO_GENERATE_PACKAGE("${LIBNAME}" "${LIBNAME}Targets" "lib/cmake/${PROJECT_NAME}")
POCO_INSTALL("${LIBNAME}")
POCO_GENERATE_PACKAGE("${LIBNAME}")

if (ENABLE_TESTS)
add_subdirectory(testsuite)
Expand Down
18 changes: 2 additions & 16 deletions Foundation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -121,22 +121,8 @@ target_include_directories( "${LIBNAME}"
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src
)

install(
DIRECTORY include/Poco
DESTINATION include
COMPONENT Devel
PATTERN ".svn" EXCLUDE
)

install(
TARGETS "${LIBNAME}" EXPORT "${LIBNAME}Targets"
LIBRARY DESTINATION lib${LIB_SUFFIX}
ARCHIVE DESTINATION lib${LIB_SUFFIX}
RUNTIME DESTINATION bin
INCLUDES DESTINATION include
)

POCO_GENERATE_PACKAGE("${LIBNAME}" "${LIBNAME}Targets" "lib/cmake/${PROJECT_NAME}")
POCO_INSTALL("${LIBNAME}")
POCO_GENERATE_PACKAGE("${LIBNAME}")

if (ENABLE_TESTS)
add_subdirectory( samples )
Expand Down
4 changes: 2 additions & 2 deletions Foundation/include/Poco/Bugcheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,9 @@ class Foundation_API Bugcheck
//


#if defined(GNUC) && (GNUC > 4) && (GNUC_MINOR > 6)
#if defined(POCO_COMPILER_GCC) && (((__GNUC__ * 100) + __GNUC_MINOR__) >= 406)
GCC_DIAG_OFF(unused-local-typedefs) // supress numerous gcc warnings
#endif // (GNUC) && (GNUC > 4) && (GNUC_MINOR > 6)
#endif // POCO_COMPILER_GCC && (((__GNUC__ * 100) + __GNUC_MINOR__) >= 406)


template <bool x>
Expand Down
60 changes: 60 additions & 0 deletions Foundation/include/Poco/MemoryStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,66 @@ class BasicMemoryStreamBuf: public std::basic_streambuf<ch, tr>
return char_traits::eof();
}

virtual pos_type seekoff(off_type off, std::ios_base::seekdir way, std::ios_base::openmode which = std::ios_base::in | std::ios_base::out)
{
const pos_type fail = off_type(-1);
off_type newoff = off_type(-1);

if ((which & std::ios_base::in) != 0)
{
if (this->gptr() == 0)
return fail;

switch (way)
{
case std::ios_base::beg:
newoff = 0;
break;
case std::ios_base::cur:
// cur is not valid if both in and out are specified (Condition 3)
if ((which & std::ios_base::out) != 0)
return fail;
newoff = this->gptr() - this->eback();
break;
case std::ios_base::end:
newoff = this->egptr() - this->eback();
break;
}

if ((newoff + off) < 0 || (this->egptr() - this->eback()) < (newoff + off))
return fail;
this->setg(this->eback(), this->eback() + newoff + off, this->egptr());
}

if ((which & std::ios_base::out) != 0)
{
if (this->pptr() == 0)
return fail;

switch (way)
{
case std::ios_base::beg:
newoff = 0;
break;
case std::ios_base::cur:
// cur is not valid if both in and out are specified (Condition 3)
if ((which & std::ios_base::in) != 0)
return fail;
newoff = this->pptr() - this->pbase();
break;
case std::ios_base::end:
newoff = this->epptr() - this->pbase();
break;
}

if (newoff + off < 0 || (this->epptr() - this->pbase()) < newoff + off)
return fail;
this->pbump((int)(newoff + off - (this->pptr() - this->pbase())));
}

return newoff;
}

virtual int sync()
{
return 0;
Expand Down
24 changes: 13 additions & 11 deletions Foundation/include/Poco/RecursiveDirectoryIterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,41 +66,43 @@ class RecursiveDirectoryIterator

enum
{
D_INFINITE = 0
D_INFINITE = 0 /// Constant for infinite traverse depth.
};
/// Constant for infinite traverse depth.

RecursiveDirectoryIterator()
/// Creates the end iterator.
: _pImpl(0)
{
}

RecursiveDirectoryIterator(const std::string& path, UInt16 maxDepth = D_INFINITE);
RecursiveDirectoryIterator(const std::string& path, UInt16 maxDepth = D_INFINITE)
/// Creates a recursive directory iterator for the given path.
: _pImpl(new ImplType(path, maxDepth)), _path(Path(_pImpl->get())), _file(_path)
{
}

RecursiveDirectoryIterator(const MyType& iterator)
RecursiveDirectoryIterator(const MyType& iterator):
/// Creates a copy of another recursive directory iterator.
: _pImpl(iterator._pImpl), _path(iterator._path), _file(iterator._file)
_pImpl(iterator._pImpl), _path(iterator._path), _file(iterator._file)
{
}

RecursiveDirectoryIterator(const DirectoryIterator& iterator, UInt16 maxDepth = D_INFINITE)
RecursiveDirectoryIterator(const DirectoryIterator& iterator, UInt16 maxDepth = D_INFINITE):
/// Creates a recursive directory iterator for the path of
/// non-recursive directory iterator.
: _pImpl(new ImplType(iterator->path(), maxDepth)), _path(Path(_pImpl->get())), _file(_path)
_pImpl(new ImplType(iterator->path(), maxDepth)), _path(Path(_pImpl->get())), _file(_path)
{
}

RecursiveDirectoryIterator(const File& file, UInt16 maxDepth = D_INFINITE)
RecursiveDirectoryIterator(const File& file, UInt16 maxDepth = D_INFINITE):
/// Creates a recursive directory iterator for the given path.
: _pImpl(new ImplType(file.path(), maxDepth)), _path(Path(_pImpl->get())), _file(_path)
_pImpl(new ImplType(file.path(), maxDepth)), _path(Path(_pImpl->get())), _file(_path)
{
}

RecursiveDirectoryIterator(const Path& path, UInt16 maxDepth = D_INFINITE)
RecursiveDirectoryIterator(const Path& path, UInt16 maxDepth = D_INFINITE):
/// Creates a recursive directory iterator for the given path.
: _pImpl(new ImplType(path.toString(), maxDepth)), _path(Path(_pImpl->get())), _file(_path)
_pImpl(new ImplType(path.toString(), maxDepth)), _path(Path(_pImpl->get())), _file(_path)
{
}

Expand Down
1 change: 1 addition & 0 deletions Foundation/src/Clock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <mach/clock.h>
#elif defined(POCO_OS_FAMILY_UNIX)
#include <time.h>
#include <unistd.h>
#elif defined(POCO_VXWORKS)
#include <timers.h>
#elif defined(POCO_OS_FAMILY_WINDOWS)
Expand Down
Loading

0 comments on commit 238b12b

Please sign in to comment.