[ion] Storage: add a method destroyAllRecords

This commit is contained in:
Émilie Feral
2018-11-22 09:57:20 +01:00
parent 4459945fe9
commit 0a9437e8dc
2 changed files with 6 additions and 0 deletions

View File

@@ -98,6 +98,7 @@ public:
Record recordBaseNamedWithExtensions(const char * baseName, const char * extension[], size_t numberOfExtensions);
// Record destruction
void destroyAllRecords();
void destroyRecordWithBaseNameAndExtension(const char * baseName, const char * extension);
void destroyRecordsWithExtension(const char * extension);

View File

@@ -214,6 +214,11 @@ Storage::Record Storage::recordBaseNamedWithExtensions(const char * baseName, co
return Record();
}
void Storage::destroyAllRecords() {
overrideSizeAtPosition(m_buffer, 0);
notifyChangeToDelegate();
}
void Storage::destroyRecordWithBaseNameAndExtension(const char * baseName, const char * extension) {
recordBaseNamedWithExtension(baseName, extension).destroy();
}