terminals/stx_goodies_xtreams_terminals.st
author mkobetic
Tue, 31 Jan 2012 02:32:37 +0000
changeset 87 f79da7882a40
parent 80 c31b66a25f80
child 103 726bf2ca0b99
permissions -rw-r--r--
(none)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
52
a1363827b596 packaging
mkobetic
parents:
diff changeset
     1
"{ Package: 'stx:goodies/xtreams/terminals' }"
a1363827b596 packaging
mkobetic
parents:
diff changeset
     2
a1363827b596 packaging
mkobetic
parents:
diff changeset
     3
LibraryDefinition subclass:#stx_goodies_xtreams_terminals
a1363827b596 packaging
mkobetic
parents:
diff changeset
     4
	instanceVariableNames:''
a1363827b596 packaging
mkobetic
parents:
diff changeset
     5
	classVariableNames:''
a1363827b596 packaging
mkobetic
parents:
diff changeset
     6
	poolDictionaries:''
a1363827b596 packaging
mkobetic
parents:
diff changeset
     7
	category:'* Projects & Packages *'
a1363827b596 packaging
mkobetic
parents:
diff changeset
     8
!
a1363827b596 packaging
mkobetic
parents:
diff changeset
     9
87
mkobetic
parents: 80
diff changeset
    10
stx_goodies_xtreams_terminals comment:'Terminals are the objects at the bottom of stream stacks. These are the ultimate sources of elements produced by read streams or ultimate consumers of elements written into write streams. This package provides support for various kinds of terminals available in VisualWorks. Eventual ports to other dialects may support different set of terminals although there will likely be significant overlap. However, implementations may have subtle differences as well. For example streams in Squeak/Pharo do not use become: when they grow the underlying collection of a collection stream. Therefore code assuming that identity of a collection stream terminal will be preserved may not be portable.
mkobetic
parents: 80
diff changeset
    11
mkobetic
parents: 80
diff changeset
    12
mkobetic
parents: 80
diff changeset
    13
        == Collections ==
mkobetic
parents: 80
diff changeset
    14
mkobetic
parents: 80
diff changeset
    15
Collections are traditional stream terminals. Read streams are created by sending #reading to a collection.
mkobetic
parents: 80
diff changeset
    16
{{{
mkobetic
parents: 80
diff changeset
    17
        (1 to: 10000) reading ++ 1000; read: 5
mkobetic
parents: 80
diff changeset
    18
}}}
mkobetic
parents: 80
diff changeset
    19
Similarly write streams are created by sending #writing to a collection. The collection is grown automatically to accommodate any elements written. Closing a collection write stream will truncate the collection to the current stream position. This behavior is useful as a replacement for the traditional #contents message. The contents can be accessed with the #terminal message after the stream is closed. The advantage is that the sequence #close and #terminal (or the shortcut #conclusion) can be sent to arbitrary stream stack and behaves consistently.
mkobetic
parents: 80
diff changeset
    20
{{{
mkobetic
parents: 80
diff changeset
    21
        String new writing write: ''Hello World''; -- 6; conclusion
mkobetic
parents: 80
diff changeset
    22
}}}
mkobetic
parents: 80
diff changeset
    23
mkobetic
parents: 80
diff changeset
    24
mkobetic
parents: 80
diff changeset
    25
        == Block Closures ==
mkobetic
parents: 80
diff changeset
    26
mkobetic
parents: 80
diff changeset
    27
Streaming over block closures is proving to be "xtremely" versatile tool, allowing to stream over result sets of arbitrary computations, modelling infinite streams, etc.
mkobetic
parents: 80
diff changeset
    28
{{{
mkobetic
parents: 80
diff changeset
    29
        "inifinite stream of ones"
mkobetic
parents: 80
diff changeset
    30
        [ 1 ] reading read: 20
mkobetic
parents: 80
diff changeset
    31
}}}
mkobetic
parents: 80
diff changeset
    32
{{{
mkobetic
parents: 80
diff changeset
    33
        "Fibonacci"
mkobetic
parents: 80
diff changeset
    34
        | a b | a := 0. b := 1.
mkobetic
parents: 80
diff changeset
    35
        [ | x | x := a. a := b. b := x + a. x ] reading ++ 500; get
mkobetic
parents: 80
diff changeset
    36
}}}
mkobetic
parents: 80
diff changeset
    37
{{{
mkobetic
parents: 80
diff changeset
    38
        "Streaming over ObjectMemory"
mkobetic
parents: 80
diff changeset
    39
        x := ObjectMemory someObject.
mkobetic
parents: 80
diff changeset
    40
        [ x := ObjectMemory nextObjectAfter: x ] reading read: 5
mkobetic
parents: 80
diff changeset
    41
}}}
mkobetic
parents: 80
diff changeset
    42
mkobetic
parents: 80
diff changeset
    43
Single argument blocks can be used as read terminals too, which turn an iterative process in to a stream.
mkobetic
parents: 80
diff changeset
    44
{{{
mkobetic
parents: 80
diff changeset
    45
        "In this example, we have a -hard- loop, not using collection protocol, which will only run one element at a time."
mkobetic
parents: 80
diff changeset
    46
        [:out | 1 to: 10 do: [:i | out put: i]] reading read: 5.
mkobetic
parents: 80
diff changeset
    47
}}}
mkobetic
parents: 80
diff changeset
    48
mkobetic
parents: 80
diff changeset
    49
Single argument blocks can be used as write terminals.
mkobetic
parents: 80
diff changeset
    50
{{{
mkobetic
parents: 80
diff changeset
    51
        "Transcript as an xtream"
mkobetic
parents: 80
diff changeset
    52
        [ :x | Transcript nextPut: x ] writing write: ''Hello World!!''
mkobetic
parents: 80
diff changeset
    53
}}}
mkobetic
parents: 80
diff changeset
    54
{{{
mkobetic
parents: 80
diff changeset
    55
        "/dev/null"
mkobetic
parents: 80
diff changeset
    56
        [ :x | ] writing write: ''Hello World!!''
mkobetic
parents: 80
diff changeset
    57
}}}
mkobetic
parents: 80
diff changeset
    58
Combined with stream transforms like #doing: and #limiting:, a block closure stream can be used to transform arbitrary loop into a stream and the streaming API can provide fine grained control over the execution of the loop body.
mkobetic
parents: 80
diff changeset
    59
mkobetic
parents: 80
diff changeset
    60
mkobetic
parents: 80
diff changeset
    61
        == Files ==
mkobetic
parents: 80
diff changeset
    62
mkobetic
parents: 80
diff changeset
    63
File read streams are created by sending #reading to a Filename. However the actual terminal is an IOAccessor. The original filename is accessible through the IOAccessor.
mkobetic
parents: 80
diff changeset
    64
{{{
mkobetic
parents: 80
diff changeset
    65
        | file |
mkobetic
parents: 80
diff changeset
    66
        file := ObjectMemory imageName asFilename reading.
mkobetic
parents: 80
diff changeset
    67
        [ file read: 13 ] ensure: [ file close ]
mkobetic
parents: 80
diff changeset
    68
}}}
mkobetic
parents: 80
diff changeset
    69
As a convenience, sending #reading to a Filename of a directory will create a stream of all filenames in that directory.
mkobetic
parents: 80
diff changeset
    70
{{{
mkobetic
parents: 80
diff changeset
    71
        ''/tmp'' asFilename reading rest
mkobetic
parents: 80
diff changeset
    72
}}}
mkobetic
parents: 80
diff changeset
    73
File write streams can be created via the usual #writing message or via #appending which opens the file in appending mode. In appending mode, you cannot position the stream before the end of the file contents, so you can never overwrite existing contents. In writing mode, the file will be truncated at stream''s current position when #close is called. To keep the entire contents of the file, use -= 0 to skip to the end before closing. This behavior is different from the classic streams which would erase the contents of the file on open.
mkobetic
parents: 80
diff changeset
    74
{{{
mkobetic
parents: 80
diff changeset
    75
        | file |
mkobetic
parents: 80
diff changeset
    76
        file := ''/dev/shm/xtreams-test'' asFilename.
mkobetic
parents: 80
diff changeset
    77
        [       file writing write: ''Hello''; close.
mkobetic
parents: 80
diff changeset
    78
                file appending write: '' World!!''; close.
mkobetic
parents: 80
diff changeset
    79
                file contentsOfEntireFile.
mkobetic
parents: 80
diff changeset
    80
        ] ensure: [ file delete ]
mkobetic
parents: 80
diff changeset
    81
}}}
mkobetic
parents: 80
diff changeset
    82
It is also possible to send #reading or #writing to a pre-opened IOAcccessor if some other opening mode configuration is desirable. For example to emulate the classic write stream opening behavior, you can use the following:
mkobetic
parents: 80
diff changeset
    83
{{{
mkobetic
parents: 80
diff changeset
    84
        (IOAccessor openFileNamed: ''/dev/shm/xtreams-test'' 
mkobetic
parents: 80
diff changeset
    85
                direction: IOAccessor writeOnly
mkobetic
parents: 80
diff changeset
    86
                creation: IOAccessor truncateOrCreate
mkobetic
parents: 80
diff changeset
    87
        ) writing close
mkobetic
parents: 80
diff changeset
    88
}}}
mkobetic
parents: 80
diff changeset
    89
mkobetic
parents: 80
diff changeset
    90
Bare file streams are always binary. An encoding transform has to be applied to translate bytes into characters, which is discussed in more detail in [Xtreams-Transforms]. However for some types of encoding it is possible to use ByteStrings instead of ByteArrays to get similar effect. E.g reading from a file into a ByteString is like applying ISO8859-1 encoding on the fly. It can also be quite a bit faster than full blown encoding layer. However it does not do line-end translation and only few single-byte encodings are available (see the ByteString hierarchy). Similarly writing into a bare file stream from a ByteString works as if the characters were automatically encoded with ISO-8859-1. This is again without line end translation, so normally you would end up with CRs (code 13) in your file, which these days does not match any OS convention (Unixes and MacOS use LF, and Windows uses CRLFs).
mkobetic
parents: 80
diff changeset
    91
{{{
mkobetic
parents: 80
diff changeset
    92
        | file header |
mkobetic
parents: 80
diff changeset
    93
        file := ObjectMemory imageName asFilename reading.
mkobetic
parents: 80
diff changeset
    94
        header := ByteString new writing.
mkobetic
parents: 80
diff changeset
    95
        [ header write: 20 from: file ] ensure: [ file close ].
mkobetic
parents: 80
diff changeset
    96
        header conclusion
mkobetic
parents: 80
diff changeset
    97
}}}
mkobetic
parents: 80
diff changeset
    98
mkobetic
parents: 80
diff changeset
    99
mkobetic
parents: 80
diff changeset
   100
        == Sockets and Pipes ==
mkobetic
parents: 80
diff changeset
   101
mkobetic
parents: 80
diff changeset
   102
Sockets and Pipes are very similar, both accessed via IOAccessors again. The examples below show how data can be sent through a TCP or pipe connection by setting up a read stream and a write stream on a pair of connected accessors.
mkobetic
parents: 80
diff changeset
   103
{{{
mkobetic
parents: 80
diff changeset
   104
        [ :in :out |
mkobetic
parents: 80
diff changeset
   105
                [       out writing write: ''Hello''; close.
mkobetic
parents: 80
diff changeset
   106
                        in reading read: 5
mkobetic
parents: 80
diff changeset
   107
                ] ensure: [ in close. out close ]
mkobetic
parents: 80
diff changeset
   108
        ] valueWithArguments: SocketAccessor openPair
mkobetic
parents: 80
diff changeset
   109
}}}
mkobetic
parents: 80
diff changeset
   110
{{{
mkobetic
parents: 80
diff changeset
   111
        [ :in :out |
mkobetic
parents: 80
diff changeset
   112
                [       out writing write: ''Hello''; close.
mkobetic
parents: 80
diff changeset
   113
                        in reading read: 5
mkobetic
parents: 80
diff changeset
   114
                ] ensure: [ in close. out close ]
mkobetic
parents: 80
diff changeset
   115
        ] valueWithArguments: OSSystemSupport concreteClass pipeAccessorClass openPair
mkobetic
parents: 80
diff changeset
   116
}}}
mkobetic
parents: 80
diff changeset
   117
Same rules regarding binary vs text reading/writing applies to socket and pipe streams as was discussed with regards to file streams above.
mkobetic
parents: 80
diff changeset
   118
mkobetic
parents: 80
diff changeset
   119
mkobetic
parents: 80
diff changeset
   120
        == Buffers ==
mkobetic
parents: 80
diff changeset
   121
mkobetic
parents: 80
diff changeset
   122
Buffers are used internally by Xtreams, but they could be useful in other circumstances too. There are several kinds and they can be used as both read and write stream terminals at the same time (not concurrently by multiple processes though, process synchronization has to managed explicitly via an external semaphore if necessary). For example writing into ElasticBuffer will grow it as much as necessary, but reading frees the space back up and it is immediately reused for further writes. So with interleaved reads and writes the size of the buffer will only grow to accommodate the maximum size written but not read yet.
mkobetic
parents: 80
diff changeset
   123
{{{
mkobetic
parents: 80
diff changeset
   124
        buffer := ElasticBuffer on: String new.
mkobetic
parents: 80
diff changeset
   125
        bufferIn := buffer writing.
mkobetic
parents: 80
diff changeset
   126
        bufferOut := buffer reading.
mkobetic
parents: 80
diff changeset
   127
        100000 timesRepeat: [ bufferIn write: ''Hello World''. bufferOut read: 11 ].
mkobetic
parents: 80
diff changeset
   128
        buffer cacheSize  
mkobetic
parents: 80
diff changeset
   129
}}}
mkobetic
parents: 80
diff changeset
   130
mkobetic
parents: 80
diff changeset
   131
mkobetic
parents: 80
diff changeset
   132
        == SharedQueues ==
mkobetic
parents: 80
diff changeset
   133
mkobetic
parents: 80
diff changeset
   134
SharedQueues are primarily used for data transfer between processes, their API is rather spartan though. Streams over SharedQueues provide the convenience of full streaming API.
mkobetic
parents: 80
diff changeset
   135
{{{
mkobetic
parents: 80
diff changeset
   136
        queue := SharedQueue new.
mkobetic
parents: 80
diff changeset
   137
        in := queue reading.
mkobetic
parents: 80
diff changeset
   138
        out := queue writing.
mkobetic
parents: 80
diff changeset
   139
        received := Array new writing.
mkobetic
parents: 80
diff changeset
   140
        done := Semaphore new.
mkobetic
parents: 80
diff changeset
   141
        consumer :=     
mkobetic
parents: 80
diff changeset
   142
                [ | size |
mkobetic
parents: 80
diff changeset
   143
                        [       (size := in get) isZero
mkobetic
parents: 80
diff changeset
   144
                        ] whileFalse: [ | word |
mkobetic
parents: 80
diff changeset
   145
                                word := ByteString new: size.
mkobetic
parents: 80
diff changeset
   146
                                in read: size into: word.
mkobetic
parents: 80
diff changeset
   147
                                received put: word ].
mkobetic
parents: 80
diff changeset
   148
                        done signal.
mkobetic
parents: 80
diff changeset
   149
                ] fork.
mkobetic
parents: 80
diff changeset
   150
        #(one two three four) do: [ :word | out put: word size; write: word ].
mkobetic
parents: 80
diff changeset
   151
        out put: 0.
mkobetic
parents: 80
diff changeset
   152
        done wait.
mkobetic
parents: 80
diff changeset
   153
        received conclusion
mkobetic
parents: 80
diff changeset
   154
}}}
mkobetic
parents: 80
diff changeset
   155
mkobetic
parents: 80
diff changeset
   156
mkobetic
parents: 80
diff changeset
   157
        == CPointers ==
mkobetic
parents: 80
diff changeset
   158
mkobetic
parents: 80
diff changeset
   159
The ability to stream over external heap is useful when there''s a need to communicate larger amounts of objects of the same type with an external library. A common use case would be when there''s a need for a buffer that can be shared between Smalltalk and the external library conveniently. The CPointer stream allows to stream over a buffer allocated on the heap seamlessly as if it is a local smalltalk object. The elements of the stream are instances corresponding to the CType associated with the CPointer.
mkobetic
parents: 80
diff changeset
   160
{{{
mkobetic
parents: 80
diff changeset
   161
        | buffer |
mkobetic
parents: 80
diff changeset
   162
        buffer := CIntegerType unsignedChar malloc: 50.
mkobetic
parents: 80
diff changeset
   163
        [       buffer writing
mkobetic
parents: 80
diff changeset
   164
                        length: 50;
mkobetic
parents: 80
diff changeset
   165
                        write: ''Hello World!!''.
mkobetic
parents: 80
diff changeset
   166
                buffer reading
mkobetic
parents: 80
diff changeset
   167
                        length: 12;
mkobetic
parents: 80
diff changeset
   168
                        contentsSpecies: ByteString;
mkobetic
parents: 80
diff changeset
   169
                        rest
mkobetic
parents: 80
diff changeset
   170
        ] ensure: [ buffer free ]
mkobetic
parents: 80
diff changeset
   171
}}}
mkobetic
parents: 80
diff changeset
   172
The write streams behave similarly to collection write streams. They know their length and they will automatically attempt to reallocate and grow their heap space if necessary. Similarly closing the write stream will reallocate and shrink the write stream to its position at that time. It is possible to set length of a read stream as well to avoid running past the allocated memory accidentally. The stream will signal Incomplete when it reaches its end.
mkobetic
parents: 80
diff changeset
   173
'
mkobetic
parents: 80
diff changeset
   174
!
mkobetic
parents: 80
diff changeset
   175
52
a1363827b596 packaging
mkobetic
parents:
diff changeset
   176
!stx_goodies_xtreams_terminals class methodsFor:'documentation'!
a1363827b596 packaging
mkobetic
parents:
diff changeset
   177
a1363827b596 packaging
mkobetic
parents:
diff changeset
   178
extensionsVersion_SVN
80
mkobetic
parents: 78
diff changeset
   179
    ^ '$Id: extensions.st 79 2012-01-30 23:01:24Z mkobetic $'
52
a1363827b596 packaging
mkobetic
parents:
diff changeset
   180
! !
a1363827b596 packaging
mkobetic
parents:
diff changeset
   181
a1363827b596 packaging
mkobetic
parents:
diff changeset
   182
!stx_goodies_xtreams_terminals class methodsFor:'description'!
a1363827b596 packaging
mkobetic
parents:
diff changeset
   183
a1363827b596 packaging
mkobetic
parents:
diff changeset
   184
excludedFromPreRequisites
a1363827b596 packaging
mkobetic
parents:
diff changeset
   185
    "list all packages which should be ignored in the automatic
a1363827b596 packaging
mkobetic
parents:
diff changeset
   186
     preRequisites scan. See #preRequisites for more."
a1363827b596 packaging
mkobetic
parents:
diff changeset
   187
a1363827b596 packaging
mkobetic
parents:
diff changeset
   188
    ^ #(
80
mkobetic
parents: 78
diff changeset
   189
         #'stx:libwidg'    "TextView - superclass of extended TextCollector "
mkobetic
parents: 78
diff changeset
   190
        #'stx:libview'    "DeviceGraphicsContext - superclass of extended View "
mkobetic
parents: 78
diff changeset
   191
   )
52
a1363827b596 packaging
mkobetic
parents:
diff changeset
   192
!
a1363827b596 packaging
mkobetic
parents:
diff changeset
   193
a1363827b596 packaging
mkobetic
parents:
diff changeset
   194
preRequisites
a1363827b596 packaging
mkobetic
parents:
diff changeset
   195
    "list all required packages.
a1363827b596 packaging
mkobetic
parents:
diff changeset
   196
     This list can be maintained manually or (better) generated and
a1363827b596 packaging
mkobetic
parents:
diff changeset
   197
     updated by scanning the superclass hierarchies and looking for
a1363827b596 packaging
mkobetic
parents:
diff changeset
   198
     global variable accesses. (the browser has a menu function for that)
a1363827b596 packaging
mkobetic
parents:
diff changeset
   199
     Howevery, often too much is found, and you may want to explicitely
a1363827b596 packaging
mkobetic
parents:
diff changeset
   200
     exclude individual packages in the #excludedFromPrerequisites method."
a1363827b596 packaging
mkobetic
parents:
diff changeset
   201
a1363827b596 packaging
mkobetic
parents:
diff changeset
   202
    ^ #(
80
mkobetic
parents: 78
diff changeset
   203
        #'stx:goodies/xtreams/core'    "Xtreams::ReadStream - superclass of Xtreams::PointerReadStream "
78
mkobetic
parents: 60
diff changeset
   204
        #'stx:libbasic'    "ExecutableFunction - superclass of extended Block "
52
a1363827b596 packaging
mkobetic
parents:
diff changeset
   205
        #'stx:libbasic2'    "Queue - superclass of extended SharedQueue "
a1363827b596 packaging
mkobetic
parents:
diff changeset
   206
    )
a1363827b596 packaging
mkobetic
parents:
diff changeset
   207
! !
a1363827b596 packaging
mkobetic
parents:
diff changeset
   208
a1363827b596 packaging
mkobetic
parents:
diff changeset
   209
!stx_goodies_xtreams_terminals class methodsFor:'description - contents'!
a1363827b596 packaging
mkobetic
parents:
diff changeset
   210
a1363827b596 packaging
mkobetic
parents:
diff changeset
   211
classNamesAndAttributes
a1363827b596 packaging
mkobetic
parents:
diff changeset
   212
    "lists the classes which are to be included in the project.
a1363827b596 packaging
mkobetic
parents:
diff changeset
   213
     Each entry in the list may be: a single class-name (symbol),
a1363827b596 packaging
mkobetic
parents:
diff changeset
   214
     or an array-literal consisting of class name and attributes.
a1363827b596 packaging
mkobetic
parents:
diff changeset
   215
     Attributes are: #autoload or #<os> where os is one of win32, unix,..."
a1363827b596 packaging
mkobetic
parents:
diff changeset
   216
a1363827b596 packaging
mkobetic
parents:
diff changeset
   217
    ^ #(
a1363827b596 packaging
mkobetic
parents:
diff changeset
   218
        "<className> or (<className> attributes...) in load order"
a1363827b596 packaging
mkobetic
parents:
diff changeset
   219
        #'Xtreams::BlockClosureGenerateStream'
a1363827b596 packaging
mkobetic
parents:
diff changeset
   220
        #'Xtreams::BlockClosureReadStream'
a1363827b596 packaging
mkobetic
parents:
diff changeset
   221
        #'Xtreams::BlockClosureWriteStream'
a1363827b596 packaging
mkobetic
parents:
diff changeset
   222
        #'Xtreams::BufferReadStream'
a1363827b596 packaging
mkobetic
parents:
diff changeset
   223
        #'Xtreams::BufferWriteStream'
a1363827b596 packaging
mkobetic
parents:
diff changeset
   224
        #'Xtreams::BufferedWriteStream'
a1363827b596 packaging
mkobetic
parents:
diff changeset
   225
        #'Xtreams::CollectionWriteStream'
a1363827b596 packaging
mkobetic
parents:
diff changeset
   226
        #'Xtreams::ExternalReadStream'
a1363827b596 packaging
mkobetic
parents:
diff changeset
   227
        #'Xtreams::ExternalWriteStream'
a1363827b596 packaging
mkobetic
parents:
diff changeset
   228
        #'Xtreams::FileWriteStream'
a1363827b596 packaging
mkobetic
parents:
diff changeset
   229
        #'Xtreams::NullWriteStream'
a1363827b596 packaging
mkobetic
parents:
diff changeset
   230
        #'Xtreams::PointerReadStream'
a1363827b596 packaging
mkobetic
parents:
diff changeset
   231
        #'Xtreams::PointerWriteStream'
a1363827b596 packaging
mkobetic
parents:
diff changeset
   232
        #'Xtreams::SequenceableCollectionReadStream'
a1363827b596 packaging
mkobetic
parents:
diff changeset
   233
        #'Xtreams::SequenceableCollectionWriteStream'
a1363827b596 packaging
mkobetic
parents:
diff changeset
   234
        #'Xtreams::SharedQueueReadStream'
a1363827b596 packaging
mkobetic
parents:
diff changeset
   235
        #'Xtreams::SharedQueueWriteStream'
60
0c3108ae4344 manually fixed up package declarations
mkobetic
parents: 52
diff changeset
   236
        #'stx_goodies_xtreams_terminals'
52
a1363827b596 packaging
mkobetic
parents:
diff changeset
   237
        #'Xtreams::FileReadStream'
a1363827b596 packaging
mkobetic
parents:
diff changeset
   238
    )
a1363827b596 packaging
mkobetic
parents:
diff changeset
   239
!
a1363827b596 packaging
mkobetic
parents:
diff changeset
   240
a1363827b596 packaging
mkobetic
parents:
diff changeset
   241
extensionMethodNames
a1363827b596 packaging
mkobetic
parents:
diff changeset
   242
    "lists the extension methods which are to be included in the project.
a1363827b596 packaging
mkobetic
parents:
diff changeset
   243
     Entries are 2-element array literals, consisting of class-name and selector."
a1363827b596 packaging
mkobetic
parents:
diff changeset
   244
a1363827b596 packaging
mkobetic
parents:
diff changeset
   245
    ^ #(
a1363827b596 packaging
mkobetic
parents:
diff changeset
   246
        Block reading
a1363827b596 packaging
mkobetic
parents:
diff changeset
   247
        Block writing
a1363827b596 packaging
mkobetic
parents:
diff changeset
   248
        Collection writing
a1363827b596 packaging
mkobetic
parents:
diff changeset
   249
        Filename appending
a1363827b596 packaging
mkobetic
parents:
diff changeset
   250
        Filename reading
a1363827b596 packaging
mkobetic
parents:
diff changeset
   251
        Filename writing
a1363827b596 packaging
mkobetic
parents:
diff changeset
   252
        Random reading
a1363827b596 packaging
mkobetic
parents:
diff changeset
   253
        SequenceableCollection reading
a1363827b596 packaging
mkobetic
parents:
diff changeset
   254
        SequenceableCollection writing
a1363827b596 packaging
mkobetic
parents:
diff changeset
   255
        SharedQueue reading
a1363827b596 packaging
mkobetic
parents:
diff changeset
   256
        SharedQueue writing
a1363827b596 packaging
mkobetic
parents:
diff changeset
   257
        Socket accepting
a1363827b596 packaging
mkobetic
parents:
diff changeset
   258
        Socket reading
a1363827b596 packaging
mkobetic
parents:
diff changeset
   259
        Socket writing
a1363827b596 packaging
mkobetic
parents:
diff changeset
   260
        UndefinedObject writing
a1363827b596 packaging
mkobetic
parents:
diff changeset
   261
        #'UnixOperatingSystem::FileDescriptorHandle' reading
a1363827b596 packaging
mkobetic
parents:
diff changeset
   262
        #'UnixOperatingSystem::FileDescriptorHandle' writing
a1363827b596 packaging
mkobetic
parents:
diff changeset
   263
        #'Xtreams::Buffer' reading
a1363827b596 packaging
mkobetic
parents:
diff changeset
   264
        #'Xtreams::Buffer' writing
a1363827b596 packaging
mkobetic
parents:
diff changeset
   265
        #'Xtreams::WriteStream' buffering:
78
mkobetic
parents: 60
diff changeset
   266
        PipeStream isActive
mkobetic
parents: 60
diff changeset
   267
        PipeStream reading
mkobetic
parents: 60
diff changeset
   268
        PipeStream writing
mkobetic
parents: 60
diff changeset
   269
        TextCollector writing
52
a1363827b596 packaging
mkobetic
parents:
diff changeset
   270
    )
a1363827b596 packaging
mkobetic
parents:
diff changeset
   271
! !
a1363827b596 packaging
mkobetic
parents:
diff changeset
   272
a1363827b596 packaging
mkobetic
parents:
diff changeset
   273
!stx_goodies_xtreams_terminals class methodsFor:'description - project information'!
a1363827b596 packaging
mkobetic
parents:
diff changeset
   274
a1363827b596 packaging
mkobetic
parents:
diff changeset
   275
applicationIconFileName
a1363827b596 packaging
mkobetic
parents:
diff changeset
   276
    "Return the name (without suffix) of an icon-file (the app's icon); will be included in the rc-resource file"
a1363827b596 packaging
mkobetic
parents:
diff changeset
   277
a1363827b596 packaging
mkobetic
parents:
diff changeset
   278
    ^ nil
a1363827b596 packaging
mkobetic
parents:
diff changeset
   279
    "/ ^ self applicationName
a1363827b596 packaging
mkobetic
parents:
diff changeset
   280
!
a1363827b596 packaging
mkobetic
parents:
diff changeset
   281
a1363827b596 packaging
mkobetic
parents:
diff changeset
   282
companyName
a1363827b596 packaging
mkobetic
parents:
diff changeset
   283
    "Return a companyname which will appear in <lib>.rc"
a1363827b596 packaging
mkobetic
parents:
diff changeset
   284
a1363827b596 packaging
mkobetic
parents:
diff changeset
   285
    ^ 'eXept Software AG'
a1363827b596 packaging
mkobetic
parents:
diff changeset
   286
!
a1363827b596 packaging
mkobetic
parents:
diff changeset
   287
a1363827b596 packaging
mkobetic
parents:
diff changeset
   288
description
a1363827b596 packaging
mkobetic
parents:
diff changeset
   289
    "Return a description string which will appear in vc.def / bc.def"
a1363827b596 packaging
mkobetic
parents:
diff changeset
   290
a1363827b596 packaging
mkobetic
parents:
diff changeset
   291
    ^ 'Smalltalk/X Class library'
a1363827b596 packaging
mkobetic
parents:
diff changeset
   292
!
a1363827b596 packaging
mkobetic
parents:
diff changeset
   293
a1363827b596 packaging
mkobetic
parents:
diff changeset
   294
legalCopyright
a1363827b596 packaging
mkobetic
parents:
diff changeset
   295
    "Return a copyright string which will appear in <lib>.rc"
a1363827b596 packaging
mkobetic
parents:
diff changeset
   296
a1363827b596 packaging
mkobetic
parents:
diff changeset
   297
    ^ 'Copyright Claus Gittinger 1988-2011\nCopyright eXept Software AG 1998-2011'
a1363827b596 packaging
mkobetic
parents:
diff changeset
   298
!
a1363827b596 packaging
mkobetic
parents:
diff changeset
   299
78
mkobetic
parents: 60
diff changeset
   300
productInstallDirBaseName
mkobetic
parents: 60
diff changeset
   301
    "Returns a default installDir which will appear in <app>.nsi.
mkobetic
parents: 60
diff changeset
   302
     This is usually not the one you want to keep"
mkobetic
parents: 60
diff changeset
   303
mkobetic
parents: 60
diff changeset
   304
    ^ (self package asCollectionOfSubstringsSeparatedByAny:':/') last
mkobetic
parents: 60
diff changeset
   305
!
mkobetic
parents: 60
diff changeset
   306
52
a1363827b596 packaging
mkobetic
parents:
diff changeset
   307
productName
a1363827b596 packaging
mkobetic
parents:
diff changeset
   308
    "Return a product name which will appear in <lib>.rc"
a1363827b596 packaging
mkobetic
parents:
diff changeset
   309
a1363827b596 packaging
mkobetic
parents:
diff changeset
   310
    ^ 'Smalltalk/X'
a1363827b596 packaging
mkobetic
parents:
diff changeset
   311
! !
a1363827b596 packaging
mkobetic
parents:
diff changeset
   312
a1363827b596 packaging
mkobetic
parents:
diff changeset
   313
!stx_goodies_xtreams_terminals class methodsFor:'description - svn'!
a1363827b596 packaging
mkobetic
parents:
diff changeset
   314
a1363827b596 packaging
mkobetic
parents:
diff changeset
   315
svnRepositoryUrlString
a1363827b596 packaging
mkobetic
parents:
diff changeset
   316
    "Return a SVN repository URL of myself.
a1363827b596 packaging
mkobetic
parents:
diff changeset
   317
     (Generated since 2011-04-08)
a1363827b596 packaging
mkobetic
parents:
diff changeset
   318
    "        
a1363827b596 packaging
mkobetic
parents:
diff changeset
   319
a1363827b596 packaging
mkobetic
parents:
diff changeset
   320
    ^ '$URL: https://swing.fit.cvut.cz/svn/stx/goodies/xtreams/trunk/terminals/stx_goodies_xtreams_terminals.st $'
a1363827b596 packaging
mkobetic
parents:
diff changeset
   321
!
a1363827b596 packaging
mkobetic
parents:
diff changeset
   322
a1363827b596 packaging
mkobetic
parents:
diff changeset
   323
svnRevisionNr
a1363827b596 packaging
mkobetic
parents:
diff changeset
   324
    "Return a SVN revision number of myself.
a1363827b596 packaging
mkobetic
parents:
diff changeset
   325
     This number is updated after a commit"
a1363827b596 packaging
mkobetic
parents:
diff changeset
   326
87
mkobetic
parents: 80
diff changeset
   327
    ^ "$SVN-Revision:"'81'"$"
52
a1363827b596 packaging
mkobetic
parents:
diff changeset
   328
! !
a1363827b596 packaging
mkobetic
parents:
diff changeset
   329
a1363827b596 packaging
mkobetic
parents:
diff changeset
   330
!stx_goodies_xtreams_terminals class methodsFor:'documentation'!
a1363827b596 packaging
mkobetic
parents:
diff changeset
   331
a1363827b596 packaging
mkobetic
parents:
diff changeset
   332
version_SVN
a1363827b596 packaging
mkobetic
parents:
diff changeset
   333
    ^ '$Id: stx_goodies_xtreams_terminals.st 17 2011-11-21 06:03:03Z mkobetic $'
a1363827b596 packaging
mkobetic
parents:
diff changeset
   334
! !