libzypp 17.36.1
zypp::Fetcher::Impl Class Reference

Fetcher implementation. More...

Public Member Functions

 Impl ()
 
 Impl (const Impl &)=default
 
 Impl (Impl &&)=delete
 
Imploperator= (const Impl &)=delete
 
Imploperator= (Impl &&)=delete
 
 ~Impl ()
 
void setOptions (Fetcher::Options options)
 
Fetcher::Options options () const
 
void addIndex (const OnMediaLocation &resource)
 
void enqueueDir (const OnMediaLocation &resource, bool recursive, const FileChecker &checker=FileChecker())
 
void enqueueDigestedDir (const OnMediaLocation &resource, bool recursive, const FileChecker &checker=FileChecker())
 
void enqueue (const OnMediaLocation &resource, const FileChecker &checker=FileChecker())
 
void enqueueDigested (const OnMediaLocation &resource, const FileChecker &checker=FileChecker())
 
void addCachePath (const Pathname &cache_dir)
 
void reset ()
 
void setMediaSetAccess (MediaSetAccess &media)
 
void start (const Pathname &dest_dir, const ProgressData::ReceiverFnc &progress)
 
void start (const Pathname &dest_dir, MediaSetAccess &media, const ProgressData::ReceiverFnc &progress_receiver)
 

Static Public Member Functions

static shared_ptr< Implnullimpl ()
 Offer default Impl.
 

Private Member Functions

void downloadAndReadIndexList (MediaSetAccess &media, const Pathname &dest_dir)
 download the indexes and reads them
 
void downloadIndex (MediaSetAccess &media, const OnMediaLocation &resource, const Pathname &dest_dir)
 download the indexes and reads them
 
void readIndex (const Pathname &index, const Pathname &basedir)
 reads a downloaded index file and updates internal attributes table
 
void readChecksumsIndex (const Pathname &index, const Pathname &basedir)
 specific version of readIndex for CHECKSUMS file
 
void readContentFileIndex (const Pathname &index, const Pathname &basedir)
 specific version of readIndex for content file
 
void getDirectoryContent (MediaSetAccess &media, const OnMediaLocation &resource, filesystem::DirContent &content)
 reads the content of a directory but keeps a cache
 
Pathname locateInCache (const OnMediaLocation &resource_r, const Pathname &destDir_r)
 Tries to locate the file represented by job by looking at the cache (matching checksum is mandatory).
 
void validate (const Pathname &localfile_r, const std::list< FileChecker > &checkers_r)
 Validates the provided file against its checkers.
 
void addDirJobs (MediaSetAccess &media, const OnMediaLocation &resource, const Pathname &dest_dir, FetcherJob::Flags flags)
 scan the directory and adds the individual jobs
 
void autoaddIndexes (const filesystem::DirContent &content, MediaSetAccess &media, const OnMediaLocation &resource, const Pathname &dest_dir)
 auto discovery and reading of indexes
 
void provideToDest (MediaSetAccess &media_r, const Pathname &destDir_r, const FetcherJob_Ptr &jobp_r)
 Provide the resource to dest_dir.
 
Implclone () const
 clone for RWCOW_pointer
 

Private Attributes

std::list< FetcherJob_Ptr_resources
 
std::set< FetcherIndex_Ptr, SameFetcherIndex_indexes
 
std::set< Pathname_caches
 
std::map< std::string, CheckSum_checksums
 
std::map< std::string, filesystem::DirContent_dircontent
 
MediaSetAccess_mediaSetAccess = nullptr
 
Fetcher::Options _options
 

Friends

std::ostream & operator<< (std::ostream &str, const Fetcher::Impl &obj)
 
ImplrwcowClone (const Impl *rhs)
 

Related Symbols

(Note that these are not member symbols.)

std::ostream & operator<< (std::ostream &str, const Fetcher::Impl &obj)
 Stream output.
 

Detailed Description

Fetcher implementation.

Definition at line 126 of file Fetcher.cc.

Constructor & Destructor Documentation

◆ Impl() [1/3]

zypp::Fetcher::Impl::Impl ( )

Definition at line 255 of file Fetcher.cc.

◆ Impl() [2/3]

zypp::Fetcher::Impl::Impl ( const Impl & )
default

◆ Impl() [3/3]

zypp::Fetcher::Impl::Impl ( Impl && )
delete

◆ ~Impl()

zypp::Fetcher::Impl::~Impl ( )
inline

Definition at line 138 of file Fetcher.cc.

Member Function Documentation

◆ operator=() [1/2]

Impl & zypp::Fetcher::Impl::operator= ( const Impl & )
delete

◆ operator=() [2/2]

Impl & zypp::Fetcher::Impl::operator= ( Impl && )
delete

◆ setOptions()

void zypp::Fetcher::Impl::setOptions ( Fetcher::Options options)

Definition at line 260 of file Fetcher.cc.

◆ options()

Fetcher::Options zypp::Fetcher::Impl::options ( ) const

Definition at line 263 of file Fetcher.cc.

◆ addIndex()

void zypp::Fetcher::Impl::addIndex ( const OnMediaLocation & resource)

Definition at line 310 of file Fetcher.cc.

◆ enqueueDir()

void zypp::Fetcher::Impl::enqueueDir ( const OnMediaLocation & resource,
bool recursive,
const FileChecker & checker = FileChecker() )

Definition at line 266 of file Fetcher.cc.

◆ enqueueDigestedDir()

void zypp::Fetcher::Impl::enqueueDigestedDir ( const OnMediaLocation & resource,
bool recursive,
const FileChecker & checker = FileChecker() )

Definition at line 281 of file Fetcher.cc.

◆ enqueue()

void zypp::Fetcher::Impl::enqueue ( const OnMediaLocation & resource,
const FileChecker & checker = FileChecker() )

Definition at line 298 of file Fetcher.cc.

◆ enqueueDigested()

void zypp::Fetcher::Impl::enqueueDigested ( const OnMediaLocation & resource,
const FileChecker & checker = FileChecker() )

Definition at line 244 of file Fetcher.cc.

◆ addCachePath()

void zypp::Fetcher::Impl::addCachePath ( const Pathname & cache_dir)

Definition at line 330 of file Fetcher.cc.

◆ reset()

void zypp::Fetcher::Impl::reset ( )

Definition at line 317 of file Fetcher.cc.

◆ setMediaSetAccess()

void zypp::Fetcher::Impl::setMediaSetAccess ( MediaSetAccess & media)

Definition at line 325 of file Fetcher.cc.

◆ start() [1/2]

void zypp::Fetcher::Impl::start ( const Pathname & dest_dir,
const ProgressData::ReceiverFnc & progress )

Definition at line 735 of file Fetcher.cc.

◆ start() [2/2]

void zypp::Fetcher::Impl::start ( const Pathname & dest_dir,
MediaSetAccess & media,
const ProgressData::ReceiverFnc & progress_receiver )

Definition at line 745 of file Fetcher.cc.

◆ nullimpl()

static shared_ptr< Impl > zypp::Fetcher::Impl::nullimpl ( )
inlinestatic

Offer default Impl.

Definition at line 160 of file Fetcher.cc.

◆ downloadAndReadIndexList()

void zypp::Fetcher::Impl::downloadAndReadIndexList ( MediaSetAccess & media,
const Pathname & dest_dir )
private

download the indexes and reads them

Definition at line 705 of file Fetcher.cc.

◆ downloadIndex()

void zypp::Fetcher::Impl::downloadIndex ( MediaSetAccess & media,
const OnMediaLocation & resource,
const Pathname & dest_dir )
private

download the indexes and reads them

Definition at line 650 of file Fetcher.cc.

◆ readIndex()

void zypp::Fetcher::Impl::readIndex ( const Pathname & index,
const Pathname & basedir )
private

reads a downloaded index file and updates internal attributes table

The index lists files relative to a directory, which is normally the same as the index file is located.

Definition at line 597 of file Fetcher.cc.

◆ readChecksumsIndex()

void zypp::Fetcher::Impl::readChecksumsIndex ( const Pathname & index,
const Pathname & basedir )
private

specific version of readIndex for CHECKSUMS file

Definition at line 621 of file Fetcher.cc.

◆ readContentFileIndex()

void zypp::Fetcher::Impl::readContentFileIndex ( const Pathname & index,
const Pathname & basedir )
private

specific version of readIndex for content file

Definition at line 608 of file Fetcher.cc.

◆ getDirectoryContent()

void zypp::Fetcher::Impl::getDirectoryContent ( MediaSetAccess & media,
const OnMediaLocation & resource,
filesystem::DirContent & content )
private

reads the content of a directory but keeps a cache

Definition at line 440 of file Fetcher.cc.

◆ locateInCache()

Pathname zypp::Fetcher::Impl::locateInCache ( const OnMediaLocation & resource_r,
const Pathname & destDir_r )
private

Tries to locate the file represented by job by looking at the cache (matching checksum is mandatory).

Returns the location of the cached file or an empty Pathname.

Definition at line 353 of file Fetcher.cc.

◆ validate()

void zypp::Fetcher::Impl::validate ( const Pathname & localfile_r,
const std::list< FileChecker > & checkers_r )
private

Validates the provided file against its checkers.

Exceptions
Exception

Definition at line 383 of file Fetcher.cc.

◆ addDirJobs()

void zypp::Fetcher::Impl::addDirJobs ( MediaSetAccess & media,
const OnMediaLocation & resource,
const Pathname & dest_dir,
FetcherJob::Flags flags )
private

scan the directory and adds the individual jobs

Definition at line 463 of file Fetcher.cc.

◆ autoaddIndexes()

void zypp::Fetcher::Impl::autoaddIndexes ( const filesystem::DirContent & content,
MediaSetAccess & media,
const OnMediaLocation & resource,
const Pathname & dest_dir )
private

auto discovery and reading of indexes

Definition at line 412 of file Fetcher.cc.

◆ provideToDest()

void zypp::Fetcher::Impl::provideToDest ( MediaSetAccess & media_r,
const Pathname & destDir_r,
const FetcherJob_Ptr & jobp_r )
private

Provide the resource to dest_dir.

Definition at line 527 of file Fetcher.cc.

◆ clone()

Impl * zypp::Fetcher::Impl::clone ( ) const
inlineprivate

clone for RWCOW_pointer

Definition at line 227 of file Fetcher.cc.

Friends And Related Symbol Documentation

◆ operator<< [1/2]

std::ostream & operator<< ( std::ostream & str,
const Fetcher::Impl & obj )
friend

◆ rwcowClone

Impl * rwcowClone ( const Impl * rhs)
friend

◆ operator<<() [2/2]

std::ostream & operator<< ( std::ostream & str,
const Fetcher::Impl & obj )
related

Stream output.

Definition at line 836 of file Fetcher.cc.

Member Data Documentation

◆ _resources

std::list<FetcherJob_Ptr> zypp::Fetcher::Impl::_resources
private

Definition at line 230 of file Fetcher.cc.

◆ _indexes

std::set<FetcherIndex_Ptr,SameFetcherIndex> zypp::Fetcher::Impl::_indexes
private

Definition at line 231 of file Fetcher.cc.

◆ _caches

std::set<Pathname> zypp::Fetcher::Impl::_caches
private

Definition at line 232 of file Fetcher.cc.

◆ _checksums

std::map<std::string, CheckSum> zypp::Fetcher::Impl::_checksums
private

Definition at line 234 of file Fetcher.cc.

◆ _dircontent

std::map<std::string, filesystem::DirContent> zypp::Fetcher::Impl::_dircontent
private

Definition at line 236 of file Fetcher.cc.

◆ _mediaSetAccess

MediaSetAccess* zypp::Fetcher::Impl::_mediaSetAccess = nullptr
private

Definition at line 238 of file Fetcher.cc.

◆ _options

Fetcher::Options zypp::Fetcher::Impl::_options
private

Definition at line 240 of file Fetcher.cc.


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