Factoring serialization to external files.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2019-04-22 20:15:48 +00:00
parent 85a4cbec24
commit 169fd2246e
1 changed files with 9 additions and 1 deletions

View File

@ -60,7 +60,15 @@ GrafoscopioUtils class >> ensureCreateDirectory: fileNameWithRelativePath into:
{ #category : #persistence }
GrafoscopioUtils class >> exportAsSton: anObject on: aFileReference [
"comment stating purpose of message"
aFileReference exists ifTrue: [ aFileReference ensureDelete ].
aFileReference ensureCreateFile.
aFileReference writeStreamDo: [ :stream |
(STON writer on: stream)
newLine: String crlf;
prettyPrint: true;
keepNewLines: true;
nextPut: anObject ].
]