utils.hpp
72 inline boost::dynamic_bitset<boost::uint8_t> & shift_in_bitset(boost::dynamic_bitset<boost::uint8_t> &hostBitset, const boost::dynamic_bitset<boost::uint8_t> & clientBitset) {
87 inline boost::container::vector<boost::uint8_t> to_bytearray(const boost::dynamic_bitset<boost::uint8_t> &bitset) {
88 size_t sizeBytesPadded = static_cast<size_t>(ceil(static_cast<double>(bitset.size()) / CHAR_BIT));
101 inline boost::dynamic_bitset<boost::uint8_t> to_bitset(const boost::container::vector<boost::uint8_t> &byteArray, size_t resultingBitSetSize = 0) {
102 boost::dynamic_bitset<boost::uint8_t> bitset((resultingBitSetSize == 0) ? (byteArray.size() * CHAR_BIT) : resultingBitSetSize);
std::string to_string(const boost::dynamic_bitset< boost::uint8_t > &bitset)
Create string representation of the dynamic bitset given.
Definition: utils.hpp:22
boost::dynamic_bitset< boost::uint8_t > to_bitset(const boost::container::vector< boost::uint8_t > &byteArray, size_t resultingBitSetSize=0)
Converts a byte array into a bitset.
Definition: utils.hpp:101
boost::container::vector< boost::uint8_t > to_bytearray(const boost::dynamic_bitset< boost::uint8_t > &bitset)
This converts the given boost::dynamic_bitset to an array of 8-bit wide bytes.
Definition: utils.hpp:87
std::string to_binstring(uintX_t value)
Returns a string representation in bits of the int given.
Definition: utils.hpp:34
boost::dynamic_bitset< boost::uint8_t > & shift_in_bitset(boost::dynamic_bitset< boost::uint8_t > &hostBitset, const boost::dynamic_bitset< boost::uint8_t > &clientBitset)
This function pads the given client bitset in the host by making a copy of clientBitset, resizing the clientBitset or-ing it in the hostBitset and returning the hostBitset.
Definition: utils.hpp:72