[#BloombergLP-bdlb-BitStringUtil]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlb.adoc[bdlb]::BitStringUtil
:relfileprefix: ../../
:mrdocs:

Namespace for bit&hyphen;string utility functions&period;

== Synopsis

Declared in `&lt;bdlb&lowbar;bitstringutil&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
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&lowbar;t` (also known as a &quot;bit string&quot;&semi; see &lcub;The &quot;Bit String&quot; Pseudo&hyphen;Type&rcub;)&period;

== Enums

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlb/BitStringUtil/_04enum.adoc[`Unnamed enum`] 
| Bit&hyphen;string utility constants&period;
|===


== Static Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlb/BitStringUtil/andEqual.adoc[`andEqual`] 
| Bitwise AND corresponding bits of two bit strings&period;
| xref:BloombergLP/bdlb/BitStringUtil/areEqual-0a.adoc[`areEqual`] 
| `areEqual` overloads
| xref:BloombergLP/bdlb/BitStringUtil/assign-01.adoc[`assign`] 
| `assign` overloads
| xref:BloombergLP/bdlb/BitStringUtil/assign0-04.adoc[`assign0`] 
| `assign0` overloads
| xref:BloombergLP/bdlb/BitStringUtil/assign1-07.adoc[`assign1`] 
| `assign1` overloads
| xref:BloombergLP/bdlb/BitStringUtil/assignBits.adoc[`assignBits`] 
| Assign bits from `srcValue` into `bitString`&period;
| xref:BloombergLP/bdlb/BitStringUtil/bit.adoc[`bit`] 
| Return the bit value at the specified `index` in `bitString`&period;
| xref:BloombergLP/bdlb/BitStringUtil/bits.adoc[`bits`] 
| Return a range of bits from `bitString` as an integer&period;
| xref:BloombergLP/bdlb/BitStringUtil/copy.adoc[`copy`] 
| Copy bits from a source bit string into a destination bit string&period;
| xref:BloombergLP/bdlb/BitStringUtil/copyRaw.adoc[`copyRaw`] 
| Copy bits between bit strings that do not overlap adversely&period;
| xref:BloombergLP/bdlb/BitStringUtil/find0AtMaxIndex-03.adoc[`find0AtMaxIndex`] 
| `find0AtMaxIndex` overloads
| xref:BloombergLP/bdlb/BitStringUtil/find0AtMinIndex-05.adoc[`find0AtMinIndex`] 
| `find0AtMinIndex` overloads
| xref:BloombergLP/bdlb/BitStringUtil/find1AtMaxIndex-09.adoc[`find1AtMaxIndex`] 
| `find1AtMaxIndex` overloads
| xref:BloombergLP/bdlb/BitStringUtil/find1AtMinIndex-05.adoc[`find1AtMinIndex`] 
| `find1AtMinIndex` overloads
| xref:BloombergLP/bdlb/BitStringUtil/insert.adoc[`insert`] 
| Insert bits of a given value into a bit string&period;
| xref:BloombergLP/bdlb/BitStringUtil/insert0.adoc[`insert0`] 
| Insert 0 bits into a bit string&period;
| xref:BloombergLP/bdlb/BitStringUtil/insert1.adoc[`insert1`] 
| Insert 1 bits into a bit string&period;
| xref:BloombergLP/bdlb/BitStringUtil/insertRaw.adoc[`insertRaw`] 
| Insert uninitialized bits into a bit string&period;
| xref:BloombergLP/bdlb/BitStringUtil/isAny0.adoc[`isAny0`] 
| Return whether any bit in a range of `bitString` is 0&period;
| xref:BloombergLP/bdlb/BitStringUtil/isAny1.adoc[`isAny1`] 
| Return whether any bit in a range of `bitString` is 1&period;
| xref:BloombergLP/bdlb/BitStringUtil/minusEqual.adoc[`minusEqual`] 
| Bitwise MINUS corresponding bits of two bit strings&period;
| xref:BloombergLP/bdlb/BitStringUtil/num0.adoc[`num0`] 
| Return the number of 0 bits in a range of `bitString`&period;
| xref:BloombergLP/bdlb/BitStringUtil/num1.adoc[`num1`] 
| Return the number of 1 bits in a range of `bitString`&period;
| xref:BloombergLP/bdlb/BitStringUtil/orEqual.adoc[`orEqual`] 
| Bitwise OR corresponding bits of two bit strings&period;
| xref:BloombergLP/bdlb/BitStringUtil/print.adoc[`print`] 
| Format a bit string to an output stream in hexadecimal&period;
| xref:BloombergLP/bdlb/BitStringUtil/remove.adoc[`remove`] 
| Remove bits from a bit string, shifting higher bits down&period;
| xref:BloombergLP/bdlb/BitStringUtil/removeAndFill0.adoc[`removeAndFill0`] 
| Remove bits and fill vacated high&hyphen;order bits with 0&period;
| xref:BloombergLP/bdlb/BitStringUtil/removeAndFill1.adoc[`removeAndFill1`] 
| Remove bits and fill vacated high&hyphen;order bits with 1&period;
| xref:BloombergLP/bdlb/BitStringUtil/swapRaw.adoc[`swapRaw`] 
| Exchange non&hyphen;overlapping bit ranges between two bit strings&period;
| xref:BloombergLP/bdlb/BitStringUtil/toggle.adoc[`toggle`] 
| Invert a range of bits in `bitString`&period;
| xref:BloombergLP/bdlb/BitStringUtil/xorEqual.adoc[`xorEqual`] 
| Bitwise XOR corresponding bits of two bit strings&period;
|===


== Static Data Members

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlb/BitStringUtil/k_INVALID_INDEX.adoc[`k&lowbar;INVALID&lowbar;INDEX`] 
| Sentinel index value indicating an invalid bit position&period;
|===



[.small]#Created with https://www.mrdocs.com[MrDocs]#
