15 #include <zypp/base/LogTools.h> 16 #include <zypp/base/IOStream.h> 17 #include <zypp/base/String.h> 19 #include <zypp/PathInfo.h> 20 #include <zypp/TmpPath.h> 21 #include <zypp/Date.h> 39 WAR <<
"Can't read " << pi << endl;
42 std::ifstream infile( file_r.
c_str() );
46 if ( ! l.empty() && l[0] !=
'#' )
48 locales_r.insert(
Locale(l) );
51 MIL <<
"Read " << pi << endl;
60 outs <<
"# zypp::RequestedLocales generated " <<
Date::now() << endl;
61 dumpRange( outs, locales_r.begin(), locales_r.end(),
"#",
"\n",
"\n",
"\n",
"#\n" );
const Pathname & file() const
Return the file path.
Save and restore locale set from file.
bool next()
Advance to next line.
int chmod(const Pathname &path, mode_t mode)
Like 'chmod'.
std::ostream & dumpRange(std::ostream &str, TIterator begin, TIterator end, const std::string &intro="{", const std::string &pfx="\ ", const std::string &sep="\ ", const std::string &sfx="\, const std::string &extro="}")
Print range defined by iterators (multiline style).
const char * c_str() const
String representation.
String related utilities and Regular expression matching.
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, LocaleSet &locales_r)
Read LocaleSet from file_r.
const LocaleSet & locales() const
Return the loacale set.
std::string trim(const std::string &s, const Trim trim_r)
int rename(const Pathname &oldpath, const Pathname &newpath)
Like 'rename'.
static void store(const Pathname &file_r, const LocaleSet &locales_r)
Write LocaleSet to file_r.
std::ostream & operator<<(std::ostream &str, const CommitPackageCache &obj)
'Language[_Country]' codes.
static Date now()
Return the current time.
scoped_ptr< LocaleSet > _localesPtr
Wrapper class for ::stat/::lstat.
static TmpFile makeSibling(const Pathname &sibling_r)
Provide a new empty temporary directory as sibling.
Easy-to use interface to the ZYPP dependency resolver.
std::unordered_set< Locale > LocaleSet