yast2-core
Public Member Functions | Private Attributes | List of all members
PathInfo::devino_cache Class Reference

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

#include <PathInfo.h>

Public Member Functions

 devino_cache ()
 
void clear ()
 
bool insert (const dev_t &dev_r, const ino_t &ino_r)
 

Private Attributes

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

Detailed Description

Simple cache remembering device/inode to detect hardlinks.

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

Constructor & Destructor Documentation

PathInfo::devino_cache::devino_cache ( )
inline

Constructor

Member Function Documentation

void PathInfo::devino_cache::clear ( )
inline

Clear cache

bool PathInfo::devino_cache::insert ( const dev_t &  dev_r,
const ino_t &  ino_r 
)
inline

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.

Member Data Documentation

std::map<dev_t,std::set<ino_t> > PathInfo::devino_cache::_devino
private

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

Generated on a sunny day for yast2-core by doxygen 1.8.11