jaulib v1.4.0-2-g788cf73
Jau Support Library (C++, Java, ..)
Loading...
Searching...
No Matches
BitDemoData Class Reference

#include <data_bitstream.hpp>

Collaboration diagram for BitDemoData:

Static Public Member Functions

static void dumpData (const std::string &prefix, const uint8_t *data, size_t len)
 
static void dumpData (const std::string &prefix, jau::io::ByteStream &data)
 
static void dumpData (const std::string &prefix, jau::io::ByteStream &data, size_t len)
 
static uint32_t getBitMask (size_t n)
 Returns the 32 bit mask of n-bits, i.e.
 
static size_t getOneBitCount (std::string_view pattern)
 
static std::string toBinaryString (const uint64_t v, const size_t bitCount)
 
static std::string toHexBinaryString (const uint64_t v, const int bitCount)
 
static std::string toHexString (const int v)
 
static std::string toHexString (const int64_t v)
 
static uint64_t toInteger (const std::string_view bitPattern)
 
static uint64_t toLong (const std::string_view bitPattern)
 

Static Public Attributes

static const std::vector< std::string_view > pyramid32bit_one
 
static constexpr const char * strZeroPadding = "0000000000000000000000000000000000000000000000000000000000000000"
 
static constexpr uint8_t testBytesLSB64_be [] = { 0x5F_u8, 0x7B_u8, 0xF5_u8, 0x7F_u8, 0x7B_u8, 0xF5_u8, 0x53_u8, 0x7F_u8 }
 
static constexpr uint8_t testBytesLSB64_le [] = { 0x7F_u8, 0x53_u8, 0xF5_u8, 0x7B_u8, 0x7F_u8, 0xF5_u8, 0x7B_u8, 0x5F_u8 }
 
static constexpr uint8_t testBytesMSB64_be [] = { 0xfa_u8, 0xde_u8, 0xaf_u8, 0xfe_u8, 0xde_u8, 0xaf_u8, 0xca_u8, 0xfe_u8 }
 
static constexpr uint8_t testBytesMSB64_le [] = { 0xfe_u8, 0xca_u8, 0xaf_u8, 0xde_u8, 0xfe_u8, 0xaf_u8, 0xde_u8, 0xfa_u8 }
 
static constexpr uint64_t testIntLSB64_be = 0x5F7BF57F7BF5537F_u64
 
static constexpr uint64_t testIntLSB64_le = 0x7F53F57B7FF57B5F_u64
 
static constexpr uint64_t testIntMSB64_be = 0xfadeaffedeafcafe_u64
 
static constexpr uint64_t testIntMSB64_le = 0xfecaafdefeafdefa_u64
 
static constexpr std::string_view testStringLSB64_be
 
static constexpr std::string_view testStringLSB64_le = "01111111" "01010011" "11110101" "01111011" "01111111" "11110101" "01111011" "01011111"
 
static constexpr std::string_view testStringMSB64_be
 
static constexpr std::string_view testStringMSB64_le
 
static constexpr std::string_view testStringsLSB64_be []
 
static constexpr std::string_view testStringsLSB64_le []
 
static constexpr std::string_view testStringsMSB64_be []
 
static constexpr std::string_view testStringsMSB64_le []
 
static constexpr uint32_t UNSIGNED_INT_MAX_VALUE = 0xffffffff_u32
 

Detailed Description

Definition at line 30 of file data_bitstream.hpp.

Member Function Documentation

◆ getBitMask()

static uint32_t BitDemoData::getBitMask ( size_t n)
inlinestatic

Returns the 32 bit mask of n-bits, i.e.

n low order 1's.

Implementation handles n == 32.

Exceptions
IndexOutOfBoundsErrorif b is out of bounds, i.e. > 32

Definition at line 41 of file data_bitstream.hpp.

Here is the caller graph for this function:

◆ dumpData() [1/3]

static void BitDemoData::dumpData ( const std::string & prefix,
const uint8_t * data,
size_t len )
inlinestatic

Definition at line 128 of file data_bitstream.hpp.

Here is the caller graph for this function:

◆ dumpData() [2/3]

static void BitDemoData::dumpData ( const std::string & prefix,
jau::io::ByteStream & data,
size_t len )
inlinestatic

Definition at line 138 of file data_bitstream.hpp.

◆ dumpData() [3/3]

static void BitDemoData::dumpData ( const std::string & prefix,
jau::io::ByteStream & data )
inlinestatic

Definition at line 155 of file data_bitstream.hpp.

Here is the caller graph for this function:

◆ getOneBitCount()

static size_t BitDemoData::getOneBitCount ( std::string_view pattern)
inlinestatic

Definition at line 157 of file data_bitstream.hpp.

Here is the caller graph for this function:

◆ toLong()

static uint64_t BitDemoData::toLong ( const std::string_view bitPattern)
inlinestatic

Definition at line 166 of file data_bitstream.hpp.

◆ toInteger()

static uint64_t BitDemoData::toInteger ( const std::string_view bitPattern)
inlinestatic

Definition at line 173 of file data_bitstream.hpp.

Here is the caller graph for this function:

◆ toHexString() [1/2]

static std::string BitDemoData::toHexString ( const int v)
inlinestatic

Definition at line 181 of file data_bitstream.hpp.

◆ toHexString() [2/2]

static std::string BitDemoData::toHexString ( const int64_t v)
inlinestatic

Definition at line 184 of file data_bitstream.hpp.

◆ toBinaryString()

static std::string BitDemoData::toBinaryString ( const uint64_t v,
const size_t bitCount )
inlinestatic

Definition at line 188 of file data_bitstream.hpp.

Here is the caller graph for this function:

◆ toHexBinaryString()

static std::string BitDemoData::toHexBinaryString ( const uint64_t v,
const int bitCount )
inlinestatic

Definition at line 197 of file data_bitstream.hpp.

Here is the caller graph for this function:

Member Data Documentation

◆ UNSIGNED_INT_MAX_VALUE

uint32_t BitDemoData::UNSIGNED_INT_MAX_VALUE = 0xffffffff_u32
staticconstexpr

Definition at line 32 of file data_bitstream.hpp.

◆ pyramid32bit_one

const std::vector<std::string_view> BitDemoData::pyramid32bit_one
inlinestatic

Definition at line 51 of file data_bitstream.hpp.

◆ testBytesMSB64_be

uint8_t BitDemoData::testBytesMSB64_be[] = { 0xfa_u8, 0xde_u8, 0xaf_u8, 0xfe_u8, 0xde_u8, 0xaf_u8, 0xca_u8, 0xfe_u8 }
staticconstexpr

Definition at line 89 of file data_bitstream.hpp.

◆ testIntMSB64_be

uint64_t BitDemoData::testIntMSB64_be = 0xfadeaffedeafcafe_u64
staticconstexpr

Definition at line 90 of file data_bitstream.hpp.

◆ testStringsMSB64_be

std::string_view BitDemoData::testStringsMSB64_be[]
staticconstexpr
Initial value:
= { "11111010", "11011110", "10101111", "11111110",
"11011110", "10101111", "11001010", "11111110" }

Definition at line 92 of file data_bitstream.hpp.

◆ testStringMSB64_be

std::string_view BitDemoData::testStringMSB64_be
staticconstexpr
Initial value:
= "11111010" "11011110" "10101111" "11111110"
"11011110" "10101111" "11001010" "11111110"

Definition at line 94 of file data_bitstream.hpp.

◆ testBytesMSB64_le

uint8_t BitDemoData::testBytesMSB64_le[] = { 0xfe_u8, 0xca_u8, 0xaf_u8, 0xde_u8, 0xfe_u8, 0xaf_u8, 0xde_u8, 0xfa_u8 }
staticconstexpr

Definition at line 100 of file data_bitstream.hpp.

◆ testIntMSB64_le

uint64_t BitDemoData::testIntMSB64_le = 0xfecaafdefeafdefa_u64
staticconstexpr

Definition at line 101 of file data_bitstream.hpp.

◆ testStringsMSB64_le

std::string_view BitDemoData::testStringsMSB64_le[]
staticconstexpr
Initial value:
= { "11111110", "11001010", "10101111", "11011110",
"11111110", "10101111", "11011110", "11111010" }

Definition at line 103 of file data_bitstream.hpp.

◆ testStringMSB64_le

std::string_view BitDemoData::testStringMSB64_le
staticconstexpr
Initial value:
= "11111110" "11001010" "10101111" "11011110"
"11111110" "10101111" "11011110" "11111010"

Definition at line 106 of file data_bitstream.hpp.

◆ testBytesLSB64_be

uint8_t BitDemoData::testBytesLSB64_be[] = { 0x5F_u8, 0x7B_u8, 0xF5_u8, 0x7F_u8, 0x7B_u8, 0xF5_u8, 0x53_u8, 0x7F_u8 }
staticconstexpr

Definition at line 111 of file data_bitstream.hpp.

◆ testIntLSB64_be

uint64_t BitDemoData::testIntLSB64_be = 0x5F7BF57F7BF5537F_u64
staticconstexpr

Definition at line 112 of file data_bitstream.hpp.

◆ testStringsLSB64_be

std::string_view BitDemoData::testStringsLSB64_be[]
staticconstexpr
Initial value:
= { "01011111", "01111011", "11110101", "01111111",
"01111011", "11110101", "01010011", "01111111" }

Definition at line 114 of file data_bitstream.hpp.

◆ testStringLSB64_be

std::string_view BitDemoData::testStringLSB64_be
staticconstexpr
Initial value:
= "01011111" "01111011" "11110101" "01111111"
"01111011" "11110101" "01010011" "01111111"

Definition at line 116 of file data_bitstream.hpp.

◆ testBytesLSB64_le

uint8_t BitDemoData::testBytesLSB64_le[] = { 0x7F_u8, 0x53_u8, 0xF5_u8, 0x7B_u8, 0x7F_u8, 0xF5_u8, 0x7B_u8, 0x5F_u8 }
staticconstexpr

Definition at line 121 of file data_bitstream.hpp.

◆ testIntLSB64_le

uint64_t BitDemoData::testIntLSB64_le = 0x7F53F57B7FF57B5F_u64
staticconstexpr

Definition at line 122 of file data_bitstream.hpp.

◆ testStringsLSB64_le

std::string_view BitDemoData::testStringsLSB64_le[]
staticconstexpr
Initial value:
= { "01111111" "01010011" "11110101" "01111011"
"01111111" "11110101" "01111011" "01011111" }

Definition at line 124 of file data_bitstream.hpp.

◆ testStringLSB64_le

std::string_view BitDemoData::testStringLSB64_le = "01111111" "01010011" "11110101" "01111011" "01111111" "11110101" "01111011" "01011111"
staticconstexpr

Definition at line 126 of file data_bitstream.hpp.

◆ strZeroPadding

const char* BitDemoData::strZeroPadding = "0000000000000000000000000000000000000000000000000000000000000000"
staticconstexpr

Definition at line 187 of file data_bitstream.hpp.


The documentation for this class was generated from the following file: