#include <RepoStatus.h>
Classes | |
struct | Impl |
RepoStatus implementation. More... | |
Public Member Functions | |
void | saveToCookieFile (const Pathname &path) const |
save the status information to a cookie file | |
std::string | checksum () const |
Checksum of the repository. | |
Date | timestamp () const |
timestamp of the repository. | |
bool | empty () const |
Is the status empty? | |
RepoStatus & | setChecksum (const std::string &checksum) |
set the repository checksum | |
RepoStatus & | setTimestamp (const Date ×tamp) |
set the repository timestamp | |
RepoStatus () | |
Default ctor. | |
RepoStatus (const Pathname &file) | |
Status from a single file As most repository state is represented by the status of the index file, you can construct the status from a file. | |
~RepoStatus () | |
Dtor. | |
Static Public Member Functions | |
static RepoStatus | fromCookieFile (const Pathname &path) |
reads the status from a file which contains the checksum and timestamp in each line. | |
Private Attributes | |
RWCOW_pointer< Impl > | _pimpl |
Pointer to implementation. | |
Friends | |
std::ostream & | operator<< (std::ostream &str, const RepoStatus &obj) |
Anything that is not provided on the metadata files, like the timestamp of the downloaded metadata, and its checksum.
Definition at line 37 of file RepoStatus.h.
zypp::RepoStatus::RepoStatus | ( | ) |
zypp::RepoStatus::RepoStatus | ( | const Pathname & | file | ) |
Status from a single file As most repository state is represented by the status of the index file, you can construct the status from a file.
construct from a directory, the directories mtime will be also used as checksum.
Definition at line 75 of file RepoStatus.cc.
References _pimpl, zypp::str::numstring(), and zypp::filesystem::sha1sum().
zypp::RepoStatus::~RepoStatus | ( | ) |
RepoStatus zypp::RepoStatus::fromCookieFile | ( | const Pathname & | path | ) | [static] |
reads the status from a file which contains the checksum and timestamp in each line.
Definition at line 97 of file RepoStatus.cc.
References RepoStatus(), setChecksum(), setTimestamp(), and WAR.
Referenced by zypp::target::TargetImpl::buildCache(), and zypp::RepoManager::cacheStatus().
void zypp::RepoStatus::saveToCookieFile | ( | const Pathname & | path | ) | const |
save the status information to a cookie file
Exception | if the file can't be saved |
Definition at line 114 of file RepoStatus.cc.
References checksum(), timestamp(), and ZYPP_THROW.
Referenced by zypp::target::TargetImpl::buildCache(), and zypp::RepoManager::setCacheStatus().
string zypp::RepoStatus::checksum | ( | ) | const |
Checksum of the repository.
Usually the checksum of the index, but any checksum that changes when the repository changes in any way is sufficient.
Definition at line 141 of file RepoStatus.cc.
References _pimpl.
Referenced by zypp::target::TargetImpl::buildCache(), zypp::RepoManager::buildCache(), zypp::RepoManager::checkIfToRefreshMetadata(), zypp::operator&&(), zypp::RepoManager::refreshMetadata(), and saveToCookieFile().
Date zypp::RepoStatus::timestamp | ( | ) | const |
timestamp of the repository.
If the repository changes, it has to be updated as well with the new timestamp.
Definition at line 144 of file RepoStatus.cc.
References _pimpl.
Referenced by zypp::RepoManager::checkIfToRefreshMetadata(), zypp::operator&&(), and saveToCookieFile().
bool zypp::RepoStatus::empty | ( | ) | const |
Is the status empty?
An empty status means that the status was not calculated.
Definition at line 124 of file RepoStatus.cc.
References _pimpl.
Referenced by zypp::RepoManager::buildCache(), zypp::RepoManager::checkIfToRefreshMetadata(), and zypp::operator&&().
RepoStatus& zypp::RepoStatus::setChecksum | ( | const std::string & | checksum | ) |
set the repository checksum
checksum |
Referenced by zypp::parser::plaindir::dirStatus(), fromCookieFile(), and zypp::operator&&().
RepoStatus & zypp::RepoStatus::setTimestamp | ( | const Date & | timestamp | ) |
set the repository timestamp
timestamp |
Definition at line 135 of file RepoStatus.cc.
References _pimpl.
Referenced by zypp::parser::plaindir::dirStatus(), fromCookieFile(), and zypp::operator&&().
std::ostream & operator<< | ( | std::ostream & | str, | |
const RepoStatus & | obj | |||
) | [friend] |
Stream output
Definition at line 170 of file RepoStatus.cc.
RWCOW_pointer<Impl> zypp::RepoStatus::_pimpl [private] |
Pointer to implementation.
Definition at line 126 of file RepoStatus.h.
Referenced by checksum(), empty(), zypp::operator<<(), RepoStatus(), setTimestamp(), and timestamp().