libzypp 17.31.7
zypp::filesystem::DevInoCache Class Reference

Simple cache remembering device/inode to detect hardlinks. More...

#include <fs/PathInfo.h>

Public Member Functions

 DevInoCache ()
 Ctor. More...
void clear ()
 Clear cache. More...
bool insert (const dev_t &dev_r, const ino_t &ino_r)
 Remember dev/ino. More...

Private Attributes

std::map< dev_t, std::set< ino_t > > _devino

Detailed Description

Simple cache remembering device/inode to detect hardlinks.

for ( all files ) {
if ( trace.insert( file.device, file.inode ) ) {
// 1st occurance of file
// else: hardlink; already counted this device/inode

Definition at line 187 of file PathInfo.h.

Constructor & Destructor Documentation

◆ DevInoCache()

zypp::filesystem::DevInoCache::DevInoCache ( )


Definition at line 191 of file PathInfo.h.

Member Function Documentation

◆ clear()

void zypp::filesystem::DevInoCache::clear ( )

Clear cache.

Definition at line 194 of file PathInfo.h.

◆ insert()

bool zypp::filesystem::DevInoCache::insert ( const dev_t &  dev_r,
const ino_t &  ino_r 

Remember dev/ino.

\Return true if it's inserted the first time, false if alredy present in cache (a hardlink to a previously remembered file).

Definition at line 201 of file PathInfo.h.

Member Data Documentation

◆ _devino

std::map<dev_t,std::set<ino_t> > zypp::filesystem::DevInoCache::_devino

Definition at line 206 of file PathInfo.h.

The documentation for this class was generated from the following file: