C++ Utilities
5.24.7
Useful C++ classes and routines such as argument parser, IO and conversion utilities
Loading...
Searching...
No Matches
io
bitreader.cpp
Go to the documentation of this file.
1
#include "
./bitreader.h
"
2
3
using namespace
std
;
4
5
namespace
CppUtilities
{
6
43
void
BitReader::skipBits
(std::size_t
bitCount
)
44
{
45
if
(
bitCount
<= m_bitsAvail) {
46
m_bitsAvail -=
static_cast<
std::uint8_t
>
(
bitCount
);
47
}
else
{
48
if
((m_buffer += 1 + (
bitCount
-= m_bitsAvail) / 8) >= m_end) {
49
throw
ios_base::failure(
"end of buffer exceeded"
);
50
}
51
m_bitsAvail = 8 - (
bitCount
% 8);
52
}
53
}
54
55
}
// namespace CppUtilities
bitreader.h
CppUtilities::BitReader::skipBits
void skipBits(std::size_t bitCount)
Skips the specified number of bits without reading it.
Definition
bitreader.cpp:43
CppUtilities
Contains all utilities provides by the c++utilities library.
Definition
argumentparser.h:18
CppUtilities::stringToNumber
IntegralType stringToNumber(const StringType &string, BaseType base=10)
Converts the given string to an unsigned/signed number assuming string uses the specified base.
Definition
stringconversion.h:593
std
STL namespace.
Generated on Tue Mar 5 2024 11:04:30 for C++ Utilities by
1.10.0