libzypp 17.37.17
zypp::RepoStatus Class Reference

Track changing files or directories. More...

#include <zypp/RepoStatus.h>

Classes

struct  Impl
 RepoStatus implementation. More...

Public Member Functions

 RepoStatus ()
 Default ctor.
 RepoStatus (const Pathname &path_r)
 Compute status for single file or directory (recursively)
 RepoStatus (const RepoInfo &info_r)
 Compute status of a RepoInfo to track changes requiring a refresh.
 RepoStatus (std::string checksum_r, Date timestamp_r)
 Explicitly specify checksum string and timestamp to use.
 ~RepoStatus ()
 Dtor.
 RepoStatus (const RepoStatus &)=default
 RepoStatus (RepoStatus &&) noexcept=default
RepoStatusoperator= (const RepoStatus &)=default
RepoStatusoperator= (RepoStatus &&) noexcept=default
void saveToCookieFile (const Pathname &path_r) const
 Save the status information to a cookie file.
bool empty () const
 Whether the status is empty (empty checksum)
Date timestamp () const
 The time the data were changed the last time.

Static Public Member Functions

static RepoStatus fromCookieFile (const Pathname &path)
 Reads the status from a cookie file.
static RepoStatus fromCookieFileUseMtime (const Pathname &path)
 Reads the status from a cookie file but uses the files mtime.

Private Attributes

RWCOW_pointer< Impl_pimpl
 Implementation.

Friends

std::ostream & operator<< (std::ostream &str, const RepoStatus &obj)
RepoStatus operator&& (const RepoStatus &lhs, const RepoStatus &rhs)
bool operator== (const RepoStatus &lhs, const RepoStatus &rhs)

(Note that these are not member symbols.)

std::ostream & operator<< (std::ostream &str, const RepoStatus &obj) ZYPP_API
 Stream output.
RepoStatus operator&& (const RepoStatus &lhs, const RepoStatus &rhs) ZYPP_API
 Combine two RepoStatus (combined checksum and newest timestamp)
bool operator== (const RepoStatus &lhs, const RepoStatus &rhs) ZYPP_API
 Whether 2 RepoStatus refer to the same content checksum.
bool operator!= (const RepoStatus &lhs, const RepoStatus &rhs)
 Whether 2 RepoStatus refer to different content checksums.

Detailed Description

Track changing files or directories.

Compute timestamp and checksum for individual files or directories (recursively) to track changing content.

The timestamp most probably denotes the time the data were changed the last time, that's why it is exposed.

The checksum however is an implementation detail and of no use outside this class. operator== tells if the checksums of two rRepoStatus are the same.

Definition at line 40 of file RepoStatus.h.

Constructor & Destructor Documentation

◆ RepoStatus() [1/6]

zypp::RepoStatus::RepoStatus ( )

Default ctor.

Definition at line 172 of file RepoStatus.cc.

◆ RepoStatus() [2/6]

zypp::RepoStatus::RepoStatus ( const Pathname & path_r)
explicit

Compute status for single file or directory (recursively)

Timestamp is the files mtime or the youngest mtime in the directory tree.

Note
Construction from a non existing file or direcory will result in an empty status.

Definition at line 176 of file RepoStatus.cc.

◆ RepoStatus() [3/6]

zypp::RepoStatus::RepoStatus ( const RepoInfo & info_r)
explicit

Compute status of a RepoInfo to track changes requiring a refresh.

Definition at line 195 of file RepoStatus.cc.

◆ RepoStatus() [4/6]

zypp::RepoStatus::RepoStatus ( std::string checksum_r,
Date timestamp_r )

Explicitly specify checksum string and timestamp to use.

Definition at line 201 of file RepoStatus.cc.

◆ ~RepoStatus()

zypp::RepoStatus::~RepoStatus ( )

Dtor.

Definition at line 207 of file RepoStatus.cc.

◆ RepoStatus() [5/6]

zypp::RepoStatus::RepoStatus ( const RepoStatus & )
default

◆ RepoStatus() [6/6]

zypp::RepoStatus::RepoStatus ( RepoStatus && )
defaultnoexcept

Member Function Documentation

◆ operator=() [1/2]

RepoStatus & zypp::RepoStatus::operator= ( const RepoStatus & )
default

◆ operator=() [2/2]

RepoStatus & zypp::RepoStatus::operator= ( RepoStatus && )
defaultnoexcept

◆ fromCookieFile()

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

Reads the status from a cookie file.

Returns
An empty RepoStatus if the file does not exist or is not readable.
See also
saveToCookieFile

Definition at line 210 of file RepoStatus.cc.

◆ fromCookieFileUseMtime()

RepoStatus zypp::RepoStatus::fromCookieFileUseMtime ( const Pathname & path)
static

Reads the status from a cookie file but uses the files mtime.

Similar to the ctor's behavior, the returned timestamp is the cookie file's mtime. By touching an index or cookie file one may state the last time the data were found being up-to-date. Such a CookieFile is used e.g. as a pseudo metadata indexfile for plaindir repos.

Definition at line 217 of file RepoStatus.cc.

◆ saveToCookieFile()

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

Save the status information to a cookie file.

Exceptions
Exceptionif the file can't be saved
See also
fromCookieFile

Definition at line 224 of file RepoStatus.cc.

◆ empty()

bool zypp::RepoStatus::empty ( ) const

Whether the status is empty (empty checksum)

Definition at line 234 of file RepoStatus.cc.

◆ timestamp()

Date zypp::RepoStatus::timestamp ( ) const

The time the data were changed the last time.

Definition at line 237 of file RepoStatus.cc.

◆ operator<< [1/2]

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

Definition at line 240 of file RepoStatus.cc.

◆ operator&& [1/2]

RepoStatus operator&& ( const RepoStatus & lhs,
const RepoStatus & rhs )
friend

Definition at line 243 of file RepoStatus.cc.

◆ operator== [1/2]

bool operator== ( const RepoStatus & lhs,
const RepoStatus & rhs )
friend

Definition at line 250 of file RepoStatus.cc.

◆ operator<<() [2/2]

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

Stream output.

Definition at line 240 of file RepoStatus.cc.

◆ operator&&() [2/2]

RepoStatus operator&& ( const RepoStatus & lhs,
const RepoStatus & rhs )
related

Combine two RepoStatus (combined checksum and newest timestamp)

Definition at line 243 of file RepoStatus.cc.

◆ operator==() [2/2]

bool operator== ( const RepoStatus & lhs,
const RepoStatus & rhs )
related

Whether 2 RepoStatus refer to the same content checksum.

Definition at line 250 of file RepoStatus.cc.

◆ operator!=()

bool operator!= ( const RepoStatus & lhs,
const RepoStatus & rhs )
related

Whether 2 RepoStatus refer to different content checksums.

Definition at line 121 of file RepoStatus.h.

Member Data Documentation

◆ _pimpl

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

Implementation.

Pointer to implementation

Definition at line 107 of file RepoStatus.h.


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