2.5.13 editor-stream-out%

► |  | 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:

jump-to
ok?
pretty-finish
pretty-start
put
put-fixed
put-unterminated
tell

top← prev up next →

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

An editor-stream-out% object is used to write editor information to a file or other output stream (such as the clipboard).

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

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

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

Jumps to a given position in the stream.

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

Returns #t if the stream is ready for writing, #f otherwise. Writing to a bad stream has no effect.

( send an-editor-stream-out pretty-finish) → void?

Ensures that the stream ends with a newline. This method is called by write-editor-global-footer.

( send an-editor-stream-out pretty-start) → void?

Writes a “comment” into the stream that identifies the file format. This method is called by write-editor-global-header.

( send an-editor-stream-out put n v)
→ ( is-a?/c editor-stream-out%)
n : exact-nonnegative-integer?
v : bytes?
( send an-editor-stream-out put v)
→ ( is-a?/c editor-stream-out%)
v : bytes?
( send an-editor-stream-out put v)
→ ( is-a?/c editor-stream-out%)
v : exact-integer?
( send an-editor-stream-out put v)
→ ( is-a?/c editor-stream-out%)
v : real?

Writes v, or n bytes of v.

When n is supplied with a byte-string v, use get-unterminated-bytes to read the bytes later. This is the recommended way to write out bytes to be easily read in later; use get-unterminated-bytes to read the bytes back in.

If n is not supplied and v is a byte string, then for historical reasons, the actual number of bytes written includes a #\nul terminator, so use get-bytes instead of get-unterminated-bytes to read the bytes later.

( send an-editor-stream-out put-fixed v)
→ ( is-a?/c editor-stream-out%)
v : exact-integer?

Puts a fixed-sized integer into the stream. This method is needed because numbers are usually written in a way that takes varying numbers of bytes. In some cases it is useful to temporary write a 0 to a stream, write more data, and then go back and change the 0 to another number; such a process requires a fixed-size number.

Numbers written to a stream with put-fixed must be read with get-fixed-exact or get-fixed.

( send an-editor-stream-out put-unterminated v)
→ ( is-a?/c editor-stream-out%)
v : bytes?

The same as calling put with ( bytes-length v) and v.

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

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