Commit 0fafb80d by Maarten L. Hekkelman

Remove bzip2 support

parent 298fe20a
......@@ -175,7 +175,6 @@ set(Boost_USE_STATIC_LIBS ON)
find_package(Boost 1.70.0 REQUIRED COMPONENTS system iostreams regex date_time program_options)
find_package(ZLIB REQUIRED)
find_package(BZip2 REQUIRED)
include_directories(${Boost_INCLUDE_DIR})
......@@ -205,7 +204,7 @@ if(RECREATE_SYMOP_DATA)
add_executable(symop-map-generator "${CMAKE_SOURCE_DIR}/tools/symop-map-generator.cpp")
target_link_libraries(symop-map-generator Threads::Threads ${Boost_LIBRARIES} std::filesystem ZLIB::ZLIB BZip2::BZip2)
target_link_libraries(symop-map-generator Threads::Threads ${Boost_LIBRARIES} std::filesystem ZLIB::ZLIB)
set($ENV{CLIBD} ${CLIBD})
......@@ -268,6 +267,8 @@ target_include_directories(cifpp
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
)
target_link_libraries(cifpp Threads::Threads ${Boost_LIBRARIES} std::filesystem ZLIB::ZLIB)
if (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
target_link_options(cifpp PRIVATE -undefined dynamic_lookup)
endif (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
......@@ -305,8 +306,6 @@ endif()
add_custom_target(COMPONENTS ALL DEPENDS ${COMPONENTS_CIF})
include_directories(${Boost_INCLUDE_DIRS})
set(INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR} )
set(LIBRARY_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR} )
set(SHARE_INSTALL_DIR ${CMAKE_INSTALL_DATADIR}/libcifpp)
......@@ -425,7 +424,7 @@ if(CIFPP_BUILD_TESTS)
${CMAKE_CURRENT_BINARY_DIR} # for config.h
)
target_link_libraries(${CIFPP_TEST} PRIVATE Threads::Threads cifpp ${Boost_LIBRARIES} std::filesystem ZLIB::ZLIB BZip2::BZip2)
target_link_libraries(${CIFPP_TEST} PRIVATE Threads::Threads cifpp ${Boost_LIBRARIES} std::filesystem ZLIB::ZLIB)
if(MSVC)
# Specify unwind semantics so that MSVC knowns how to handle exceptions
......
Version 2.0.0
- New API interface for accessing query results
- Removed bzip2 support
Version 1.1.1
- Now with full support for MS Windows
......@@ -10,4 +14,4 @@ Version 1.0.1
then /var/cache and finally compiled in resources (with mrc).
Version 1.0.0
- First public release
\ No newline at end of file
- First public release
......@@ -37,7 +37,6 @@
#include <filesystem>
#include <boost/algorithm/string.hpp>
#include <boost/iostreams/filter/bzip2.hpp>
#include <boost/iostreams/filter/gzip.hpp>
#include <boost/iostreams/filtering_stream.hpp>
#include <boost/logic/tribool.hpp>
......@@ -3464,12 +3463,7 @@ void File::load(const std::string &p)
io::filtering_stream<io::input> in;
std::string ext;
if (path.extension() == ".bz2")
{
in.push(io::bzip2_decompressor());
ext = path.stem().extension().string();
}
else if (path.extension() == ".gz")
if (path.extension() == ".gz")
{
in.push(io::gzip_decompressor());
ext = path.stem().extension().string();
......@@ -3500,11 +3494,6 @@ void File::save(const std::string &p)
out.push(io::gzip_compressor());
path = path.stem();
}
else if (path.extension() == ".bz2")
{
out.push(io::bzip2_compressor());
path = path.stem();
}
out.push(outFile);
save(out);
......
......@@ -32,7 +32,6 @@
#include <boost/algorithm/string.hpp>
#include <boost/format.hpp>
#include <boost/iostreams/filter/bzip2.hpp>
#include <boost/iostreams/filter/gzip.hpp>
#include <boost/iostreams/filtering_stream.hpp>
......@@ -67,7 +66,6 @@ struct FileImpl
void FileImpl::load_data(const char *data, size_t length)
{
bool gzipped = length > 2 and data[0] == static_cast<char>(0x1f) and data[1] == static_cast<char>(0x8b);
bool bzip2ed = length > 3 and data[0] == static_cast<char>(0x42) and data[1] == static_cast<char>(0x5A) and data[2] == static_cast<char>(0x68);
try
{
......@@ -82,8 +80,6 @@ void FileImpl::load_data(const char *data, size_t length)
io::filtering_stream<io::input> in;
if (gzipped)
in.push(io::gzip_decompressor());
else if (bzip2ed)
in.push(io::bzip2_decompressor());
in.push(is);
mData.load(in);
......@@ -101,8 +97,6 @@ void FileImpl::load_data(const char *data, size_t length)
io::filtering_stream<io::input> in;
if (gzipped)
in.push(io::gzip_decompressor());
else if (bzip2ed)
in.push(io::bzip2_decompressor());
in.push(is);
ReadPDBFile(in, mData);
......@@ -129,12 +123,7 @@ void FileImpl::load(const std::string &p)
io::filtering_stream<io::input> in;
std::string ext = path.extension().string();
if (path.extension() == ".bz2")
{
in.push(io::bzip2_decompressor());
ext = path.stem().extension().string();
}
else if (path.extension() == ".gz")
if (path.extension() == ".gz")
{
in.push(io::gzip_decompressor());
ext = path.stem().extension().string();
......@@ -171,9 +160,7 @@ void FileImpl::load(const std::string &p)
else
inFile.open(path, std::ios_base::in | std::ios::binary);
if (path.extension() == ".bz2")
in.push(io::bzip2_decompressor());
else if (path.extension() == ".gz")
if (path.extension() == ".gz")
in.push(io::gzip_decompressor());
in.push(inFile);
......@@ -210,11 +197,6 @@ void FileImpl::save(const std::string &p)
out.push(io::gzip_compressor());
path = path.stem();
}
else if (path.extension() == ".bz2")
{
out.push(io::bzip2_compressor());
path = path.stem();
}
out.push(outFile);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment