while (errno = 0, (direntPtr = readdir(dirPtr)) != nullptr) {
std::string filename = direntPtr->d_name;
- //ignore all special files (working dir, parent dir, index)
- if ("." == filename || ".." == filename ||
- PathConfig::StoragePath::indexFilename == filename) {
+ //ignore all special files (working dir, parent dir, index, checksums)
+ if (isSpecialDirectory(filename) || isSpecialDatabaseEntry(filename)) {
continue;
}
}
}
+bool Integrity::isSpecialDirectory(const std::string &filename) {
+ return "." == filename || ".." == filename;
+}
+
+bool Integrity::isSpecialDatabaseEntry(const std::string &filename) {
+ return PathConfig::StoragePath::indexFilename == filename ||
+ PathConfig::StoragePath::checksumFilename == filename;
+}
+
} /* namespace Cynara */
static void createHardLink(const std::string &oldName, const std::string &newName);
static void deleteHardLink(const std::string &filename);
+ static bool isSpecialDirectory(const std::string &filename);
+ static bool isSpecialDatabaseEntry(const std::string &filename);
+
private:
const std::string m_dbPath;
static const std::string m_indexFilename;