Next: , Previous: , Up: The Byte Data Library   [Index]


13.10.2 Byte Data Functions

Comparison functions are case sensitive where not specified otherwise.

b_alpha

integer b_alpha(data b, integer x);

is the base x integral interpretation of d. d is expected some sequence of base x digit characters, possibly prefixed by a mix of white spaces and sign characters (i.e. minuses and pluses). In bases above 10, the letter ‘a’ in either upper or lower cases represents 10, ‘b’ represents 11, and so forth, with ‘z’ representing 35. x is expected between 2 and 36 inclusive. Or zero, in which case the base is assumed 16 if the digits sequence is immediately prefixed by ‘0x’, 8 if the sequence starts with ‘0’, 10 otherwise. Same as ‘alpha’(d.string, x).

b_append

data b_append(data d, integer c);

is d, appends the c character to the d byte array

b_atoi

integer atoi(data d);

is the integral decimal interpretation of d. d is expected some sequence of decimal digit characters, possibly prefixed (the sequence, not the characters) by some mix of white spaces and sign characters (minuses and pluses, that is). Same as ‘atoi’(d.string).

b_character

integer b_character(data d, integer p);

is the (positively defined value of the) p indexed character in the d byte array (negative item indications are interpreted with respect to the end of string)

See Negative Indices.

b_clear

data b_clear(data d);

is d, clears the d byte array

b_compare

integer b_compare(data d, data v);

is 0 if d is same as v, less than 0 if d is less than v and greater than 0 if d is greater than v (much like ‘compare’(‘b_string’(d), ‘b_string’(v)))

See Math And Text Utilities.

b_cut

text b_cut(data d, integer p, integer n);

is the string starting at position p and extending n bytes in the d byte array (negative position indications are interpreted with respect to the end of string, negative spans indicate ranges ahead the position) (same as ‘be_string’)

See Negative Indices.

b_delete

data b_delete(data d, integer p);

is d, deletes the p indexed character in the d byte array (negative item indications are interpreted with respect to the end of string)

See Negative Indices.

b_drop

data b_drop(data d, text w);

is d, removes all occurences of the w bytes in the d byte array

b_dump

data b_dump(data d, integer c);

is d, removes all occurences of the c character in the d byte array

b_edit

data b_edit(data d, integer p, integer e);

is d, deletes e characters or as many as available after the p position in the d byte array if e is positive, e characters or as many as available prior the p position otherwise (negative position indications are interpreted with respect to the end of string)

See Negative Indices.

b_erase

data b_erase(data d, integer p, integer q);

is d, deletes the p to q indexed characters in the d byte array (negative item indications are interpreted with respect to the end of string). If q indicates a character prior to p the characters starting with the p indexed one to the end of the array and those from the beginning of the array to the q indexed one are deleted (as if d was circular).

See Negative Indices.

b_in

file b_in(data d);

is an input file opened for reading the d byte array (same as ‘file’().‘b_affix’(d))

See The Byte Data Open Functions.

b_initial

integer b_initial(data d);

is the first character in the d byte array

b_insert

data b_insert(data d, integer p, integer c);

is d, inserts character c in the p position in the d byte array (negative position indications are interpreted with respect to the end of string)

See Negative Indices.

b_jack

integer b_jack(integer &c, data d, integer p);

is 0 if the d byte array is too short for a p position, non zero otherwise. Sets c as the byte in the p position for the latter case.

b_length

integer b_length(data d);

is the length (byte count) of the d byte array

b_lower

data b_lower(data d);

is d, with all upper cases replaced by their corresponding lower cases

b_mold

text b_mold(text &s, data d);

is the d byte array content, sets s as the same

b_msbfn

cardinal b_msbfn(data d, integer p, integer n);

is the (most significant byte first) cardinal interpretation of byte sequence starting at position p and extending n bytes in the d byte array (negative position indications are interpreted with respect to the end of string, negative spans indicate ranges ahead the position)

See Negative Indices.

b_msbfvi

integer b_msbfvi(data d, integer &p);

is the (most significant byte first) varint interpretation of byte sequence starting at position p in the d byte array (negative position indications are interpreted with respect to the end of string). p is updated to indicate the first byte after. 7 bits in each byte are picked up to form the read value, with the most significant indicating whether another byte follows, last bit indicating the sign, negative numbers bit negated from their two’s complement representation.

See Negative Indices.

b_msbfvn

cardinal b_msbfvn(data d, integer &p);

is the (most significant byte first) unsigned varint interpretation of byte sequence starting at position p in the d byte array (negative position indications are interpreted with respect to the end of string). p is updated to indicate the first byte after. 7 bits in each byte are picked up to form the read value, with the most significant indicating whether another byte follows.

See Negative Indices.

b_new

void b_new(data &d);

sets the d byte array as a new byte array (same as ‘b_clear’ if d is not linked multiple times, otherwise creates a new byte array and sets d as a reference to the new byte array)

b_prefix

integer b_prefix(data d, data v);

is the number of characters matching at the beginning of d and v (the length of the longest common prefix)

b_project

text b_project(data d, integer p);

is the d byte array after position p (negative position indications are interpreted with respect to the end of string) (same as ‘bp_string’)

See Negative Indices.

b_replace

integer b_replace(data d, integer p, integer c);

is the (positively defined value of the) p indexed character in the d byte array, after it was replaced by c (negative item indications are interpreted with respect to the end of string)

See Negative Indices.

b_reverse

data b_reverse(data d);

is d, reverses the order of the characters in the d byte array

b_set

data b_set(data &d, data v);

is v, sets the d byte array as a reference of the v byte array

b_size

data b_size(data d, integer n);

is d, resizes the d byte array as n bytes long

b_squeeze

data b_squeeze(data d, text w);

is d, remove all (previous character) repeating occurences of the w characters in the d byte array

b_string

text b_string(data d);

is the d byte array content

b_swap

data b_swap(data d, data v);

is d, exchanges the content of the d and v byte arrays

b_translate

data b_translate(data d, text w, text z);

is d, replaces the d byte array characters in the w character set with their position correspondent in the z character set

b_turn

data b_turn(data d, integer c, integer f);

is d, replaces the c character in the d byte array with f

b_upper

data b_upper(data d);

is d, with all lower cases replaced by their corresponding upper cases

b_xcall

object b_xcall(data d, object o, &...);

is the evaluation result of the function indicated by o called with all the variadic arguments of b_xcall and all the bytes of the d byte array, with the latter supplied as ‘integer’s.

The variadic arguments are passed by reference where possible.

bb_drop

data bb_drop(data d, text w);

is d, removes all occurences of the w bytes at the back of the d byte array

bb_drop0

data bb_drop0(data d, text w);

is d, remove all occurences of the zero and w bytes at the back of the d byte array

bb_dump

data bb_dump(data d, integer c);

is d, removes all occurences of the c character at the back of the d byte array

be_string

text be_string(data d, integer p, integer e);

is the string starting at position p and extending e bytes in the d byte array (negative position indications are interpreted with respect to the end of string, negative spans indicate ranges ahead the position) (same as ‘b_cut’)

See Negative Indices.

bf_drop

data bf_drop(data d, text w);

is d, removes all occurences of the w bytes at the front of the d byte array

bf_drop0

data bf_drop0(data d, text w);

is d, removes all occurences of the zero and w bytes at the front of the d byte array

bf_dump

data bf_dump(data d, integer c);

is d, removes all occurences of the c character at the front of the d byte array

bo_character

integer bo_character(data d, object o);

is the (positively defined value of the) o indexed character in the d byte array (negative item indications are interpreted with respect to the end of string), with o of an intrinsic integral type

bp_compare

integer bp_compare(data d, integer p, data v);

is 0 if d from position p onwards is (case sensitive) same as v, less than 0 if d is less than v and greater than 0 if d is greater than v (much like ‘compare’(‘b_project’ (d, p), ‘b_string’(v)))

See Negative Indices.

bp_string

text bp_string(data d, integer p);

is the string starting after position p (negative position indications are interpreted with respect to the end of string) (same as ‘b_project’)

See Negative Indices.

bq_string

text bq_string(data d, integer p, integer q);

is the string starting with the p indexed character and ending with the q indexed character in the d byte array (negative item indications are interpreted with respect to the end of string). If q indicates a character prior to p the selection string wraps around (as if d was circular).

See Negative Indices.


Next: Byte Data Intrinsic String Copy Functions, Previous: Application Contexts, Up: The Byte Data Library   [Index]