AbstractSourceFileWriter.st
branchjv
changeset 17729 4187f74d2df8
parent 17727 3945dfe4659c
child 17732 a1892eeca6c0
--- a/AbstractSourceFileWriter.st	Wed Aug 19 17:14:36 2009 +0100
+++ b/AbstractSourceFileWriter.st	Sat Aug 22 09:34:50 2009 +0100
@@ -8,6 +8,19 @@
 !
 
 
+!AbstractSourceFileWriter methodsFor:'fileout'!
+
+fileOut:aClass on:outStreamArg 
+
+    self 
+        fileOut:aClass on:outStreamArg 
+        withTimeStamp:true withInitialize:true 
+        withDefinition:true 
+        methodFilter:nil encoder:nil
+
+    "Created: / 15-08-2009 / 13:11:31 / Jan Vrany <vranyj1@fel.cvut.cz>"
+! !
+
 !AbstractSourceFileWriter methodsFor:'source writing'!
 
 fileOut: class on:stream withTimeStamp: stampIt withInitialize: initIt withDefinition: withDefinition methodFilter:methodFilter encoder:encoderOrNil
@@ -18,9 +31,68 @@
     "Modified: / 16-08-2009 / 09:59:49 / Jan Vrany <vranyj1@fel.cvut.cz>"
 ! !
 
+!AbstractSourceFileWriter methodsFor:'source writing - comments'!
+
+fileOutComment: aStringOrStringCollection on: aStream
+
+    "
+        Writes a comment to a stream
+        using proper syntax
+    "
+    self fileOutCommentStartOn: aStream.
+    aStringOrStringCollection isStringCollection
+        ifTrue:
+            [aStringOrStringCollection 
+                do:[:line|self fileOutCommentLine: line on: aStream]
+                separatedBy: [aStream cr]]
+        ifFalse:
+            [(aStringOrStringCollection includes: Character cr)
+                ifTrue:"/hmm...multiline comment as string
+                    [aStringOrStringCollection asStringCollection
+                        do:[:line|self fileOutCommentLine: line on: aStream]
+                        separatedBy: [aStream cr]]
+                ifFalse:
+                    [self fileOutCommentLine: aStringOrStringCollection on: aStream]].
+    self fileOutCommentEndOn: aStream.
+
+    "Created: / 21-08-2009 / 09:36:03 / Jan Vrany <vranyj1@fel.cvut.cz>"
+!
+
+fileOutCommentEndOn: aStream
+    "
+        Writes a comment end mark on aStream.
+    "
+
+    ^self subclassResponsibility
+
+    "Created: / 21-08-2009 / 09:40:42 / Jan Vrany <vranyj1@fel.cvut.cz>"
+!
+
+fileOutCommentLine: aString on: aStream
+
+    "
+        Writes a single line of comment on a comment to a stream.
+        Should not put an cr to the stream!!
+    "
+
+    ^self subclassResponsibility
+
+    "Created: / 21-08-2009 / 09:42:23 / Jan Vrany <vranyj1@fel.cvut.cz>"
+!
+
+fileOutCommentStartOn: aStream
+    "
+        Writes a comment start mark on aStream.
+    "
+
+    ^self subclassResponsibility
+
+    "Created: / 21-08-2009 / 09:40:28 / Jan Vrany <vranyj1@fel.cvut.cz>"
+! !
+
 !AbstractSourceFileWriter class methodsFor:'documentation'!
 
 version
 
-    ^'$Id: AbstractSourceFileWriter.st 10465 2009-08-16 17:14:23Z vranyj1 $'
+    ^'$Id: AbstractSourceFileWriter.st 10468 2009-08-22 08:34:50Z vranyj1 $'
 ! !