zypp::RepoStatus Class Reference

Local facts about a repository This class represents the status of a repository on the system. More...

#include <RepoStatus.h>

List of all members.

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?
RepoStatussetChecksum (const std::string &checksum)
 set the repository checksum
RepoStatussetTimestamp (const Date &timestamp)
 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)


Detailed Description

Local facts about a repository This class represents the status of a repository on the system.

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.


Constructor & Destructor Documentation

zypp::RepoStatus::RepoStatus (  ) 

Default ctor.

Definition at line 71 of file RepoStatus.cc.

Referenced by fromCookieFile().

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.

Note:
construct from a non existing file will result in an empty status

construct from a directory, the directories mtime will be also used as checksum.

Todo:
Add recursive option for dirs so we finaly get the same as parser::plaindir::dirStatus and can unify both.

Definition at line 75 of file RepoStatus.cc.

References _pimpl, zypp::str::numstring(), and zypp::filesystem::sha1sum().

zypp::RepoStatus::~RepoStatus (  ) 

Dtor.

Definition at line 94 of file RepoStatus.cc.


Member Function Documentation

RepoStatus zypp::RepoStatus::fromCookieFile ( const Pathname &  path  )  [static]

reads the status from a file which contains the checksum and timestamp in each line.

Returns:
An empty RepoStatus if the file does not exist or is not readable.

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

Exceptions:
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

See also:
checksum
Parameters:
checksum 

Referenced by zypp::parser::plaindir::dirStatus(), fromCookieFile(), and zypp::operator&&().

RepoStatus & zypp::RepoStatus::setTimestamp ( const Date timestamp  ) 

set the repository timestamp

See also:
timestamp
Parameters:
timestamp 

Definition at line 135 of file RepoStatus.cc.

References _pimpl.

Referenced by zypp::parser::plaindir::dirStatus(), fromCookieFile(), and zypp::operator&&().


Friends And Related Function Documentation

std::ostream & operator<< ( std::ostream &  str,
const RepoStatus obj 
) [friend]

Stream output

Definition at line 170 of file RepoStatus.cc.


Member Data Documentation

Pointer to implementation.

Definition at line 126 of file RepoStatus.h.

Referenced by checksum(), empty(), zypp::operator<<(), RepoStatus(), setTimestamp(), and timestamp().


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

doxygen