libzypp  13.10.6
zypp::RepoStatus Class Reference

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

#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 More...
 
std::string checksum () const
 Checksum of the repository. More...
 
Date timestamp () const
 timestamp of the repository. More...
 
bool empty () const
 Is the status empty? More...
 
RepoStatussetChecksum (const std::string &checksum)
 set the repository checksum More...
 
RepoStatussetTimestamp (const Date &timestamp)
 set the repository timestamp More...
 
 RepoStatus ()
 Default ctor. More...
 
 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. More...
 
 ~RepoStatus ()
 Dtor. More...
 

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. More...
 

Private Attributes

RWCOW_pointer< Impl_pimpl
 Pointer to implementation. More...
 

Friends

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

Related Functions

(Note that these are not member functions.)

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.

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.

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.

void zypp::RepoStatus::saveToCookieFile ( const Pathname &  path) const

save the status information to a cookie file

Exceptions
Exceptionif the file can't be saved

Definition at line 114 of file RepoStatus.cc.

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.

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.

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.

RepoStatus & zypp::RepoStatus::setChecksum ( const std::string &  checksum)

set the repository checksum

See Also
checksum
Parameters
checksum

Definition at line 129 of file RepoStatus.cc.

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

set the repository timestamp

See Also
timestamp
Parameters
timestamp

Definition at line 135 of file RepoStatus.cc.

Friends And Related Function Documentation

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

Definition at line 170 of file RepoStatus.cc.

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

Stream output

Definition at line 170 of file RepoStatus.cc.

Member Data Documentation

RWCOW_pointer<Impl> zypp::RepoStatus::_pimpl
private

Pointer to implementation.

Definition at line 126 of file RepoStatus.h.


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