50 :
_pimpl( allocated_r ? allocated_r : new
Impl )
87 :
_pimpl( allocated_r ? allocated_r : new
Impl )
109 str <<
str::form(
"|product|%s|%s|%s|%s|",
117 str << endl <<
" " << *it;
124 str <<
str::form(
"|upgrade|%s|%s|%s|%s|%s|",
129 (obj.
notify() ?
"notify" :
"noNotify") );
141 : ParseDef(
"product", MANDTAORY )
145 (
"vendor", OPTIONAL, xml::parseDefAssign( _pdata._vendor ) )
146 (
"name", MANDTAORY, xml::parseDefAssign( _pdata._name ) )
147 (
"version", MANDTAORY, xml::parseDefAssign( _version ) )
148 (
"release", MANDTAORY, xml::parseDefAssign( _release ) )
149 (
"arch", MANDTAORY, xml::parseDefAssign( _pdata._arch ) )
150 (
"shortsummary", OPTIONAL, xml::parseDefAssign( _pdata._shortName ) )
151 (
"summary", MULTIPLE_OPTIONAL, xml::parseDefAssign( _ttext )(
"lang", _tlocale )
153 (
"productline", OPTIONAL, xml::parseDefAssign( _pdata._productline ) )
154 (
"register", OPTIONAL)
155 (
"updaterepokey", OPTIONAL, xml::parseDefAssign( _pdata._updaterepokey ) )
156 (
"upgrades", OPTIONAL)
160 (
"target", OPTIONAL, xml::parseDefAssign( _pdata._registerTarget ) )
161 (
"release", OPTIONAL, xml::parseDefAssign( _pdata._registerRelease ) )
162 (
"flavor", OPTIONAL, xml::parseDefAssign( _pdata._registerFlavor ) )
166 (
"upgrade", MULTIPLE_OPTIONAL, xml::parseDefAssign()
170 (*this)[
"upgrades"][
"upgrade"]
171 (
"name", OPTIONAL, xml::parseDefAssign( _upgrade._name ) )
172 (
"summary", OPTIONAL, xml::parseDefAssign( _upgrade._summary ) )
173 (
"repository", OPTIONAL, xml::parseDefAssign( _upgrade._repository ) )
174 (
"product", OPTIONAL, xml::parseDefAssign( _upgrade._product ) )
175 (
"notify", OPTIONAL, xml::parseDefAssign( _upgrade._notify ) )
176 (
"status", OPTIONAL, xml::parseDefAssign( _upgrade._status ) )
188 _pdata._upgrades.push_back( cdata );
195 if ( store_r.empty() || _tlocale.empty() )
202 _pdata._edition =
Edition( _version, _release );
219 MIL <<
"+++" << input_r << endl;
229 rootNode.
take( reader );
236 ERR <<
"---" << ret <<
" - " << input_r << endl;
242 ret = _consumer( pdata );
245 MIL <<
"---" << ret <<
" - " << input_r << endl;
253 std::list<Pathname> retlist;
257 WAR <<
"scanDir " << dir_r <<
" failed (" << res <<
")" << endl;
262 for_( it, retlist.begin(), retlist.end() )
264 if ( PathInfo( *it, PathInfo::LSTAT ).isFile() && ! reader.
parse( *it ) )
274 if ( ! PathInfo( file_r ).isFile() )
276 WAR <<
"scanFile " << PathInfo( file_r ) <<
" is not a file." << endl;
ProductFileData::Impl & _pdata
std::string shortName() const
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.
String related utilities and Regular expression matching.
Access to the sat-pools string space.
#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 form(const char *format,...) __attribute__((format(printf
Printf style construction of std::string.
std::string summary() const
RWCOW_pointer< Impl > _pimpl
RWCOW_pointer< Impl > _pimpl
std::string registerFlavor() const
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.
std::ostream & operator<<(std::ostream &str, const ProductFileData &obj)
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
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
std::string productline() const
ProductFileData(Impl *allocated_r=0)
Ctor takes ownership of allocated_r.
std::vector< Upgrade > Upgrades
std::string registerRelease() const
Easy-to use interface to the ZYPP dependency resolver.
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 _registerFlavor
std::string _registerTarget
function< bool(const ProductFileData &)> Consumer
Callback being invoked for each ProductFileData parsed.