11962
|
1 |
"{ Package: 'stx:libbasic' }"
|
|
2 |
|
|
3 |
Object subclass:#AbstractSourceFileWriter
|
|
4 |
instanceVariableNames:''
|
|
5 |
classVariableNames:''
|
|
6 |
poolDictionaries:''
|
|
7 |
category:'Kernel-Classes'
|
|
8 |
!
|
|
9 |
|
|
10 |
!AbstractSourceFileWriter class methodsFor:'documentation'!
|
|
11 |
|
|
12 |
versionSVN
|
|
13 |
|
|
14 |
^'$Id: AbstractSourceFileWriter.st,v 1.1 2009-09-17 14:14:08 fm Exp $'
|
|
15 |
! !
|
|
16 |
|
|
17 |
!AbstractSourceFileWriter methodsFor:'fileout'!
|
|
18 |
|
|
19 |
fileOut:aClass on:outStreamArg
|
|
20 |
|
|
21 |
self
|
|
22 |
fileOut:aClass on:outStreamArg
|
|
23 |
withTimeStamp:true withInitialize:true
|
|
24 |
withDefinition:true
|
|
25 |
methodFilter:nil encoder:nil
|
|
26 |
|
|
27 |
"Created: / 15-08-2009 / 13:11:31 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
28 |
! !
|
|
29 |
|
|
30 |
!AbstractSourceFileWriter methodsFor:'source writing'!
|
|
31 |
|
|
32 |
fileOut: class on:stream withTimeStamp: stampIt withInitialize: initIt withDefinition: withDefinition methodFilter:methodFilter encoder:encoderOrNil
|
|
33 |
"raise an error: must be redefined in concrete subclass(es)"
|
|
34 |
|
|
35 |
^ self subclassResponsibility
|
|
36 |
|
|
37 |
"Modified: / 16-08-2009 / 09:59:49 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
38 |
! !
|
|
39 |
|
|
40 |
!AbstractSourceFileWriter methodsFor:'source writing - comments'!
|
|
41 |
|
|
42 |
fileOutComment: aStringOrStringCollection on: aStream
|
|
43 |
|
|
44 |
"
|
|
45 |
Writes a comment to a stream
|
|
46 |
using proper syntax
|
|
47 |
"
|
|
48 |
self fileOutCommentStartOn: aStream.
|
|
49 |
aStringOrStringCollection isStringCollection
|
|
50 |
ifTrue:
|
|
51 |
[aStringOrStringCollection
|
|
52 |
do:[:line|self fileOutCommentLine: line on: aStream]
|
|
53 |
separatedBy: [aStream cr]]
|
|
54 |
ifFalse:
|
|
55 |
[(aStringOrStringCollection includes: Character cr)
|
|
56 |
ifTrue:"/hmm...multiline comment as string
|
|
57 |
[aStringOrStringCollection asStringCollection
|
|
58 |
do:[:line|self fileOutCommentLine: line on: aStream]
|
|
59 |
separatedBy: [aStream cr]]
|
|
60 |
ifFalse:
|
|
61 |
[self fileOutCommentLine: aStringOrStringCollection on: aStream]].
|
|
62 |
self fileOutCommentEndOn: aStream.
|
|
63 |
|
|
64 |
"Created: / 21-08-2009 / 09:36:03 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
65 |
!
|
|
66 |
|
|
67 |
fileOutCommentEndOn: aStream
|
|
68 |
"
|
|
69 |
Writes a comment end mark on aStream.
|
|
70 |
"
|
|
71 |
|
|
72 |
^self subclassResponsibility
|
|
73 |
|
|
74 |
"Created: / 21-08-2009 / 09:40:42 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
75 |
!
|
|
76 |
|
|
77 |
fileOutCommentLine: aString on: aStream
|
|
78 |
|
|
79 |
"
|
|
80 |
Writes a single line of comment on a comment to a stream.
|
|
81 |
Should not put an cr to the stream!!
|
|
82 |
"
|
|
83 |
|
|
84 |
^self subclassResponsibility
|
|
85 |
|
|
86 |
"Created: / 21-08-2009 / 09:42:23 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
87 |
!
|
|
88 |
|
|
89 |
fileOutCommentStartOn: aStream
|
|
90 |
"
|
|
91 |
Writes a comment start mark on aStream.
|
|
92 |
"
|
|
93 |
|
|
94 |
^self subclassResponsibility
|
|
95 |
|
|
96 |
"Created: / 21-08-2009 / 09:40:28 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
97 |
! !
|
|
98 |
|
|
99 |
!AbstractSourceFileWriter class methodsFor:'documentation'!
|
|
100 |
|
|
101 |
version
|
|
102 |
^ '$Header: /cvs/stx/stx/libbasic/AbstractSourceFileWriter.st,v 1.1 2009-09-17 14:14:08 fm Exp $'
|
|
103 |
! !
|