Handbook
Glossary
sbuf
Factor handbook
»
The language
»
Collections
»
String buffers
Next:
sbuf? ( object -- ? )
Vocabulary
sbufs
Class description
The class of resizable character strings. See
String buffer syntax
for syntax and
String buffers
for general information.
Definition
USING:
sequences.private
strings
;
IN:
sbufs
TUPLE:
sbuf
{
underlying
string
initial:
""
}
{
length
array-capacity
initial:
0
}
;
Methods
USING:
growable
kernel
sbufs
;
M:
sbuf
contract
2drop
;
inline
USING:
kernel
sbufs
sequences
;
M:
sbuf
equal?
over
sbuf?
[
sequence=
]
[
2drop
f
]
if
;
USING:
kernel
sbufs
sequences
strings
;
M:
sbuf
like
drop
dup
sbuf?
[
dup
string?
[
dup
length
sbuf
boa
]
[
>sbuf
]
if
]
unless
;
inline
USING:
kernel
sbufs
sequences
;
M:
sbuf
new-resizable
drop
<sbuf>
;
inline
USING:
kernel
math
sbufs
sequences
strings
;
M:
sbuf
new-sequence
drop
[
0
<string>
]
[
integer>fixnum
]
bi
sbuf
boa
;
inline
USING:
kernel
prettyprint.backend
prettyprint.custom
sbufs
;
M:
sbuf
pprint*
dup
"SBUF\" "
"\""
pprint-string
;
USING:
accessors
kernel
math
sbufs
sequences.private
strings.private
;
M:
sbuf
set-nth-unsafe
[
integer>fixnum
]
[
integer>fixnum
]
[
underlying>>
]
tri*
set-string-nth
;
inline
USING:
sbufs
sequences
splitting
;
M:
sbuf
split-lines
""
like
split-lines
;
USING:
io
kernel
sbufs
;
M:
sbuf
stream-element-type
drop
+character+
;
inline
USING:
io
sbufs
sequences
;
M:
sbuf
stream-tell
length
;
inline