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

Functions

template<typename T >
std::string modelToJson (const T &message)
 
template<typename T >
boost::optional< T > jsonToProto (std::string json)
 
template<typename T >
boost::optional< T > jsonToModel (std::string json)
 

Function Documentation

template<typename T >
boost::optional<T> shared_model::converters::protobuf::jsonToModel ( std::string  json)

Converts json into arbitrary transaction shared model object

Template Parameters
Ttype of shared model object converted from json
Parameters
jsonis the json string containing protobuf object
Returns
optional of shared model object, containing the object if conversion was successful and none otherwise
template<typename T >
boost::optional<T> shared_model::converters::protobuf::jsonToProto ( std::string  json)

Converts json string into arbitrary protobuf object

Template Parameters
Ttype of model which json converts to
Parameters
jsonis the json string
Returns
optional of protobuf object which contains value if json conversion was successful and none otherwise
template<typename T >
std::string shared_model::converters::protobuf::modelToJson ( const T &  message)

Converts protobuf model object into json string

Template Parameters
Tis the type of converting message
Parameters
messageis the message to be converted
Returns
json string

Here is the call graph for this function: