hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
shared_model::crypto::Blob Class Reference

#include "blob.hpp"

Inheritance diagram for shared_model::crypto::Blob:
Inheritance graph
Collaboration diagram for shared_model::crypto::Blob:
Collaboration graph

Public Types

using Bytes = std::vector< uint8_t >
 
- Public Types inherited from shared_model::interface::ModelPrimitive< Blob >
using ModelType = Blob
 
- Public Types inherited from Cloneable< Blob >
using base_type = Blob
 

Public Member Functions

 Blob ()=default
 
 Blob (const std::string &blob)
 
 Blob (const Bytes &blob)
 
 Blob (Bytes &&blob) noexcept
 
virtual const Bytesblob () const
 
virtual const std::string & hex () const
 
virtual size_t size () const
 
std::string toString () const override
 
bool operator== (const Blob &rhs) const override
 
- Public Member Functions inherited from shared_model::interface::ModelPrimitive< Blob >
virtual bool operator== (const ModelType &rhs) const =0
 
virtual bool operator!= (const ModelType &rhs) const
 
virtual ~ModelPrimitive ()=default
 
- Public Member Functions inherited from Cloneable< Blob >
virtual ~Cloneable ()=default
 

Static Public Member Functions

static Blob fromHexString (const std::string &hex)
 

Protected Member Functions

Blobclone () const override
 

Detailed Description

Blob class present user-friendly blob for working with low-level binary stuff. Its length is not fixed in compile time.

Member Typedef Documentation

using shared_model::crypto::Blob::Bytes = std::vector<uint8_t>

Constructor & Destructor Documentation

shared_model::crypto::Blob::Blob ( )
default

Here is the caller graph for this function:

shared_model::crypto::Blob::Blob ( const std::string &  blob)
explicit

Create blob from a string

Parameters
blob- string to create blob from
shared_model::crypto::Blob::Blob ( const Bytes blob)
explicit

Create blob from a vector

Parameters
blob- vector to create blob from
shared_model::crypto::Blob::Blob ( Bytes &&  blob)
explicitnoexcept

Here is the call graph for this function:

Member Function Documentation

const Blob::Bytes & shared_model::crypto::Blob::blob ( ) const
virtual
Returns
provides raw representation of blob

Here is the caller graph for this function:

Blob * shared_model::crypto::Blob::clone ( ) const
overrideprotectedvirtual

Polymorphic clone constructor. Method guarantees deep-copy.

Returns
pointer to cloned object

Implements Cloneable< Blob >.

Here is the call graph for this function:

Blob shared_model::crypto::Blob::fromHexString ( const std::string &  hex)
static

Creates new Blob object from provided hex string

Parameters
hex- string in hex format to create Blob from
Returns
Blob from provided hex string if it was correct or Blob from empty string if provided string was not a correct hex string

Here is the call graph for this function:

Here is the caller graph for this function:

const std::string & shared_model::crypto::Blob::hex ( ) const
virtual
Returns
provides human-readable representation of blob without leading 0x

Here is the caller graph for this function:

bool shared_model::crypto::Blob::operator== ( const Blob rhs) const
override

Here is the call graph for this function:

size_t shared_model::crypto::Blob::size ( ) const
virtual
Returns
size of raw representation of blob

Here is the caller graph for this function:

std::string shared_model::crypto::Blob::toString ( ) const
overridevirtual

Make string developer representation of object

Returns
string with internal state of object

Reimplemented from shared_model::interface::ModelPrimitive< Blob >.

Reimplemented in shared_model::crypto::Hash, shared_model::crypto::Signed, shared_model::crypto::PrivateKey, shared_model::crypto::PublicKey, and shared_model::crypto::Seed.

Here is the call graph for this function:


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