TSDuck v3.38-3744
MPEG Transport Stream Toolkit
No Matches
tsBCD.h File Reference

Binary Coded Decimal utilities. More...


namespace  ts
 TSDuck namespace, containing all TSDuck classes and functions.


void ts::BCDToString (std::string &str, const uint8_t *bcd, size_t bcd_count, int decimal, bool left_justified=true)
 Decode a string representation of a variable-length Binary Coded Decimal (BCD) encoded integer.
uint32_t ts::DecodeBCD (const uint8_t *bcd, size_t bcd_count, bool left_justified=true)
 Return the decimal value of a Binary Coded Decimal (BCD) encoded string.
int ts::DecodeBCD (uint8_t b)
 Return the decimal value of a Binary Coded Decimal (BCD) encoded byte.
uint8_t ts::EncodeBCD (int i)
 Return a one-byte Binary Coded Decimal (BCD) representation of an integer.
void ts::EncodeBCD (uint8_t *bcd, size_t bcd_count, uint32_t value, bool left_justified=true, uint8_t pad_nibble=0)
 Encode a Binary Coded Decimal (BCD) string.
bool ts::IsValidBCD (uint8_t b)
 Check if a byte is a valid Binary Coded Decimal (BCD) value.

Detailed Description

Binary Coded Decimal utilities.