summaryrefslogtreecommitdiff
path: root/database.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'database.cpp')
-rw-r--r--database.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/database.cpp b/database.cpp
index ba20e02b..e60e0d92 100644
--- a/database.cpp
+++ b/database.cpp
@@ -390,6 +390,19 @@ int64_t Database::WriteSnapshotData(std::vector<int64_t> parents, Ref<BinaryView
}
+bool Database::StoreDataForSnapshot(int64_t id, const Ref<KeyValueStore>& data, const std::function<bool(size_t, size_t)>& progress)
+{
+ ProgressContext pctxt;
+ pctxt.callback = progress;
+ bool result = BNStoreDataForSnapshot(m_object, id, data->GetObject(), &pctxt, ProgressCallback);
+ if (!result)
+ {
+ throw DatabaseException("BNStoreDataForSnapshot");
+ }
+ return result;
+}
+
+
void Database::TrimSnapshot(int64_t id)
{
if (!BNTrimDatabaseSnapshot(m_object, id))
@@ -518,3 +531,9 @@ void Database::WriteAnalysisCache(Ref<KeyValueStore> val)
throw DatabaseException("BNWriteDatabaseAnalysisCache");
}
}
+
+
+bool Database::SnapshotHasData(int64_t id)
+{
+ return BNSnapshotHasData(m_object, id);
+}