If both are directories they are deemed equal simply if the names match.
| Return Type | Function name | Arguments |
|---|---|---|
| bool | hzDirent::operator== | (hzDirent&,) |
Declared in file: hzDirectory.h
Defined in file : hzDirectory.cpp
Function Logic:
Function body:
bool hzDirent::operator== (hzDirent& op)
{
// If both are directories they are deemed equal simply if the names match.
if (ISDIR(m_Mode) && ISDIR(op.m_Mode))
return m_Name == op.m_Name ? true : false ;
// Cannot be equal if one is a dir and the other is a file
if (ISDIR(m_Mode))
return false ;
if (ISDIR(op.m_Mode))
return false ;
// Case where both are file
if (Path() != op.Path())
return false ;
return m_Name == op.m_Name && m_Mtime == op.m_Mtime && m_Size == op.m_Size ? true : false ;
}