diff --git a/src/Soil-Core/SoilJournalFragmentFile.class.st b/src/Soil-Core/SoilJournalFragmentFile.class.st index df39acbe..623906f2 100644 --- a/src/Soil-Core/SoilJournalFragmentFile.class.st +++ b/src/Soil-Core/SoilJournalFragmentFile.class.st @@ -72,6 +72,12 @@ SoilJournalFragmentFile >> dataPosition [ ^ self createdPosition + self createdSize ] +{ #category : #searching } +SoilJournalFragmentFile >> entriesMatching: aBlock [ + ^ self transactionJournals flatCollect: [ :journal | + journal entriesMatching: aBlock ] +] + { #category : #accessing } SoilJournalFragmentFile >> filename [ ^ self path basename diff --git a/src/Soil-Core/SoilPersistentDatabaseJournal.class.st b/src/Soil-Core/SoilPersistentDatabaseJournal.class.st index bedeaac0..0f4f1116 100644 --- a/src/Soil-Core/SoilPersistentDatabaseJournal.class.st +++ b/src/Soil-Core/SoilPersistentDatabaseJournal.class.st @@ -66,6 +66,12 @@ SoilPersistentDatabaseJournal >> do: aBlock [ transactionJournals do: aBlock ] ] +{ #category : #searching } +SoilPersistentDatabaseJournal >> entriesMatching: aBlock [ + ^ self fragmentFiles flatCollect: [ :file | + file entriesMatching: aBlock ] +] + { #category : #'as yet unclassified' } SoilPersistentDatabaseJournal >> fileNumberFrom: aString [ ^ (ByteArray readHexFrom: aString) asInteger diff --git a/src/Soil-Core/SoilTransactionJournal.class.st b/src/Soil-Core/SoilTransactionJournal.class.st index 73c71d3a..ad82b068 100644 --- a/src/Soil-Core/SoilTransactionJournal.class.st +++ b/src/Soil-Core/SoilTransactionJournal.class.st @@ -94,6 +94,11 @@ SoilTransactionJournal >> entries: aCollection [ entries := aCollection ] +{ #category : #searching } +SoilTransactionJournal >> entriesMatching: aBlock [ + ^ entries select: aBlock +] + { #category : #accessing } SoilTransactionJournal >> entryAt: anInteger [ ^ entries at: anInteger diff --git a/src/Soil-Core/SoilTransactionalVisitor.class.st b/src/Soil-Core/SoilTransactionalVisitor.class.st index c3f5c716..3c69ee18 100644 --- a/src/Soil-Core/SoilTransactionalVisitor.class.st +++ b/src/Soil-Core/SoilTransactionalVisitor.class.st @@ -7,6 +7,14 @@ Class { #category : #'Soil-Core-Model' } +{ #category : #visiting } +SoilTransactionalVisitor >> scan: aSoil [ + soil := aSoil. + transaction := soil newTransaction. + [ self visit: aSoil ] + ensure: [ transaction abort ] +] + { #category : #accessing } SoilTransactionalVisitor >> transaction [