本文整理汇总了C++中BinaryRefReader::get_uint8_t方法的典型用法代码示例。如果您正苦于以下问题:C++ BinaryRefReader::get_uint8_t方法的具体用法?C++ BinaryRefReader::get_uint8_t怎么用?C++ BinaryRefReader::get_uint8_t使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BinaryRefReader
的用法示例。
在下文中一共展示了BinaryRefReader::get_uint8_t方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: deserialize
ProgressData ProgressData::deserialize(BinaryRefReader& brr)
{
auto type_code = brr.get_uint8_t();
if (type_code != PROGRESSDATA_CODE)
BtcUtils::throw_type_error(PROGRESSDATA_CODE, type_code);
ProgressData pd;
pd.phase_ = (BDMPhase)brr.get_uint8_t();
pd.progress_ = brr.get_double();
pd.time_ = brr.get_uint32_t();
pd.numericProgress_ = brr.get_uint32_t();
return pd;
}
示例2: checkPrefixByte
bool DBUtils::checkPrefixByte(BinaryRefReader & brr,
DB_PREFIX prefix,
bool rewindWhenDone)
{
uint8_t oneByte = brr.get_uint8_t();
bool out = (oneByte == (uint8_t)prefix);
if (rewindWhenDone)
brr.rewind(1);
return out;
}
示例3: getNextOpcode
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
//// ScriptParser
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
OpCode ScriptParser::getNextOpcode(BinaryRefReader& brr) const
{
OpCode val;
val.offset_ = brr.getPosition();
val.opcode_ = brr.get_uint8_t();
if (val.opcode_ <= 75 && val.opcode_ > 0)
{
val.dataRef_ = brr.get_BinaryDataRef(val.opcode_);
}
else
{
unsigned len = 0;
switch (val.opcode_)
{
case OP_PUSHDATA1:
len = brr.get_uint8_t();
break;
case OP_PUSHDATA2:
len = brr.get_uint16_t();
break;
case OP_PUSHDATA4:
len = brr.get_uint32_t();
break;
case OP_IF:
case OP_NOTIF:
len = brr.getSizeRemaining();
break;
default:
return val;
}
val.dataRef_ = brr.get_BinaryDataRef(len);
}
return val;
}
示例4: readBlkDataKey
BLKDATA_TYPE DBUtils::readBlkDataKey(BinaryRefReader & brr,
uint32_t & height,
uint8_t & dupID,
uint16_t & txIdx,
uint16_t & txOutIdx)
{
uint8_t prefix = brr.get_uint8_t();
if (prefix != (uint8_t)DB_PREFIX_TXDATA)
{
height = 0xffffffff;
dupID = 0xff;
txIdx = 0xffff;
txOutIdx = 0xffff;
return NOT_BLKDATA;
}
return readBlkDataKeyNoPrefix(brr, height, dupID, txIdx, txOutIdx);
}
示例5: checkPrefixByteWError
bool DBUtils::checkPrefixByteWError(BinaryRefReader & brr,
DB_PREFIX prefix,
bool rewindWhenDone)
{
uint8_t oneByte = brr.get_uint8_t();
bool out;
if (oneByte == (uint8_t)prefix)
out = true;
else
{
LOGERR << "Unexpected prefix byte: "
<< "Expected: " << getPrefixName(prefix)
<< "Received: " << getPrefixName(oneByte);
out = false;
}
if (rewindWhenDone)
brr.rewind(1);
return out;
}