From 436de21c867786c4be333fa1f5601527c21433de Mon Sep 17 00:00:00 2001 From: Alex Barney Date: Wed, 23 Oct 2019 17:30:08 -0500 Subject: [PATCH] Add ISaveDataIndexer.GetCount --- src/LibHac/FsService/ISaveDataIndexer.cs | 1 + src/LibHac/FsService/SaveDataIndexer.cs | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/src/LibHac/FsService/ISaveDataIndexer.cs b/src/LibHac/FsService/ISaveDataIndexer.cs index 0a314694..6a625756 100644 --- a/src/LibHac/FsService/ISaveDataIndexer.cs +++ b/src/LibHac/FsService/ISaveDataIndexer.cs @@ -15,6 +15,7 @@ namespace LibHac.FsService Result SetState(ulong saveDataId, SaveDataState state); Result GetKey(out SaveDataAttribute key, ulong saveDataId); Result GetBySaveDataId(out SaveDataIndexerValue value, ulong saveDataId); + int GetCount(); Result OpenSaveDataInfoReader(out ISaveDataInfoReader infoReader); } } \ No newline at end of file diff --git a/src/LibHac/FsService/SaveDataIndexer.cs b/src/LibHac/FsService/SaveDataIndexer.cs index 345d09fa..77810790 100644 --- a/src/LibHac/FsService/SaveDataIndexer.cs +++ b/src/LibHac/FsService/SaveDataIndexer.cs @@ -344,6 +344,14 @@ namespace LibHac.FsService } } + public int GetCount() + { + lock (Locker) + { + return KvDatabase.Count; + } + } + public Result OpenSaveDataInfoReader(out ISaveDataInfoReader infoReader) { infoReader = default;