# Section 8.2.3.2:
FBINSTR

###### class FBINSTR < $FSTRING{OCTET,BINSTR,FBINSTR}, $STR

#### Formal Definitions

An implementation shall define the minimum buffer size to be substituted for undefined in the following value definition.

values
Min_Size = undefined ;
types
SAME = FBINSTR ;
FBINSTR = seq of OCTET

This class shall implement a fast mutable version of an octet string. Buffers shall be modifiable and shall be extended in an efficient manner.

#### External specifications

The following feature is required to be implemented for this class in accordance with the specification given in $IS_EQ of which $FSTRING{OCTET,BINSTR,FBINSTR} is a sub-type :-

- is_eq(other : SAME) : BOOL

The following features are required to be implemented for this class in accordance with the specification given in $ELT of which $FSTRING{OCTET,BINSTR,FBINSTR} is a sub-type :-

- size : CARD
- elt! : $OB

The following feature is required to be implemented for this class in accordance with the specification given in $ELT{OCTET} of which $FSTRING{OCTET,BINSTR,FBINSTR} is a sub-type :-

- elt! : OCTET

The following feature is required to be implemented for this class in accordance with the specification given in $HASH of which $FSTRING{OCTET,BINSTR,FBINSTR} is a sub-type :-

- hash : CARD

The following features are required to be implemented for this class in accordance with the specifications given by inheritance in $STR :-

- str(lib : LIBCHARS) : STR
- str : STR

The following features are required to be implemented for this class in accordance with the specifications given in $BINARY of which $FSTRING{OCTET,BINSTR,FBINSTR} is a sub-type :-

- create(storage : BINSTR) : SAME
- build(cursor : BIN_CURSOR) : SAME
- read(cursor : BIN_CURSOR) : SAME
- binstr : BINSTR
- write(fyle : BIN_FILE)

The following features are required to be implemented for this class in accordance with the specifications given by inheritance in $FSTRINGS of which $FSTRING{OCTET,BINSTR,FBINSTR} is a sub-type :-

- array_ptr : REFERENCE
- head(cnt : CARD) : SAME
- tail(cnt : CARD) : SAME
- substring(start : CARD, cnt : CARD) : SAME
- loc : CARD
- loc(val : CARD)

The following features are required to be implemented for this class in accordance with the specifications given by inheritance in $FSTRING{OCTET,BINSTR,FBINSTR} :-

- acopy(src : SAME)
- acopy(src : BINSTR)
- acopy(start : CARD, src : SAME)
- acopy(start : CARD, src : BINSTR)
- acopyn(src : SAME, count : CARD)
- acopyn(src : BINSTR, count : CARD)
- index_of(val : OCTET) : CARD
- push(elem : OCTET) : SAME
- plus(elem : OCTET) : SAME
- plus(str : SAME) : SAME
- plus(str : BINSTR) : SAME
- clear
- elt! : OCTET
- ind! : CARD

#### create

This first creation routine returns an implementation-defined default buffer.

create | : SAME

##### Formal Signature

create() res : SAME

##### Pre-condition

Since this feature is a creation routine, the pre-condition is vacuously true.

##### Post-condition

post len res = Min_Size

This creation routine returns a new buffer of an implementation-defined minimum size.

#### create

This feature creates a buffer of the given size (which must be greater than zero), but it is implementation defined whether the resulting buffer is at least Min_Size!

create | (
| size : CARD
| ) : SAME

##### Formal Signature

create2(size : CARD) res : SAME

##### Pre-condition

pre size > 0

##### Post-condition

post len res > 0

This creation routine returns a new buffer of the given size. It is implementation-defined whether this may be shorter than Min_Size.

#### text_str

This feature provides an implementation defined text string representation of the buffer contents using the given culture definition. Note that this is not necessarily the same as the str feature which produces a text string of characters the bit-pattern of which is identical to that in the buffer. It could, for example be some form of hexadecimal character string.

text_str | (
| lib : LIBCHARS
| ) : STR

##### Formal Signature

text_str(self : SAME, lib : LIBCHARS) res : STR

##### Pre-condition

pre len self > 0

##### Post-condition

post

This routine returns an implementation-defined default textual representation of the contents of self using the given encoding and repertoire. An implementation is required to define the algorithm used for obtaining the string.

#### text_str

This feature provides an implementation defined text string representation of the buffer contents using the given culture definition. Note that this is not necessarily the same as the str feature which produces a text string of characters the bit-pattern of which is identical to that in the buffer. It could, for example be some form of hexadecimal character string.

text_str | : STR

##### Formal Signature

text_str(self : SAME) res : STR

##### Pre-condition

pre len self > 0

##### Post-condition

post

This routine returns an implementation-defined default textual representation of the contents of self using the default encoding and repertoire in the execution environment. An implementation is required to define the algorithm used for obtaining the string.

| Language Index |  | Library Index |  | Binary Index

Comments or enquiries should be made to Keith Hopper. Page last modified: Wednesday, 22 November 2000. |