hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
iroha::blob_t< size_ > Class Template Reference

#include "blob.hpp"

Inheritance diagram for iroha::blob_t< size_ >:
Inheritance graph
Collaboration diagram for iroha::blob_t< size_ >:
Collaboration graph

Public Member Functions

 blob_t ()
 
std::string to_string () const noexcept
 
std::string to_hexstring () const noexcept
 

Static Public Member Functions

static constexpr size_t size ()
 
static blob_t< size_ > from_raw (const byte_t data[size_])
 
static expected::Result< blob_t< size_ >, std::string > from_string (std::string_view data)
 
static expected::Result< blob_t< size_ >, std::string > from_hexstring (std::string_view hex)
 

Detailed Description

template<size_t size_>
class iroha::blob_t< size_ >

Base type which represents blob of fixed size.

std::string is convenient to use but it is not safe. We can not specify the fixed length for string.

For std::array it is possible, so we prefer it over std::string.

Constructor & Destructor Documentation

◆ blob_t()

template<size_t size_>
iroha::blob_t< size_ >::blob_t ( )
inline

Initialize blob value

Member Function Documentation

◆ from_hexstring()

template<size_t size_>
static expected::Result<blob_t<size_>, std::string> iroha::blob_t< size_ >::from_hexstring ( std::string_view  hex)
inlinestatic
Here is the caller graph for this function:

◆ from_raw()

template<size_t size_>
static blob_t<size_> iroha::blob_t< size_ >::from_raw ( const byte_t  data[size_])
inlinestatic
Here is the caller graph for this function:

◆ from_string()

template<size_t size_>
static expected::Result<blob_t<size_>, std::string> iroha::blob_t< size_ >::from_string ( std::string_view  data)
inlinestatic
Here is the caller graph for this function:

◆ size()

template<size_t size_>
static constexpr size_t iroha::blob_t< size_ >::size ( )
inlinestatic

In compile-time returns size of current blob.

Here is the caller graph for this function:

◆ to_hexstring()

template<size_t size_>
std::string iroha::blob_t< size_ >::to_hexstring ( ) const
inlinenoexcept

Converts current blob to hex string.

Here is the caller graph for this function:

◆ to_string()

template<size_t size_>
std::string iroha::blob_t< size_ >::to_string ( ) const
inlinenoexcept

Converts current blob to std::string

Here is the caller graph for this function:

The documentation for this class was generated from the following file: