mirror of
https://github.com/Dark98/threeSD.git
synced 2026-07-02 16:49:04 +00:00
Added some features to SeedDB
This commit is contained in:
@@ -45,7 +45,7 @@ bool SeedDB::AddFromFile(const std::string& path) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SeedDB::Save(const std::string& path) {
|
||||
bool SeedDB::Save(const std::string& path) const {
|
||||
if (!FileUtil::CreateFullPath(path)) {
|
||||
LOG_ERROR(Service_FS, "Failed to create seed database");
|
||||
return false;
|
||||
@@ -81,4 +81,8 @@ bool SeedDB::Save(const std::string& path) {
|
||||
return true;
|
||||
}
|
||||
|
||||
std::size_t SeedDB::GetSize() const {
|
||||
return sizeof(u32) + SEEDDB_PADDING_BYTES + seeds.size() * SEEDDB_ENTRY_SIZE;
|
||||
}
|
||||
|
||||
} // namespace Core
|
||||
|
||||
@@ -12,12 +12,14 @@ namespace Core {
|
||||
|
||||
constexpr std::size_t SEEDDB_PADDING_BYTES{12};
|
||||
constexpr std::size_t SEEDDB_ENTRY_PADDING_BYTES{8};
|
||||
constexpr std::size_t SEEDDB_ENTRY_SIZE{32};
|
||||
|
||||
using Seed = std::array<u8, 16>;
|
||||
class SeedDB {
|
||||
public:
|
||||
bool AddFromFile(const std::string& path);
|
||||
bool Save(const std::string& path);
|
||||
bool Save(const std::string& path) const;
|
||||
std::size_t GetSize() const;
|
||||
|
||||
std::unordered_map<u64, Seed> seeds;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user