fixup Fix to build with libxml 2.12.x (fixes #505)
[platform/upstream/libzypp.git] / zypp / PathInfo.h
index 8209bad..cb05df5 100644 (file)
@@ -27,9 +27,9 @@ extern "C"
 #include <set>
 #include <map>
 
-#include "zypp/Pathname.h"
-#include "zypp/CheckSum.h"
-#include "zypp/ByteCount.h"
+#include <zypp/Pathname.h>
+#include <zypp/CheckSum.h>
+#include <zypp/ByteCount.h>
 
 ///////////////////////////////////////////////////////////////////
 namespace zypp
@@ -359,8 +359,8 @@ namespace zypp
       dev_t  dev()     const { return isExist() ? statbuf_C.st_dev  : 0; }
       dev_t  rdev()    const { return isExist() ? statbuf_C.st_rdev : 0; }
 
-      unsigned int major() const;
-      unsigned int minor() const;
+      unsigned int devMajor() const;
+      unsigned int devMinor() const;
       //@}
 
       /** \name Size info. */
@@ -540,9 +540,14 @@ namespace zypp
       bool operator==( const DirEntry &rhs ) const;
     };
 
+    inline std::ostream & operator<<( std::ostream & str, const DirEntry & obj )
+    { return str << '[' << obj.type << "] " << obj.name; }
+
     /** Returned by readdir. */
     typedef std::list<DirEntry> DirContent;
 
+    std::ostream & operator<<( std::ostream & str, const DirContent & obj );
+
     /**
      * Return content of directory via retlist. If dots is false
      * entries starting with '.' are not reported. "." and ".."
@@ -576,6 +581,10 @@ namespace zypp
      * @return 0 on success, errno on failure
      **/
     int assert_file( const Pathname & path, unsigned mode = 0644 );
+    /**
+     * Like \ref assert_file but enforce \a mode even if the file already exists.
+     */
+    int assert_file_mode( const Pathname & path, unsigned mode = 0644 );
 
     /**
      * Change file's modification and access times.
@@ -593,7 +602,10 @@ namespace zypp
     int unlink( const Pathname & path );
 
     /**
-     * Like '::rename'. Renames a file, moving it between directories if required.
+     * Like '::rename'. Renames a file, moving it between directories if
+     * required. It falls back to using mv(1) in case errno is set to
+     * EXDEV, indicating a cross-device rename, which is likely to happen when
+     * oldpath and newpath are not on the same OverlayFS layer.
      *
      * @return 0 on success, errno on failure
      **/
@@ -726,7 +738,7 @@ namespace zypp
     /**
      * check files checksum
      *
-     * @return true if the checksum matchs
+     * @return true if the checksum matches (an empty Checksum always matches!)
      **/
     bool is_checksum( const Pathname & file, const CheckSum &checksum );
 
@@ -763,7 +775,7 @@ namespace zypp
      *
      * @return ZT_GZ, ZT_BZ2 if file is compressed, otherwise ZT_NONE.
      **/
-    enum ZIP_TYPE { ZT_NONE, ZT_GZ, ZT_BZ2 };
+    enum ZIP_TYPE { ZT_NONE, ZT_GZ, ZT_BZ2, ZT_ZCHNK };
 
     ZIP_TYPE zipType( const Pathname & file );