Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/fix-build' into fix-build
Browse files Browse the repository at this point in the history
  • Loading branch information
JanSimek committed Aug 4, 2024
2 parents 5d9eb02 + 32e2fa1 commit 2665332
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/format/dat/Dat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

namespace geck {

std::unordered_map<std::filesystem::path, std::shared_ptr<DatEntry>> const& Dat::getEntries() const {
std::unordered_map<std::string, std::shared_ptr<DatEntry>> const& Dat::getEntries() const {
return this->entries;
}

void Dat::addEntry(const std::filesystem::path filename, std::shared_ptr<DatEntry> entry) {
this->entries.emplace(filename, entry);
this->entries.emplace(filename.string(), entry);
}

} // namespace geck
5 changes: 3 additions & 2 deletions src/format/dat/Dat.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ class Dat {
uint32_t treeSize;
uint32_t fileSize;

std::unordered_map<std::filesystem::path, std::shared_ptr<DatEntry>> entries;
std::unordered_map<std::string, std::shared_ptr<DatEntry>> entries;

public:
virtual ~Dat() = default;

[[nodiscard]] const std::unordered_map<std::filesystem::path, std::shared_ptr<DatEntry>>& getEntries() const;
// NOTE: MSVC does not support std::filesystem::path as a key in std::unordered_map
[[nodiscard]] const std::unordered_map<std::string, std::shared_ptr<DatEntry>>& getEntries() const;
void addEntry(std::filesystem::path filename, std::shared_ptr<DatEntry> entry);
};

Expand Down

0 comments on commit 2665332

Please sign in to comment.