#include <SourceCache.h>
Public Member Functions | |
| SourceCache () | |
| Default ctor. | |
| ~SourceCache () | |
| Dtor. | |
| void | setCacheDir (const Pathname &dir_r) |
| void | storeSource (Source_Ref src) |
| void | restoreSources () |
| void | removeSource (unsigned id) |
| void | removeSource (const Url &url_r, const Pathname &path_r="/") |
Static Private Attributes | |
| static Pathname | _cache_dir |
| directory to store cached data | |
| static unsigned | _next_cache_id |
| counter of caches | |
Friends | |
| std::ostream & | operator<< (std::ostream &str, const SourceCache &obj) |
| Stream output. | |
Definition at line 35 of file SourceCache.h.
| zypp::SourceCache::SourceCache | ( | ) |
| zypp::SourceCache::~SourceCache | ( | ) |
| void zypp::SourceCache::setCacheDir | ( | const Pathname & | dir_r | ) |
| void zypp::SourceCache::storeSource | ( | Source_Ref | src | ) |
Definition at line 62 of file SourceCache.cc.
References _cache_dir, _next_cache_id, zypp::Source_Ref::alias(), zypp::Url::asCompleteString(), zypp::filesystem::assert_dir(), zypp::ui::asString(), zypp::str::hexstring(), zypp::Source_Ref::path(), zypp::Source_Ref::storeMetadata(), zypp::Source_Ref::url(), url, and ZYPP_THROW.
| void zypp::SourceCache::restoreSources | ( | ) |
Definition at line 79 of file SourceCache.cc.
References _cache_dir, zypp::ui::asString(), zypp::str::getline(), zypp::filesystem::readdir(), zypp::SourceManager::sourceManager(), url, and ZYPP_THROW.
| void zypp::SourceCache::removeSource | ( | unsigned | id | ) |
Definition at line 101 of file SourceCache.cc.
References _cache_dir, _next_cache_id, zypp::str::hexstring(), zypp::filesystem::recursive_rmdir(), and ZYPP_THROW.
| void zypp::SourceCache::removeSource | ( | const Url & | url_r, | |
| const Pathname & | path_r = "/" | |||
| ) |
Definition at line 108 of file SourceCache.cc.
References _cache_dir, zypp::Url::asCompleteString(), zypp::ui::asString(), zypp::str::getline(), zypp::filesystem::readdir(), zypp::filesystem::recursive_rmdir(), url, and ZYPP_THROW.
| std::ostream & operator<< | ( | std::ostream & | str, | |
| const SourceCache & | obj | |||
| ) | [friend] |
Pathname zypp::SourceCache::_cache_dir [static, private] |
directory to store cached data
Definition at line 58 of file SourceCache.h.
Referenced by removeSource(), restoreSources(), setCacheDir(), and storeSource().
unsigned zypp::SourceCache::_next_cache_id [static, private] |
counter of caches
Definition at line 60 of file SourceCache.h.
Referenced by removeSource(), and storeSource().
1.5.0