Use gcc-c++ >= 4.5
[platform/upstream/libzypp.git] / zypp / parser / ProductFileReader.cc
index 34cb7ea..b68d4cd 100644 (file)
@@ -70,6 +70,9 @@ namespace zypp
       Edition     _edition;
       Arch        _arch;
 
+      std::string _shortName;
+      std::string _summary;
+
       std::string _productline;
       std::string _registerTarget;
       std::string _registerRelease;
@@ -88,6 +91,9 @@ namespace zypp
     Edition     ProductFileData::edition() const { return _pimpl->_edition; }
     Arch        ProductFileData::arch()    const { return _pimpl->_arch; }
 
+    std::string ProductFileData::shortName()   const { return _pimpl->_shortName; }
+    std::string ProductFileData::summary()     const { return _pimpl->_summary; }
+
     std::string ProductFileData::productline()     const { return _pimpl->_productline; }
     std::string ProductFileData::registerTarget()  const { return _pimpl->_registerTarget; }
     std::string ProductFileData::registerRelease() const { return _pimpl->_registerRelease; }
@@ -139,6 +145,9 @@ namespace zypp
             ("version",       MANDTAORY,  xml::parseDefAssign( _version ) )
             ("release",       MANDTAORY,  xml::parseDefAssign( _release ) )
             ("arch",          MANDTAORY,  xml::parseDefAssign( _pdata._arch ) )
+            ("shortsummary",  OPTIONAL,   xml::parseDefAssign( _pdata._shortName ) )
+            ("summary",       MULTIPLE_OPTIONAL, xml::parseDefAssign( _ttext )( "lang", _tlocale )
+                                         >>bind( &ProductNode::doneLocalizedDefault, this, _1, boost::ref(_pdata._summary) ))
             ("productline",   OPTIONAL,   xml::parseDefAssign( _pdata._productline ) )
             ("register",      OPTIONAL)
             ("updaterepokey", OPTIONAL,   xml::parseDefAssign( _pdata._updaterepokey ) )
@@ -176,6 +185,13 @@ namespace zypp
         _pdata._upgrades.push_back( cdata );
         _upgrade = ProductFileData::Upgrade::Impl();
       }
+      /** collect localized data */
+      void doneLocalizedDefault( const xml::Node & _node, std::string & store_r )
+      {
+       // take 1st or default
+       if ( store_r.empty() || _tlocale.empty() )
+         store_r = _ttext;
+      }
 
       /** finaly */
       void done( const xml::Node & _node )
@@ -189,6 +205,9 @@ namespace zypp
         std::string             _version;
         std::string             _release;
 
+       std::string             _ttext;
+       std::string             _tlocale;
+
         ProductFileData::Upgrade::Impl _upgrade;
     };