mirror of
https://github.com/KingDuckZ/dindexer.git
synced 2025-08-08 13:49:47 +00:00
Fix various problems introduced in scan with the last commit.
Fixes a crash due to an assertion trying to access a past-the-end iterator. Gets content type detection to work, although only after hashing is done (see comment in main.cpp for details). Fixes a problem with the array passed to guess_content_type being not sorted as the function expects. Adds more assertions.
This commit is contained in:
parent
22614432a9
commit
be9fc3eb0b
7 changed files with 93 additions and 10 deletions
|
@ -51,11 +51,17 @@ namespace mchlib {
|
|||
{
|
||||
}
|
||||
|
||||
#if defined(NDEBUG)
|
||||
FileRecordData ( const FileRecordData& ) = delete;
|
||||
#else
|
||||
FileRecordData ( const FileRecordData& ) = default;
|
||||
#endif
|
||||
FileRecordData ( FileRecordData&& ) = default;
|
||||
FileRecordData& operator= ( const FileRecordData& ) = delete;
|
||||
FileRecordData& operator= ( FileRecordData&& ) = default;
|
||||
bool operator== ( const FileRecordData& ) const = delete;
|
||||
#if !defined(NDEBUG)
|
||||
bool operator== ( const FileRecordData& parOther ) const;
|
||||
#endif
|
||||
|
||||
TigerHash hash;
|
||||
std::string abs_path;
|
||||
|
@ -83,6 +89,12 @@ namespace mchlib {
|
|||
std::string name;
|
||||
uint32_t disk_number;
|
||||
};
|
||||
|
||||
#if !defined(NDEBUG)
|
||||
inline bool FileRecordData::operator== (const FileRecordData& parOther) const {
|
||||
return (this->abs_path == parOther.abs_path);
|
||||
}
|
||||
#endif
|
||||
} //namespace mchlib
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue