![]() |
Section 8.2.3.1: |
![]() |
The type definitions in this class specification fall into two groups :-
NOTE | The auxiliary type Array_of_Octet is not the same as the class being specified here - it is a subtype of the generic vdm class Array_of_Elt (which is a 'seq of @elem') which is defined in the generic class ARRAY{ELT}. |
This class shall provide immutable semantics for binary (octet) string manipulations. See also the class FBINSTR.
The following feature is required to be implemented for this class in accordance with the specification given in $IS_EQ of which $STRING{OCTET,FBINSTR,BINSTR} is a sub-type :-
The following feature is required to be implemented for this class in accordance with the specification given in $IS_LT :-
The following features are required to be implemented for this class in accordance with the specification given in $ELT of which $STRING{OCTET,FBINSTR,BINSTR} is a sub-type :-
The following feature is required to be implemented for this class in accordance with the specification given in $ELT{OCTET} of which $STRING{OCTET,FBINSTR,BINSTR} is a sub-type :-
The following feature is required to be implemented for this class in accordance with the specification given in $HASH of which $STRING{OCTET,FBINSTR,BINSTR} is a sub-type :-
The following features are required to be implemented for this class in accordance with the specifications given by inheritance in $STR of which $STRING{} is a sub-type :-
The following features are required to be implemented for this class in accordance with the specifications given by inheritance in $STRINGS of which $STRING{OCTET,FBINSTR,BINSTR} is a sub-type :-
The following features are required to be implemented for this class in accordance with the specifications given by inheritance in $STRING{OCTET,FBINSTR,BINSTR} :-
This first creation routine returns an empty string.
create | : SAME |
Since this is a creation routine the pre-condition is vacuously true.
This creation routine returns an empty binary string.
This version of the creation routine returns a string of the given size all the elements of which are null.
The name of this routine has been modified from the Sather name, since there is no name overloading in vdm.
Since this is a creation routine the pre-condition is vacuously true.
This creation routine returns a binary string of the given size, all of the elements of which are null.
This version of the creation routine returns a string of size one containing the single element oct.
The name of this routine has been modified from the Sather name, since there is no name overloading in vdm.
Since this is a creation routine the pre-condition is vacuously true.
This creation routine returns a binary string of length one containing only the element oct.
This final version of creation returns a string of the same size as the argument, filled with its contents.
create | ( |
array : ARRAY{OCTET} | |
) : SAME |
The name of this routine has been modified from the Sather name, since there is no name overloading in vdm.
Since this is a creation routine the pre-condition is vacuously true.
This creation routine creates a binary string which has the same length as the size of the array argument and has the contents of that array in sequential order of increasing index number.
This is a fourth variant of the plus operation for an object of this class. It is provided as a convenience when manipulating individual HEXET objects. The object returned is the value of self with the argument appended.
The name of this routine has been modified from the Sather name, since there is no name overloading in vdm.
This routine returns a new string consisting of the contents of self with the value of hex appended to it.
This feature is provided to pad out the binary string to some specified size with null octets, provided that length is greater than the size of self.
This routine returns a new object the contents of which is that of self padded with null octets up to the given length unless self is equal or greater to the length specified when self is returned.
This feature is provided so that scanning of the buffer may be undertaken - a common activity when 'parsing' input data of some kind.
Since the element types are identical and the domain of the argument is of the same size as that of the result, the pre-condition is vacuously true.
This routine returns a new cursor object, the buffer of which contains the contents of self and the cursor index is set to 0.
This routine creates a new 'fast' binary string which has mutable semantics - and is provided for use when speed of execution is important.
Since the domain of self and the range of the result are the same, the pre-condition is vacuously true.
This routine creates and returns a mutable version of self with the same contents as self and the next insertion location pointer set to a value equal to the size of self.
This routine is included for the common case where a relatively short binary string is to be placed in a stream of octets (eg in a file) in order that subsequent retrieval will be able to determine the length of the string when 'reading' (see also the get_sized feature of the BIN_CURSOR class). It returns a copy of self preceded by a length octet.
sized | : SAME |
This routine returns a binary string with the contents of self preceded by an octet with the bit-pattern equivalent to the number which is the count of octets in self.
This routine produces a textual representation, using the given repertoire and encoding, of the contents of self as a space separated list of hexadecimal numbers representing each octet in the string. There is neither prefix nor suffix of any kind.
Since the result range is at least the size of the domain of self then the pre-condition is vacuously true.
This routine returns a text string representation of the contents of self as a sequence of space separated hexadecimal octet representations, using the given repertoire and encoding.
This second version of this routine produces, using the default encoding and repertoire, a textual representation of the contents of self as a space separated list of hexadecimal numbers representing each octet in the string. There is neither prefix nor suffix of any kind.
The name of this routine has been modified from the Sather name, since there is no name overloading in vdm.
Since the result range is at least the size of the domain of self then the pre-condition is vacuously true.
This routine returns a text string representation of the contents of self as a sequence of space separated hexadecimal octet representations, using the default repertoire and encoding.
![]() |
Language Index | ![]() |
Library Index | ![]() |
Binary Index |
Comments or enquiries should be made to
Keith
Hopper. Page last modified: Wednesday, 22 November 2000. |
![]() |