Use gcc-c++ >= 4.5
[platform/upstream/libzypp.git] / zypp / parser / ProductFileReader.cc
index 0ea5f97..b68d4cd 100644 (file)
@@ -146,7 +146,8 @@ namespace zypp
             ("release",       MANDTAORY,  xml::parseDefAssign( _release ) )
             ("arch",          MANDTAORY,  xml::parseDefAssign( _pdata._arch ) )
             ("shortsummary",  OPTIONAL,   xml::parseDefAssign( _pdata._shortName ) )
-            ("summary",       OPTIONAL,   xml::parseDefAssign( _pdata._summary ) )
+            ("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 ) )
@@ -184,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 )
@@ -197,6 +205,9 @@ namespace zypp
         std::string             _version;
         std::string             _release;
 
+       std::string             _ttext;
+       std::string             _tlocale;
+
         ProductFileData::Upgrade::Impl _upgrade;
     };