bit7z 4.0.0
A C++ library for interfacing with the 7-zip shared libs.
Loading...
Searching...
No Matches
BitItemsVector Class Referencefinal

The BitItemsVector class represents a vector of generic input items, i.e., items that can come from the filesystem, from memory buffers, or from standard streams. More...

#include <bit7z/bititemsvector.hpp>

Public Member Functions

auto begin () const noexcept -> GenericInputItemVector::const_iterator
 
auto cbegin () const noexcept -> GenericInputItemVector::const_iterator
 
auto cend () const noexcept -> GenericInputItemVector::const_iterator
 
auto end () const noexcept -> GenericInputItemVector::const_iterator
 
void indexBuffer (const std::vector< byte_t > &inBuffer, const tstring &name)
 Indexes the given buffer, using the given name as a path when compressed in archives.
 
void indexDirectory (const fs::path &inDir, const tstring &filter={}, FilterPolicy policy=FilterPolicy::Include, IndexingOptions options={})
 Indexes the given directory, adding to the vector all the files that match the wildcard filter.
 
void indexFile (const tstring &inFile, const tstring &name={}, bool followSymlinks=true)
 Indexes the given file path, with an optional user-defined path to be used in output archives.
 
void indexPaths (const std::vector< tstring > &inPaths, IndexingOptions options={})
 Indexes the given vector of filesystem paths, adding to the item vector all the files.
 
void indexPathsMap (const std::map< tstring, tstring > &inPaths, IndexingOptions options={})
 Indexes the given map of filesystem paths, adding to the vector all the files.
 
void indexStream (std::istream &inStream, const tstring &name)
 Indexes the given standard input stream, using the given name as a path when compressed in archives.
 
auto operator[] (GenericInputItemVector::size_type index) const -> const GenericInputItem &
 
auto size () const -> std::size_t
 

Detailed Description

The BitItemsVector class represents a vector of generic input items, i.e., items that can come from the filesystem, from memory buffers, or from standard streams.

Member Function Documentation

◆ begin()

auto begin ( ) const -> GenericInputItemVector::const_iterator
noexcept
Returns
an iterator to the first element of the vector; if the vector is empty, the returned iterator will be equal to the end() iterator.

◆ cbegin()

auto cbegin ( ) const -> GenericInputItemVector::const_iterator
noexcept
Returns
an iterator to the first element of the vector; if the vector is empty, the returned iterator will be equal to the end() iterator.

◆ cend()

auto cend ( ) const -> GenericInputItemVector::const_iterator
noexcept
Returns
an iterator to the element following the last element of the vector; this element acts as a placeholder: attempting to access it results in undefined behavior.

◆ end()

auto end ( ) const -> GenericInputItemVector::const_iterator
noexcept
Returns
an iterator to the element following the last element of the vector; this element acts as a placeholder: attempting to access it results in undefined behavior.

◆ indexBuffer()

void indexBuffer ( const std::vector< byte_t > &  inBuffer,
const tstring name 
)

Indexes the given buffer, using the given name as a path when compressed in archives.

Parameters
inBufferthe buffer containing the file to be indexed in the vector.
nameuser-defined path to be used inside archives.

◆ indexDirectory()

void indexDirectory ( const fs::path &  inDir,
const tstring filter = {},
FilterPolicy  policy = FilterPolicy::Include,
IndexingOptions  options = {} 
)

Indexes the given directory, adding to the vector all the files that match the wildcard filter.

Parameters
inDirthe directory to be indexed.
filter(optional) the wildcard filter to be used for indexing; empty string means "index all files".
policy(optional) the filtering policy to be applied to the matched items.
options(optional) the settings to be used while indexing the given directory and all of its subdirectories.

◆ indexFile()

void indexFile ( const tstring inFile,
const tstring name = {},
bool  followSymlinks = true 
)

Indexes the given file path, with an optional user-defined path to be used in output archives.

Note
If a directory path is given, a BitException is thrown.
Parameters
inFilethe path to the filesystem file to be indexed in the vector.
name(optional) user-defined path to be used inside archives.
followSymlinks(optional) whether to follow symbolic links or not.

◆ indexPaths()

void indexPaths ( const std::vector< tstring > &  inPaths,
IndexingOptions  options = {} 
)

Indexes the given vector of filesystem paths, adding to the item vector all the files.

Parameters
inPathsthe vector of filesystem paths.
options(optional) the settings to be used while indexing the given directory and all of its subdirectories.

◆ indexPathsMap()

void indexPathsMap ( const std::map< tstring, tstring > &  inPaths,
IndexingOptions  options = {} 
)

Indexes the given map of filesystem paths, adding to the vector all the files.

Note
Map keys represent the filesystem paths to be indexed; the corresponding mapped values are the user-defined (possibly different) paths wanted inside archives.
Parameters
inPathsmap of filesystem paths with the corresponding user-defined path desired inside the output archive.
options(optional) the settings to be used while indexing the given directory and all of its subdirectories.

◆ indexStream()

void indexStream ( std::istream inStream,
const tstring name 
)

Indexes the given standard input stream, using the given name as a path when compressed in archives.

Parameters
inStreamthe standard input stream of the file to be indexed in the vector.
nameuser-defined path to be used inside archives.

◆ operator[]()

auto operator[] ( GenericInputItemVector::size_type  index) const -> const GenericInputItem &
Parameters
indexthe index of the desired item in the vector.
Returns
a constant reference to the GenericInputItem at the given index.

◆ size()

auto size ( ) const -> std::size_t
Returns
the size of the items vector.

The documentation for this class was generated from the following file: