Function BitInputArchive

Summary

#include <include/bitinputarchive.hpp>

(1) BitInputArchive(const BitArchiveHandler &handler, const wstring &in_file)

(2) BitInputArchive(const BitArchiveHandler &handler, const vector< byte_t > &in_buffer)

(3) BitInputArchive(const BitArchiveHandler &handler, std::istream &in_stream)

Function overload

Synopsis

#include <include/bitinputarchive.hpp>

BitInputArchive(const BitArchiveHandler &handler, const wstring &in_file)

Description

No description yet.

Source

Lines 98-112 in src/bitinputarchive.cpp. Line 26 in include/bitinputarchive.hpp.

BitInputArchive::BitInputArchive( const BitArchiveHandler& handler, const wstring& in_file ) {
    auto* file_stream_spec = new CInFileStream;
    CMyComPtr< IInStream > file_stream = file_stream_spec;
    if ( !file_stream_spec->Open( in_file.c_str() ) ) {
        throw BitException( L"Cannot open archive file '" + in_file + L"'", ERROR_OPEN_FAILED );
    }
#ifdef BIT7Z_AUTO_FORMAT
    //if auto, detect format from signature here (and try later from content if this fails), otherwise try passed format
    mDetectedFormat = ( handler.format() == BitFormat::Auto ?
                        &BitFormat::detectFormatFromExt( in_file ) : &handler.format() );
#else
    mDetectedFormat = &handler.format();
#endif
    mInArchive = openArchiveStream( handler, in_file, file_stream );
}

Synopsis

#include <include/bitinputarchive.hpp>

BitInputArchive(const BitArchiveHandler &handler, const vector< byte_t > &in_buffer)

Description

No description yet.

Source

Lines 114-120 in src/bitinputarchive.cpp. Line 28 in include/bitinputarchive.hpp.

BitInputArchive::BitInputArchive( const BitArchiveHandler& handler, const vector< byte_t >& in_buffer ) {
    auto* buf_stream_spec = new CBufInStream;
    CMyComPtr< IInStream > buf_stream = buf_stream_spec;
    buf_stream_spec->Init( in_buffer.data(), in_buffer.size() );
    mDetectedFormat = &handler.format(); //if auto, detect format from content, otherwise try passed format
    mInArchive = openArchiveStream( handler, L".", buf_stream );
}

Synopsis

#include <include/bitinputarchive.hpp>

BitInputArchive(const BitArchiveHandler &handler, std::istream &in_stream)

Description

No description yet.

Source

Lines 122-126 in src/bitinputarchive.cpp. Line 30 in include/bitinputarchive.hpp.

BitInputArchive::BitInputArchive( const BitArchiveHandler& handler, std::istream& in_stream ) {
    CMyComPtr< IInStream > std_stream = new CStdInStream( in_stream );
    mDetectedFormat = &handler.format(); //if auto, detect format from content, otherwise try passed format
    mInArchive = openArchiveStream( handler, L".", std_stream );
}





Add Discussion as Guest

Log in