► |  | GUI: Racket Graphics Toolkit

1 | Overview
2 | Reference
3 | Configuration
4 | Dynamic Loading
| Bibliography
| Index

► | 2 | Reference

2.1 | Windowing Classes
2.2 | Windowing Functions
2.3 | Drawing Classes
2.4 | Drawing Functions
2.5 | Editor Classes
2.6 | Editor Functions
2.7 | WXME Decoding

▼ | 2.5 | Editor Classes

2.5.1 | add-color<%>
2.5.2 | editor<%>
2.5.3 | editor-admin%
2.5.4 | editor-canvas%
2.5.5 | editor-data%
2.5.6 | editor-data-class%
2.5.7 | editor-data-class-list<%>
2.5.8 | editor-snip-editor-admin<%>
2.5.9 | editor-snip%
2.5.10 | editor-stream-in%
2.5.11 | editor-stream-in-base%
2.5.12 | editor-stream-in-bytes-base%
2.5.13 | editor-stream-out%
2.5.14 | editor-stream-out-base%
2.5.15 | editor-stream-out-bytes-base%
2.5.16 | editor-wordbreak-map%
2.5.17 | image-snip%
2.5.18 | keymap%
2.5.19 | mult-color<%>
2.5.20 | pasteboard%
2.5.21 | readable-snip<%>
2.5.22 | snip%
2.5.23 | snip-admin%
2.5.24 | snip-class%
2.5.25 | snip-class-list<%>
2.5.26 | string-snip%
2.5.27 | style<%>
2.5.28 | style-delta%
2.5.29 | style-list%
2.5.30 | tab-snip%
2.5.31 | text%

On this page:

get
get-bytes
get-exact
get-fixed
get-fixed-exact
get-inexact
get-unterminated-bytes
jump-to
ok?
remove-boundary
set-boundary
skip
tell

top ← prev up next →

editor-stream-in% : class?
superclass: object%

An editor-stream-in% object is used to read editor information from a file or other input stream (such as the clipboard).

( make-object editor-stream-in% base)
→ ( is-a?/c editor-stream-in% )
base : ( is-a?/c editor-stream-in-base% )

An in-stream base – possibly an editor-stream-in-bytes-base% object – must be supplied in base.

( send an-editor-stream-in get v) → ( is-a?/c editor-stream-in% )
v : ( box/c exact-integer? )
( send an-editor-stream-in get v) → ( is-a?/c editor-stream-in% )
v : ( box/c real? )

Reads data from the stream, returning itself. Reading from a bad stream always gives 0.

The v box is filled with the next integer or floating-point value in the stream.

( send an-editor-stream-in get-bytes [len])
→ ( or/c bytes? false/c )
len : ( or/c ( box/c exact-nonnegative-integer? ) false/c ) = #f

Like get-unterminated-bytes, but the last read byte is assumed to be a nul terminator and discarded. Use this method when data is written by a call to put without an explicit byte count, and use get-unterminated-bytes when data is written with an explicit byte count.

The len box is filled with the length of the byte string plus one (to indicate the terminator), unless len is #f.

( send an-editor-stream-in get-exact ) → exact-integer?

Returns the next integer value in the stream.

( send an-editor-stream-in get-fixed v)
→ ( is-a?/c editor-stream-in% )
v : ( box/c exact-integer? )

The v box is filled with a fixed-size integer from the stream obtained through get-fixed-exact.

( send an-editor-stream-in get-fixed-exact ) → exact-integer?

Gets a fixed-sized integer from the stream. See put-fixed for more information. Reading from a bad stream always gives 0.

( send an-editor-stream-in get-inexact ) → real?

Returns the next floating-point value in the stream.

( send an-editor-stream-in get-unterminated-bytes [len])
→ ( or/c bytes? false/c )
len : ( or/c ( box/c exact-nonnegative-integer? ) false/c ) = #f

Returns the next byte string from the stream. This is the recommended way to read bytes back in from a stream; use put with two arguments (passing along the length of the bytes) to write out the bytes to match this method.

Reading from a bad stream returns #f or #"".

Note that when put is not given a byte length, it includes an extra byte for a nul terminator; use get-bytes to read such byte strings.

The len box is filled with the length of the byte string, unless len is #f.

( send an-editor-stream-in jump-to pos) → void?
pos : exact-nonnegative-integer?

Jumps to a given position in the stream.

( send an-editor-stream-in ok? ) → boolean?

Returns #t if the stream is ready for reading, #f otherwise. Reading from a bad stream always returns 0 or "".

( send an-editor-stream-in remove-boundary ) → void?

See set-boundary.

( send an-editor-stream-in set-boundary n) → void?
n : exact-nonnegative-integer?

Sets a file-reading boundary at n bytes past the current stream location. If there is an attempt to read past this boundary, an error is signaled. The boundary is removed with a call to remove-boundary. Every call to set-boundary must be balanced by a call to remove-boundary.

Boundaries help keep a subroutine from reading too much data leading to confusing errors. However, a malicious subroutine can call remove-boundary on its own.

( send an-editor-stream-in skip n) → void?
n : exact-nonnegative-integer?

Skips past the next n bytes in the stream.

( send an-editor-stream-in tell ) → exact-nonnegative-integer?

Returns the current stream position.
top ← prev up next →