TextStream.st
author Stefan Vogel <sv@exept.de>
Thu, 08 Nov 2007 15:03:14 +0100
changeset 1908 7d5c6c7d805f
parent 1899 b856899327a9
child 1941 3f0b0b5df9ab
permissions -rw-r--r--
Methods to get all addresses for a given hostname (multihomed hosts)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
340
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     2
 COPYRIGHT (c) 1996 by Claus Gittinger
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
              All Rights Reserved
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
 This software is furnished under a license and may be used
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
 hereby transferred.
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
"
1002
ff7c1f0de146 code now independent of actual zeroPosition
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
    12
"{ Package: 'stx:libbasic2' }"
ff7c1f0de146 code now independent of actual zeroPosition
Claus Gittinger <cg@exept.de>
parents: 873
diff changeset
    13
340
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
WriteStream subclass:#TextStream
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
	instanceVariableNames:'runs currentEmphasis'
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
	classVariableNames:''
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	poolDictionaries:''
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	category:'Streams'
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
!
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
!TextStream class methodsFor:'documentation'!
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
copyright
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
"
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
 COPYRIGHT (c) 1996 by Claus Gittinger
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
              All Rights Reserved
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
 This software is furnished under a license and may be used
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
 only in accordance with the terms of that license and with the
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
 inclusion of the above copyright notice.   This software may not
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
 be provided or otherwise made available to, or used by, any
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
 other person.  No title to or ownership of the software is
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
 hereby transferred.
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
"
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
!
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
documentation
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
"
562
e41abf509444 comments
Claus Gittinger <cg@exept.de>
parents: 343
diff changeset
    40
    a textStream is much like a regular writeStream;
340
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
    however, in addition to collecting characters, it keeps
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
    track of any change of the emphasis, and returns a Text instance
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
    as its contents (in contrast to a String instance).
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
    Can be used to collect up attributed text.
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
    [author:]
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
        Claus Gittinger
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
    [see also:]
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
        WriteStream
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
        Text String
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
"
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
!
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
examples
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
"
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
                                                                [exBegin]
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
     |s|
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
     s := TextStream on:''.
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
     s emphasis:#italic;
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
       nextPutAll:'hello';
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
       emphasis:nil;
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
       space;
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
       emphasis:#bold;
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
       nextPutAll:'world'.
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
     s contents inspect
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
                                                                [exEnd]
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
                                                                [exBegin]
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
     |s|
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
     s := TextStream on:''.
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
     s emphasis:#italic;
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
       nextPutAll:'hello';
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
       emphasis:nil;
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    78
       space;
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    79
       emphasis:#bold;
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
       nextPutAll:'world'.
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
562
e41abf509444 comments
Claus Gittinger <cg@exept.de>
parents: 343
diff changeset
    82
     Transcript nextPutAll:(s contents)
e41abf509444 comments
Claus Gittinger <cg@exept.de>
parents: 343
diff changeset
    83
                                                                [exEnd]
e41abf509444 comments
Claus Gittinger <cg@exept.de>
parents: 343
diff changeset
    84
e41abf509444 comments
Claus Gittinger <cg@exept.de>
parents: 343
diff changeset
    85
                                                                [exBegin]
e41abf509444 comments
Claus Gittinger <cg@exept.de>
parents: 343
diff changeset
    86
     |s|
e41abf509444 comments
Claus Gittinger <cg@exept.de>
parents: 343
diff changeset
    87
e41abf509444 comments
Claus Gittinger <cg@exept.de>
parents: 343
diff changeset
    88
     s := TextStream on:''.
e41abf509444 comments
Claus Gittinger <cg@exept.de>
parents: 343
diff changeset
    89
     s emphasis:#italic;
e41abf509444 comments
Claus Gittinger <cg@exept.de>
parents: 343
diff changeset
    90
       nextPutAll:'hello';
e41abf509444 comments
Claus Gittinger <cg@exept.de>
parents: 343
diff changeset
    91
       emphasis:nil;
e41abf509444 comments
Claus Gittinger <cg@exept.de>
parents: 343
diff changeset
    92
       space;
e41abf509444 comments
Claus Gittinger <cg@exept.de>
parents: 343
diff changeset
    93
       emphasis:#bold;
e41abf509444 comments
Claus Gittinger <cg@exept.de>
parents: 343
diff changeset
    94
       nextPutAll:'world'.
e41abf509444 comments
Claus Gittinger <cg@exept.de>
parents: 343
diff changeset
    95
340
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    96
     Dialog
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    97
        warn:(s contents)
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    98
                                                                [exEnd]
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
                                                                [exBegin]
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
     |s1 s2 flipFlop|
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   102
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   103
     s1 := PipeStream readingFrom:'ls -l'.
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   104
     s2 := TextStream on:''.
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   105
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   106
     flipFlop := true.
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   107
     [s1 atEnd] whileFalse:[
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   108
        flipFlop ifTrue:[
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
            s2 emphasis:(#color->Color red)
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   110
        ] ifFalse:[
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   111
            s2 emphasis:nil
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   112
        ].
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   113
        flipFlop := flipFlop not.
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   114
        s2 nextPutAll:(s1 nextLine).
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   115
        s2 cr.
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   116
     ].
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   117
     s1 close.
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   118
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   119
     (EditTextView new contents:s2 contents) open
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   120
                                                                [exEnd]
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   121
"
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   122
! !
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   123
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   124
!TextStream methodsFor:'accessing'!
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   125
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   126
contents
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   127
    "return the streams collected contents"
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   128
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   129
    self closeRun.
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   130
    ^ Text string:super contents emphasisCollection:runs
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   131
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   132
    "
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   133
     |s|
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   134
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   135
     s := TextStream on:String new.
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   136
     s emphasis:#italic.
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   137
     s nextPutAll:'hello'.
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   138
     s emphasis:nil.
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   139
     s space.
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   140
     s emphasis:#bold.
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   141
     s nextPutAll:'world'.
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   142
     s contents
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   143
    "
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   144
!
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   145
1159
5f674144ea70 emphasis access
Claus Gittinger <cg@exept.de>
parents: 1158
diff changeset
   146
emphasis
5f674144ea70 emphasis access
Claus Gittinger <cg@exept.de>
parents: 1158
diff changeset
   147
    "return the current emphasis"
5f674144ea70 emphasis access
Claus Gittinger <cg@exept.de>
parents: 1158
diff changeset
   148
5f674144ea70 emphasis access
Claus Gittinger <cg@exept.de>
parents: 1158
diff changeset
   149
    ^ currentEmphasis 
5f674144ea70 emphasis access
Claus Gittinger <cg@exept.de>
parents: 1158
diff changeset
   150
!
5f674144ea70 emphasis access
Claus Gittinger <cg@exept.de>
parents: 1158
diff changeset
   151
663
64bf2f5fec3c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 562
diff changeset
   152
emphasis:newEmphasis
343
01f88d90c385 commentary
Claus Gittinger <cg@exept.de>
parents: 340
diff changeset
   153
    "change the emphasis; all followup elements are appended with
01f88d90c385 commentary
Claus Gittinger <cg@exept.de>
parents: 340
diff changeset
   154
     that emphasis in effect"
01f88d90c385 commentary
Claus Gittinger <cg@exept.de>
parents: 340
diff changeset
   155
1158
30a06aebed97 position fixes
Claus Gittinger <cg@exept.de>
parents: 1002
diff changeset
   156
    position ~~ ZeroPosition ifTrue:[
1899
b856899327a9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1159
diff changeset
   157
        currentEmphasis ~= newEmphasis ifTrue:[
663
64bf2f5fec3c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 562
diff changeset
   158
            self closeRun.
64bf2f5fec3c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 562
diff changeset
   159
        ]
340
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   160
    ].
663
64bf2f5fec3c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 562
diff changeset
   161
    currentEmphasis := newEmphasis
340
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   162
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   163
    "
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   164
     |s|
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   165
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   166
     s := TextStream on:String new.
343
01f88d90c385 commentary
Claus Gittinger <cg@exept.de>
parents: 340
diff changeset
   167
     s emphasis:#italic;
01f88d90c385 commentary
Claus Gittinger <cg@exept.de>
parents: 340
diff changeset
   168
       nextPutAll:'hello';
01f88d90c385 commentary
Claus Gittinger <cg@exept.de>
parents: 340
diff changeset
   169
       emphasis:nil;
01f88d90c385 commentary
Claus Gittinger <cg@exept.de>
parents: 340
diff changeset
   170
       space;
01f88d90c385 commentary
Claus Gittinger <cg@exept.de>
parents: 340
diff changeset
   171
       emphasis:#bold;
01f88d90c385 commentary
Claus Gittinger <cg@exept.de>
parents: 340
diff changeset
   172
       nextPutAll:'world'.
1899
b856899327a9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1159
diff changeset
   173
     s contents.
b856899327a9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1159
diff changeset
   174
     Transcript showCr:s contents.
340
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   175
    "
663
64bf2f5fec3c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 562
diff changeset
   176
1899
b856899327a9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1159
diff changeset
   177
    "Modified: / 15-10-2007 / 16:27:31 / cg"
873
2582affa063b added #stringContents (for ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 663
diff changeset
   178
!
2582affa063b added #stringContents (for ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 663
diff changeset
   179
2582affa063b added #stringContents (for ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 663
diff changeset
   180
stringContents
2582affa063b added #stringContents (for ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 663
diff changeset
   181
    "return the streams collected string contents"
2582affa063b added #stringContents (for ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 663
diff changeset
   182
2582affa063b added #stringContents (for ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 663
diff changeset
   183
    ^ super contents
2582affa063b added #stringContents (for ST80 compatibility)
Claus Gittinger <cg@exept.de>
parents: 663
diff changeset
   184
340
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   185
! !
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   186
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   187
!TextStream methodsFor:'private'!
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   188
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   189
closeRun
1158
30a06aebed97 position fixes
Claus Gittinger <cg@exept.de>
parents: 1002
diff changeset
   190
    position ~~ ZeroPosition ifTrue:[
340
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   191
        runs isNil ifTrue:[
1158
30a06aebed97 position fixes
Claus Gittinger <cg@exept.de>
parents: 1002
diff changeset
   192
            runs := RunArray new:position-ZeroPosition withAll:currentEmphasis
340
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   193
        ] ifFalse:[
1158
30a06aebed97 position fixes
Claus Gittinger <cg@exept.de>
parents: 1002
diff changeset
   194
            runs add:currentEmphasis withOccurrences:(position-ZeroPosition-runs size)
340
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   195
        ]
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   196
    ]
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   197
! !
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   198
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   199
!TextStream class methodsFor:'documentation'!
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   200
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   201
version
1899
b856899327a9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1159
diff changeset
   202
    ^ '$Header: /cvs/stx/stx/libbasic2/TextStream.st,v 1.9 2007-10-15 14:26:15 cg Exp $'
340
dcc2bb30c0c9 intitial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   203
! !