PharoView this PageEdit this PageUploads to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide)

String/InMemory FileIn and FileOut for Tonel


Reading


store := FileSystem memory root.
(store / 'Somewhere') ensureCreateDirectory.
(store / 'Somewhere' / 'Something.class.st')
ensureDelete;
writeStreamDo: [ :stream | stream 'Class {
#name : #Something,
#superclass : #Object,
#category : #Somewhere
}

{ #category : #initialization }
Something >> initialize [
super initialize
]' ].


reader := TonelReader on: store fileName: 'Somewhere'.
reader snapshot install.


or (which would be simpler):


(MCSnapshot fromDefinitions: (TonelParser parseStream: 'Class {
#name : #Something,
#superclass : #Object,
#category : #Somewhere
}

{ #category : #initialization }
Something >> initialize [
super initialize
]' readStream)) install


Writing


store := FileSystem memory root.
TonelWriter fileOut: 'SomeMorph' asPackage mcWorkingCopy on: store.

-----------

Link to this Page