diff --git a/ion/include/ion/storage.h b/ion/include/ion/storage.h index c118fe123..80ba0f2a9 100644 --- a/ion/include/ion/storage.h +++ b/ion/include/ion/storage.h @@ -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); diff --git a/ion/src/shared/storage.cpp b/ion/src/shared/storage.cpp index c40e42184..57bbf98e3 100644 --- a/ion/src/shared/storage.cpp +++ b/ion/src/shared/storage.cpp @@ -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(); }