]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
- add index and simplify operator<<(xa_value_t)
authorOndrej Kozina <okozina@redhat.com>
Thu, 31 Jan 2013 15:01:40 +0000 (16:01 +0100)
committerOndrej Kozina <okozina@redhat.com>
Wed, 27 Feb 2013 16:24:57 +0000 (17:24 +0100)
snapper/XAttributes.cc

index 6dfbd99e961b2668cd465e071d26176bb3f4db7a..ea31b74df81a2fdc99a099bfd49dde0776571852 100644 (file)
@@ -136,17 +136,16 @@ namespace snapper
     operator<<(ostream &out, const xa_value_t &xavalue)
     {
         char tmp[4];
+        int pos = 0;
 
         xa_value_t::const_iterator cit = xavalue.begin();
 
         while (cit != xavalue.end())
         {
             sprintf(tmp, "%d", *cit);
-            out << tmp;
-            if (++cit == xavalue.end())
-                out << "";
-            else
-                out << ":";
+            out << '<' << pos++ << '>' << tmp;
+            if (++cit != xavalue.end())
+                out << ':';
         }
 
         return out;