Function compressFiles

Summary

#include <include/bitcompressor.hpp>

(1) void compressFiles(const vector< wstring > &in_files, const wstring &out_archive) const

(2) void compressFiles(const wstring &in_dir, const wstring &out_archive, bool recursive=true, const wstring &filter=L"*.*") const

Function overload

Synopsis

#include <include/bitcompressor.hpp>

void compressFiles(const vector< wstring > &in_files, const wstring &out_archive) const

Description

Compresses a group of files.

Note
Any path to a directory or to a not-existing file will be ignored!
Parameters

in_files - the path (relative or absolute) to the input files.

out_archive - the path (relative or absolute) to the output archive file.

Mentioned in

Source

Lines 62-68 in src/bitcompressor.cpp. Line 104 in include/bitcompressor.hpp.

void BitCompressor::compressFiles( const vector< wstring >& in_files, const wstring& out_file ) const {
    if ( in_files.size() > 1 && !mFormat.hasFeature( MULTIPLE_FILES ) ) {
        throw BitException( kUnsupportedOperation, ERROR_NOT_SUPPORTED );
    }
    vector< FSItem > fs_items = FSIndexer::indexPaths( in_files, true );
    compressOut( fs_items, out_file );
}

Synopsis

#include <include/bitcompressor.hpp>

void compressFiles(const wstring &in_dir, const wstring &out_archive, bool recursive=true, const wstring &filter=L"*.*") const

Description

Compresses the files contained in a directory.

Parameters

in_dir - the path (relative or absolute) to the input directory.

out_archive - the path (relative or absolute) to the output archive file.

recursive - if true, it searches files inside the sub-folders of in_dir.

filter - the filter to use when searching files inside in_dir.

Mentioned in

Source

Lines 70-77 in src/bitcompressor.cpp. Line 114 in include/bitcompressor.hpp.

void BitCompressor::compressFiles( const wstring& in_dir, const wstring& out_file,
                                   bool recursive, const wstring& filter ) const {
    if ( !mFormat.hasFeature( MULTIPLE_FILES ) ) {
        throw BitException( kUnsupportedOperation, ERROR_NOT_SUPPORTED );
    }
    vector< FSItem > fs_items = FSIndexer::indexDirectory( in_dir, filter, recursive );
    compressOut( fs_items, out_file );
}





Add Discussion as Guest

Log in