Determine if the bit in the buffer at the given offset is set
| Return Type | Function name | Arguments |
|---|---|---|
| bool | GetBits | (unsigned char*,uint32_t,) |
Declared and defined in file: hzIntset.cpp
Function Logic:
Function body:
bool GetBits (unsigned char* pBitbuf)uint32_t nOset,
{
// Category: Bitwise
//
// Determine if the bit in the buffer at the given offset is set
//
// Arguments: 1) pBitbuf The buffer
// 2) nOset The offset (is divided by 8)
//
// Returns: True If the requested bit number is set within the segment
// False If the requested bit number is not set within the segment or it exceeds the segment range (0 - 4095)
_hzfunc("__func__") ;
if (!pBitbuf)
return false ;
switch (nOset%8)
{
case 0: return pBitbuf[nOset/8]& 0x80?true:false ;
case 1: return pBitbuf[nOset/8]& 0x40?true:false ;
case 2: return pBitbuf[nOset/8]& 0x20?true:false ;
case 3: return pBitbuf[nOset/8]& 0x10?true:false ;
case 4: return pBitbuf[nOset/8]& 0x08?true:false ;
case 5: return pBitbuf[nOset/8]& 0x04?true:false ;
case 6: return pBitbuf[nOset/8]& 0x02?true:false ;
case 7: return pBitbuf[nOset/8]& 0x01?true:false ;
}
return false ;
}