36 PathInfo pi( file_r );
39 WAR <<
"Can't read " << pi << endl;
42 std::ifstream infile( file_r.c_str() );
46 if ( ! l.empty() && l[0] !=
'#' )
51 MIL <<
"Read " << pi << endl;
60 outs <<
"# zypp::SoftLocksFile generated " <<
Date::now() << endl;
61 dumpRange( outs, data_r.begin(), data_r.end(),
"#",
"\n",
"\n",
"\n",
"#\n" );
67 MIL <<
"Wrote " << PathInfo(file_r) << endl;
71 ERR <<
"Can't write " << PathInfo(tmp.
path()) << endl;
82 str << obj.
file() <<
' ';
bool next()
Advance to next line.
int chmod(const Pathname &path, mode_t mode)
Like 'chmod'.
const Data & data() const
Return the data.
Access to the sat-pools string space.
Simple lineparser: Traverse each line in a file.
Provide a new empty temporary file and delete it when no longer needed.
static void load(const Pathname &file_r, Data &data_r)
Read Data from file_r.
static void store(const Pathname &file_r, const Data &data_r)
Write Data to file_r.
const Pathname & file() const
Return the file path.
std::ostream & dumpRange(std::ostream &str, _Iterator begin, _Iterator end, const std::string &intro="{", const std::string &pfx="\n ", const std::string &sep="\n ", const std::string &sfx="\n", const std::string &extro="}")
Print range defined by iterators (multiline style).
std::string trim(const std::string &s, const Trim trim_r)
int rename(const Pathname &oldpath, const Pathname &newpath)
Like 'rename'.
const char * c_str() const
String representation.
std::ostream & operator<<(std::ostream &str, const CommitPackageCache &obj)
scoped_ptr< Data > _dataPtr
Save and restore soft locks.
std::tr1::unordered_set< IdString > Data
static Date now()
Return the current time.
static TmpFile makeSibling(const Pathname &sibling_r)
Provide a new empty temporary directory as sibling.