mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-04-10 06:17:14 +02:00
Switched to POCO library for unified platform/library interface. Deprecated the external module API. It was creating more problems than solving. Removed most built-in libraries in favor of system libraries for easier maintenance. Cleaned and secured code with help from static analyzers.
47 lines
853 B
C++
47 lines
853 B
C++
//
|
|
// SkipCallback.cpp
|
|
//
|
|
// Library: Zip
|
|
// Package: Zip
|
|
// Module: SkipCallback
|
|
//
|
|
// Copyright (c) 2007, Applied Informatics Software Engineering GmbH.
|
|
// and Contributors.
|
|
//
|
|
// SPDX-License-Identifier: BSL-1.0
|
|
//
|
|
|
|
|
|
#include "Poco/Zip/SkipCallback.h"
|
|
#include "Poco/Zip/ZipLocalFileHeader.h"
|
|
#include "Poco/Zip/ZipUtil.h"
|
|
#include "Poco/Exception.h"
|
|
|
|
|
|
namespace Poco {
|
|
namespace Zip {
|
|
|
|
|
|
SkipCallback::SkipCallback()
|
|
{
|
|
}
|
|
|
|
|
|
SkipCallback::~SkipCallback()
|
|
{
|
|
}
|
|
|
|
|
|
bool SkipCallback::handleZipEntry(std::istream& zipStream, const ZipLocalFileHeader& hdr)
|
|
{
|
|
if (!hdr.searchCRCAndSizesAfterData())
|
|
zipStream.seekg(hdr.getCompressedSize(), std::ios_base::cur);
|
|
else
|
|
ZipUtil::syncDataDescriptor(zipStream, hdr.needsZip64());
|
|
if (!zipStream.good()) throw Poco::IOException("Failed to seek on input stream");
|
|
return true;
|
|
}
|
|
|
|
|
|
} } // namespace Poco::Zip
|