当前位置: 首页>>代码示例>>C++>>正文


C++ reader::read_2_bytes_little_endian方法代码示例

本文整理汇总了C++中reader::read_2_bytes_little_endian方法的典型用法代码示例。如果您正苦于以下问题:C++ reader::read_2_bytes_little_endian方法的具体用法?C++ reader::read_2_bytes_little_endian怎么用?C++ reader::read_2_bytes_little_endian使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在reader的用法示例。


在下文中一共展示了reader::read_2_bytes_little_endian方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: from_data

bool point::from_data(reader& source, bool wire)
{
    reset();

    valid_ = true;
    hash_ = source.read_hash();

    if (wire)
    {
        index_ = source.read_4_bytes_little_endian();
    }
    else
    {
        index_ = source.read_2_bytes_little_endian();

        // Convert 16 bit sentinel to 32 bit sentinel.
        if (index_ == max_uint16)
            index_ = null_index;
    }

    if (!source)
        reset();

    return source;
}
开发者ID:RojavaCrypto,项目名称:libbitcoin,代码行数:25,代码来源:point.cpp

示例2: from_data

// Avoid point reuse due to affect on store tx serialization.
bool payment_record::from_data(reader& source, bool wire)
{
    valid_ = true;
    output_ = (source.read_byte() == 1);

    if (wire)
    {
        height_ = source.read_4_bytes_little_endian();
        link_ = unlinked;
        hash_ = source.read_hash();
        index_ = source.read_4_bytes_little_endian();
    }
    else
    {
        height_ = 0;
        link_ = source.read_8_bytes_little_endian();
        hash_ = null_hash;
        index_ = source.read_2_bytes_little_endian();

        // Convert 16 bit sentinel to 32 bit sentinel.
        if (index_ == max_uint16)
            index_ = point::null_index;
    }

    data_ = source.read_8_bytes_little_endian();

    if (!source)
        reset();

    return source;
}
开发者ID:RojavaCrypto,项目名称:libbitcoin,代码行数:32,代码来源:payment_record.cpp

示例3: read_opcode_data_size

bool operation::read_opcode_data_size(uint32_t& count, opcode code,
    uint8_t raw_byte, reader& source)
{
    switch (code)
    {
        case opcode::special:
            count = raw_byte;
            return true;
        case opcode::pushdata1:
            count = source.read_byte();
            return true;
        case opcode::pushdata2:
            count = source.read_2_bytes_little_endian();
            return true;
        case opcode::pushdata4:
            count = source.read_4_bytes_little_endian();
            return true;
        default:
            return false;
    }
}
开发者ID:zauguin,项目名称:libbitcoin,代码行数:21,代码来源:operation.cpp


注:本文中的reader::read_2_bytes_little_endian方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。