Namespace for bit‐string utility functions.

Synopsis

Declared in <bdlb_bitstringutil.h>

struct BitStringUtil;

Description

This struct provides a namespace for a suite of static functions to manipulate and access sequences of bits stored in an array of uint64_t (also known as a "bit string"; see {The "Bit String" Pseudo‐Type}).

Enums

Name

Description

Unnamed enum

Bit‐string utility constants.

Static Member Functions

Name

Description

andEqual

Bitwise AND corresponding bits of two bit strings.

areEqual

areEqual overloads

assign

assign overloads

assign0

assign0 overloads

assign1

assign1 overloads

assignBits

Assign bits from srcValue into bitString.

bit

Return the bit value at the specified index in bitString.

bits

Return a range of bits from bitString as an integer.

copy

Copy bits from a source bit string into a destination bit string.

copyRaw

Copy bits between bit strings that do not overlap adversely.

find0AtMaxIndex

find0AtMaxIndex overloads

find0AtMinIndex

find0AtMinIndex overloads

find1AtMaxIndex

find1AtMaxIndex overloads

find1AtMinIndex

find1AtMinIndex overloads

insert

Insert bits of a given value into a bit string.

insert0

Insert 0 bits into a bit string.

insert1

Insert 1 bits into a bit string.

insertRaw

Insert uninitialized bits into a bit string.

isAny0

Return whether any bit in a range of bitString is 0.

isAny1

Return whether any bit in a range of bitString is 1.

minusEqual

Bitwise MINUS corresponding bits of two bit strings.

num0

Return the number of 0 bits in a range of bitString.

num1

Return the number of 1 bits in a range of bitString.

orEqual

Bitwise OR corresponding bits of two bit strings.

print

Format a bit string to an output stream in hexadecimal.

remove

Remove bits from a bit string, shifting higher bits down.

removeAndFill0

Remove bits and fill vacated high‐order bits with 0.

removeAndFill1

Remove bits and fill vacated high‐order bits with 1.

swapRaw

Exchange non‐overlapping bit ranges between two bit strings.

toggle

Invert a range of bits in bitString.

xorEqual

Bitwise XOR corresponding bits of two bit strings.

Static Data Members

Name

Description

k_INVALID_INDEX

Sentinel index value indicating an invalid bit position.

Created with MrDocs