32 void recursiveTimestamp(
const Pathname & dir_r, time_t & max_r )
34 std::list<std::string> dircontent;
38 for_( it, dircontent.begin(), dircontent.end() )
43 if ( pi.mtime() > max_r )
45 recursiveTimestamp( pi.path(), max_r );
72 static const std::string
magic(
"43" );
119 std::stringstream
ss;
139 std::ifstream file(
path_r.c_str() );
141 WAR <<
"No cookie file " <<
path_r << endl;
162 {
return new Impl( *
this ); }
186 else if ( info.
isDir() )
226 std::ofstream file(
path_r.c_str());
230 file <<
_pimpl->checksum() <<
" " << time_t(
_pimpl->timestamp()) << endl;
235 {
return _pimpl->empty(); }
238 {
return _pimpl->timestamp(); }
251 {
return lhs.
_pimpl->checksum() == rhs.
_pimpl->checksum(); }
Reference counted access to a Tp object calling a custom Dispose function when the last AutoDispose h...
void reset()
Reset to default Ctor values.
shared_ptr< Impl > _pimpl
static CheckSum sha1FromString(const std::string &input_r)
static CheckSum sha1(const std::string &checksum)
Store and operate on date (time_t).
Base class for Exception.
What is known about a repository.
Track changing files or directories.
static RepoStatus fromCookieFileUseMtime(const Pathname &path)
Reads the status from a cookie file but uses the files mtime.
RWCOW_pointer< Impl > _pimpl
Implementation.
static RepoStatus fromCookieFile(const Pathname &path)
Reads the status from a cookie file.
Date timestamp() const
The time the data were changed the last time.
bool empty() const
Whether the status is empty (empty checksum)
RepoStatus()
Default ctor.
void saveToCookieFile(const Pathname &path_r) const
Save the status information to a cookie file.
Wrapper class for stat/lstat.
bool isExist() const
Return whether valid stat info exists.
String related utilities and Regular expression matching.
int readdir(std::list< std::string > &retlist_r, const Pathname &path_r, bool dots_r)
Return content of directory via retlist.
std::string sha1sum(const Pathname &file)
Compute a files sha1sum.
std::string stripLastWord(std::string &line, const bool rtrim_first)
std::string numstring(char n, int w=0)
std::string getline(std::istream &str, const Trim trim_r)
Return stream content up to (but not returning) the next newline.
Easy-to use interface to the ZYPP dependency resolver.
bool operator==(const SetRelation::Enum &lhs, const SetCompare &rhs)
This is an overloaded member function, provided for convenience. It differs from the above function o...
std::ostream & operator<<(std::ostream &str, const SerialNumber &obj)
RepoStatus operator&&(const RepoStatus &lhs, const RepoStatus &rhs)
RepoStatus implementation.
void assignFromCtor(std::string &&checksum_r, Date &×tamp_r)
Assign data called from RepoStatus ctor (adds magic).
std::string checksum() const
void injectFrom(const Impl &rhs)
Inject the raw data from rhs.
void assignFromCookieFile(const Pathname &path_r, bool useMtime_r=false)
std::ostream & dumpOn(std::ostream &str) const
Dump to log file (not to/from CookieFile).
std::set< std::string > Checksums
std::optional< std::string > _cachedchecksum
void inject(std::string &&checksum_r, Date &×tamp_r)
Inject raw data (no magic added).
Impl * clone() const
clone for RWCOW_pointer
#define for_(IT, BEG, END)
Convenient for-loops using iterator.
#define ZYPP_THROW(EXCPT)
Drops a logline and throws the Exception.