hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
iroha::model::converters Namespace Reference

Classes

struct  Convert
 
struct  Convert< blob_t< size > >
 
struct  Convert< Block::SignaturesType >
 
struct  Convert< GetTransactions::TxHashCollectionType >
 
struct  Convert< Peer >
 
struct  Convert< Signature >
 
struct  FieldDeserializer
 
class  JsonBlockFactory
 
class  JsonCommandFactory
 
class  JsonQueryFactory
 
class  JsonTransactionFactory
 
class  PbBlockFactory
 
class  PbCommandFactory
 
class  PbQueryFactory
 
class  PbQueryResponseFactory
 
class  PbTransactionFactory
 

Functions

Value serializeSignature (const Signature &signature, Document::AllocatorType &allocator)
 
boost::optional< Document > stringToJson (const std::string &string)
 
std::string jsonToString (const Document &document)
 
static void trySetHexKey (pubkey_t &dest, const std::string &src)
 
protocol::Peer serializePeer (iroha::model::Peer iroha_peer)
 
iroha::model::Peer deserializePeer (protocol::Peer pb_peer)
 
iroha::protocol::Account serializeAccount (const iroha::model::Account &account)
 
iroha::protocol::Asset serializeAsset (const iroha::model::Asset &asset)
 
iroha::protocol::AccountAsset serializeAccountAsset (const iroha::model::AccountAsset &account_asset)
 
iroha::protocol::Domain serializeDomain (const iroha::model::Domain &domain)
 
template<typename T , typename D >
boost::optional< T > deserializeField (const D &document, const std::string &field)
 
template<typename D >
auto makeFieldDeserializer (const D &document)
 
rapidjson::Value serializeSignature (const Signature &signature, rapidjson::Document::AllocatorType &allocator)
 
std::string jsonToString (const rapidjson::Document &document)
 

Function Documentation

template<typename T , typename D >
boost::optional<T> iroha::model::converters::deserializeField ( const D &  document,
const std::string &  field 
)

Deserialize field from given document with given type

Template Parameters
T- getter return type
D- document type
Parameters
document- document value for deserialization
field- field name for deserialization
Returns
deserialized field on success, nullopt otherwise
iroha::model::Peer iroha::model::converters::deserializePeer ( protocol::Peer  pb_peer)

Here is the call graph for this function:

Here is the caller graph for this function:

std::string iroha::model::converters::jsonToString ( const Document &  document)

Here is the caller graph for this function:

std::string iroha::model::converters::jsonToString ( const rapidjson::Document &  document)

Pretty print JSON document to string

Parameters
document- document for printing
Returns
pretty printed JSON document
template<typename D >
auto iroha::model::converters::makeFieldDeserializer ( const D &  document)

Factory method for FieldDeserializer functor

Template Parameters
D- document type
Parameters
document- document for deserialization
Returns
FieldDeserializer instance for given arguments

Here is the caller graph for this function:

iroha::protocol::Account iroha::model::converters::serializeAccount ( const iroha::model::Account account)
iroha::protocol::AccountAsset iroha::model::converters::serializeAccountAsset ( const iroha::model::AccountAsset account_asset)
iroha::protocol::Asset iroha::model::converters::serializeAsset ( const iroha::model::Asset asset)
iroha::protocol::Domain iroha::model::converters::serializeDomain ( const iroha::model::Domain domain)
protocol::Peer iroha::model::converters::serializePeer ( iroha::model::Peer  iroha_peer)

Here is the call graph for this function:

Here is the caller graph for this function:

Value iroha::model::converters::serializeSignature ( const Signature signature,
Document::AllocatorType &  allocator 
)

Here is the call graph for this function:

Here is the caller graph for this function:

rapidjson::Value iroha::model::converters::serializeSignature ( const Signature signature,
rapidjson::Document::AllocatorType &  allocator 
)

Serialize signature to JSON with given allocator

Parameters
signature- signature for serialization
allocator- allocator for JSON value
Returns
JSON value with signature
boost::optional< rapidjson::Document > iroha::model::converters::stringToJson ( const std::string &  string)

Try to parse JSON from string

Parameters
string- string for parsing
Returns
JSON document on success, nullopt otherwise

Here is the caller graph for this function:

static void iroha::model::converters::trySetHexKey ( pubkey_t dest,
const std::string &  src 
)
static

convert hex string to pubkey

Parameters
destreference to destination public key
srcsource string

Here is the caller graph for this function: