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


C++ data_buffer::read_int64方法代码示例

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


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

示例1: decode

void key_wallet::decode(data_buffer & buffer)
{
    /**
     * Read the version.
     */
    buffer.read_uint32();
    
    /**
     * Read the private key length.
     */
    auto len = buffer.read_var_int();

    if (len > 0)
    {
        /**
         * Read the private key.
         */
        m_key_private.reserve(len);
        
        buffer.read_bytes(
            reinterpret_cast<char *> (&m_key_private[0]), m_key_private.size()
        );
    }
    
    /**
     * Read the time created.
     */
    m_time_created = buffer.read_int64();
    
    /**
     * Read the time expires.
     */
    m_time_expires = buffer.read_int64();
    
    /**
     * Read the comment length.
     */
    len = buffer.read_var_int();
    
    if (len > 0)
    {
        /**
         * Read the comment.
         */
        m_comment.reserve(len);
        
        buffer.read_bytes(
            const_cast<char *> (m_comment.data()), m_comment.size()
        );
    }
}
开发者ID:machado-rev,项目名称:vcash,代码行数:51,代码来源:key_wallet.cpp

示例2: decode

void transaction_out::decode(data_buffer & buffer)
{
    /**
     * Decode the value.
     */
    m_value = buffer.read_int64();
    
    /**
     * Read the var_int.
     */
    auto len = buffer.read_var_int();
    
    if (len > 0)
    {
        /**
         * Read the script.
         */
        auto bytes = buffer.read_bytes(len);
        
        /**
         * Insert the script.
         */
        m_script_public_key.insert(
            m_script_public_key.begin(), bytes.begin(), bytes.end()
        );
    }
}
开发者ID:jaggedMiner,项目名称:vanillacoin,代码行数:27,代码来源:transaction_out.cpp

示例3: decode

void key_pool::decode(data_buffer & buffer, const bool & include_version)
{
    if (include_version)
    {
        /**
         * Read the version.
         */
        buffer.read_uint32();
    }
    
    /**
     * Read the time.
     */
    m_time = buffer.read_int64();
    
    /**
     * Decode the public key.
     */
    m_key_public.decode(buffer);
}
开发者ID:machado-rev,项目名称:vcash,代码行数:20,代码来源:key_pool.cpp

示例4: decode

bool chainblender_join::decode(data_buffer & buffer)
{
    /**
     * Decode the version.
     */
    m_version = buffer.read_uint32();
    
    assert(m_version == current_version);
    
    /**
     * Decode the session id.
     */
    m_hash_session_id = buffer.read_sha256();
    
    /**
     * Read the denomination.
     */
    m_denomination = buffer.read_int64();
    
    return true;
}
开发者ID:greenmo000,项目名称:vcash,代码行数:21,代码来源:chainblender_join.cpp

示例5: read_key_value


//.........这里部分代码省略.........
            w.set_master_key_max_id(id);
        }
    }
    else if (type == "ckey")
    {
        std::vector<std::uint8_t> pub_key;
        
        auto len = buffer_key.read_var_int();
        
        if (len > 0)
        {
            pub_key.resize(len);
            buffer_key.read_bytes(
                reinterpret_cast<char *> (&pub_key[0]), pub_key.size()
            );
        }
        
        std::vector<std::uint8_t> pri_key;
        
        len = buffer_value.read_var_int();
        
        if (len > 0)
        {
            pri_key.resize(len);
            buffer_value.read_bytes(
                reinterpret_cast<char *> (&pri_key[0]), pri_key.size()
            );
        }
        
        if (w.load_crypted_key(pub_key, pri_key) == false)
        {
            err = "load crypted key failed";
            
            return false;
        }
        
        is_encrypted = true;
    }
    else if (type == "defaultkey")
    {
        /**
         * Allocate the default public key.
         */
        key_public key_public_default;

        /**
         * Decode the default public key.
         */
        if (key_public_default.decode(buffer_value))
        {
            /**
             * Set the default public key.
             */
            w.set_key_public_default(key_public_default);
        }
    }
    else if (type == "pool")
    {
        auto index = buffer_key.read_int64();
        
        w.get_key_pool().insert(index);
    }
    else if (type == "version")
    {
        file_version = buffer_value.read_uint32();
        
        if (file_version == 10300)
        {
            file_version = 300;
        }
    }
    else if (type == "cscript")
    {
        auto digest = buffer_key.read_bytes(ripemd160::digest_length);
    
        auto len = buffer_value.read_var_int();
        
        if (len > 0)
        {
            script s(len);
            
            buffer_value.read_bytes(reinterpret_cast<char *> (&s[0]), s.size());

            if (w.load_c_script(s) == false)
            {
                err = "load c script failed";
                
                return false;
            }
        }
    }
    else if (type == "orderposnext")
    {
        std::int64_t order_position_next = buffer_value.read_int64();
        
        w.set_order_position_next(order_position_next);
    }

    return true;
}
开发者ID:tempbottle,项目名称:vanillacoin,代码行数:101,代码来源:db_wallet.cpp


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