Mailinglist Archive: zypp-commit (149 mails)

< Previous Next >
[zypp-commit] r5364 - in /trunk/libzypp/zypp/parser/yum: PatchesFileReader.cc PatchesFileReader.h RepomdFileReader.h
  • From: dmacvicar@xxxxxxxxxxxxxxxx
  • Date: Thu, 12 Apr 2007 16:29:02 -0000
  • Message-id: <20070412162903.017E0236CE@xxxxxxxxxxxxxxxx>
Author: dmacvicar
Date: Thu Apr 12 18:29:02 2007
New Revision: 5364

URL: http://svn.opensuse.org/viewcvs/zypp?rev=5364&view=rev
Log:
documentation

Modified:
    trunk/libzypp/zypp/parser/yum/PatchesFileReader.cc
    trunk/libzypp/zypp/parser/yum/PatchesFileReader.h
    trunk/libzypp/zypp/parser/yum/RepomdFileReader.h

Modified: trunk/libzypp/zypp/parser/yum/PatchesFileReader.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/parser/yum/PatchesFileReader.cc?rev=5364&r1=5363&r2=5364&view=diff
==============================================================================
--- trunk/libzypp/zypp/parser/yum/PatchesFileReader.cc (original)
+++ trunk/libzypp/zypp/parser/yum/PatchesFileReader.cc Thu Apr 12 18:29:02 2007
@@ -32,15 +32,15 @@
   std::string data_type;
   if ( reader_r->nodeType() == XML_READER_TYPE_ELEMENT )
   {
-    if ( reader_r->name() == "repomd" )
+    if ( reader_r->name() == "patches" )
     {
       _tag = tag_Patches;
       return true;
     }
-    if ( reader_r->name() == "data" )
+    if ( reader_r->name() == "patch" )
     {
-      _tag = tag_Data;
-      _type = reader_r->getAttribute("type").asString();
+      _tag = tag_Patch;
+      _id = reader_r->getAttribute("id").asString();
       return true;
     }
     if ( reader_r->name() == "location" )
@@ -66,8 +66,8 @@
   else if ( reader_r->nodeType() == XML_READER_TYPE_END_ELEMENT )
   {
     //MIL << "end element" << endl;
-    if ( reader_r->name() == "data" )
-      _callback( _location, _type );
+    if ( reader_r->name() == "patch" )
+      _callback( _location, _id );
     return true;
   }
   return true;

Modified: trunk/libzypp/zypp/parser/yum/PatchesFileReader.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/parser/yum/PatchesFileReader.h?rev=5364&r1=5363&r2=5364&view=diff
==============================================================================
--- trunk/libzypp/zypp/parser/yum/PatchesFileReader.h (original)
+++ trunk/libzypp/zypp/parser/yum/PatchesFileReader.h Thu Apr 12 18:29:02 2007
@@ -25,30 +25,56 @@
   {
     namespace yum
     {
-    
+     /**
+      * Iterates through a patches.xml file giving on each iteration
+      * a \ref OnMediaLocation object with the resource and its
+      * patch id.
+      * The iteration is done via a callback provided on
+      * construction.
+      *
+      * \code
+      * PatchesFileReader reader(patches_file, 
+      *                  bind( &SomeClass::callbackfunc, &object, _1, _2 ) );
+      * \endcode
+      */
       class PatchesFileReader
       {
       public:
+        
+       /**
+        * Callback definition
+        * first parameter is a \ref OnMediaLocation object with the resource
+        * second parameter is the patch id.
+        */
         typedef function<bool( const OnMediaLocation &, const string & )> ProcessResource;
         
         enum Tag
         {
           tag_NONE,
           tag_Patches,
-          tag_Data,
+          tag_Patch,
           tag_Location,
           tag_CheckSum,
           tag_Timestamp,
           tag_OpenCheckSum
         };
         
-        PatchesFileReader( const Pathname &repomd_file, ProcessResource callback );
+       /**
+        * Constructor
+        * \param patches_file is the patches.xml file you want to read
+        * \param callback is a function. \see PatchesFileReader::ProcessResource
+        */
+        PatchesFileReader( const Pathname &patches_file, ProcessResource callback );
+        
+        /**
+        * Callback provided to the XML parser. Don't use it.
+        */
         bool consumeNode( Reader & reader_r );
         
         private:
           OnMediaLocation _location;
           Tag _tag;
-          std::string _type;
+          std::string _id;
           ProcessResource _callback;
           CheckSum _checksum;
           std::string _checksum_type;

Modified: trunk/libzypp/zypp/parser/yum/RepomdFileReader.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/parser/yum/RepomdFileReader.h?rev=5364&r1=5363&r2=5364&view=diff
==============================================================================
--- trunk/libzypp/zypp/parser/yum/RepomdFileReader.h (original)
+++ trunk/libzypp/zypp/parser/yum/RepomdFileReader.h Thu Apr 12 18:29:02 2007
@@ -41,6 +41,11 @@
       class RepomdFileReader
       {
       public:
+       /**
+        * Callback definition
+        * first parameter is a \ref OnMediaLocation object with the resource
+        * second parameter is the resource type
+        */
         typedef function<bool( const OnMediaLocation &, const string & )> ProcessResource;
         
         enum Tag

--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages