50 : _pimpl( allocated_r ? allocated_r : new
Impl )
86 :
_pimpl( allocated_r ? allocated_r : new
Impl )
107 str <<
str::form(
"|product|%s|%s|%s|%s|",
115 str << endl <<
" " << *it;
122 str <<
str::form(
"|upgrade|%s|%s|%s|%s|%s|",
127 (obj.
notify() ?
"notify" :
"noNotify") );
152 (
"register", OPTIONAL)
154 (
"upgrades", OPTIONAL)
167 (*this)[
"upgrades"][
"upgrade"]
192 if ( store_r.empty() ||
_tlocale.empty() )
216 MIL <<
"+++" << input_r << endl;
226 rootNode.
take( reader );
233 ERR <<
"---" << ret <<
" - " << input_r << endl;
242 MIL <<
"---" << ret <<
" - " << input_r << endl;
250 std::list<Pathname> retlist;
254 WAR <<
"scanDir " << dir_r <<
" failed (" << res <<
")" << endl;
259 for_( it, retlist.begin(), retlist.end() )
261 if ( PathInfo( *it, PathInfo::LSTAT ).isFile() && ! reader.
parse( *it ) )
271 if ( ! PathInfo( file_r ).isFile() )
273 WAR <<
"scanFile " << PathInfo( file_r ) <<
" is not a file." << endl;
ProductFileData::Impl & _pdata
std::string shortName() const
ParseDef(const std::string &name_r, Mode mode_r)
Define a xml node structure to parse.
static ProductFileData scanFile(const Pathname &file_r)
Parse one file (or symlink) and return the ProductFileData parsed.
std::string repository() const
std::string _updaterepokey
GetFirst< _Tp > getFirst(_Tp &result_r)
Convenience function for creating GetFirst.
Access to the sat-pools string space.
std::ostream & operator<<(std::ostream &str, const IniDict &obj)
#define for_(IT, BEG, END)
Convenient for-loops using iterator.
Edition represents [epoch:]version[-release]
DefaultIntegral< bool, false > _notify
std::string product() const
std::string summary() const
RWCOW_pointer< Impl > _pimpl
const Upgrades & upgrades() const
void done(const xml::Node &_node)
finaly
xmlTextReader based interface to Reader's current node.
ProductNode(ProductFileData::Impl &pdata_r)
void take(Reader &reader_r)
Parse the node.
std::string registerTarget() const
void doneUpgrade(const xml::Node &_node)
collect _upgrade
bool parse(const InputStream &input_r=InputStream()) const
Parse the input stream and call _consumer for each parsed section.
const char * c_str() const
Conversion to const char *
void doneLocalizedDefault(const xml::Node &_node, std::string &store_r)
collect localized data
const char * c_str() const
std::string form(const char *format,...)
Printf style construction of std::string.
int readdir(std::list< std::string > &retlist_r, const Pathname &path_r, bool dots_r)
Return content of directory via retlist.
const char * c_str() const
ProductFileData::Upgrade::Impl _upgrade
Base class for Exception.
Data returned by ProductFileReader.
std::string status() const
std::string _registerRelease
Upgrade(Impl *allocated_r=0)
Ctor takes ownership of allocated_r.
std::string summary() const
void setConsumer(const shared_ptr< ParseDefConsume > &target_r)
Set data consumer.
std::string productline() const
ProductFileData(Impl *allocated_r=0)
Ctor takes ownership of allocated_r.
std::vector< Upgrade > Upgrades
std::string registerRelease() const
Parser for /etc/products.d enries (just relevant entires).
std::string updaterepokey() const
static bool scanDir(const Consumer &consumer_r, const Pathname &dir_r)
Parse all files (no symlinks) in dir_r and call consumer_r for each ProductFileData parsed...
std::string _registerTarget
function< bool(const ProductFileData &)> Consumer
Callback being invoked for each ProductFileData parsed.
xmlTextReader based interface to iterate xml streams.