Use operator overloading best practices.
Not all files covered. Refer to StackOverflow for details: http://stackoverflow.com/a/4421719
This commit is contained in:
@@ -40,7 +40,6 @@ struct File
|
||||
dir=false; size=-1; hash=-1; priv=NULL; dirp=NULL;
|
||||
}
|
||||
|
||||
bool operator== (const File &rhs) const { return lname==rhs.lname; }
|
||||
bool operator< (const File &rhs) const { return lname<rhs.lname; }
|
||||
|
||||
bool equal(const File &rhs) const { return lname == rhs.lname; }
|
||||
@@ -52,6 +51,15 @@ struct File
|
||||
}
|
||||
};
|
||||
|
||||
inline bool operator==(File const &lhs, File const &rhs)
|
||||
{
|
||||
return lhs.lname == rhs.lname;
|
||||
}
|
||||
inline bool operator!=(File const &lhs, File const &rhs)
|
||||
{
|
||||
return !operator==(lhs, rhs);
|
||||
}
|
||||
|
||||
/** @brief This represents a directory. */
|
||||
struct FileSet
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user