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 >
iroha::expected::Result< T, std::string > jsonToProto (std::string json)
 

Function Documentation

◆ jsonToProto()

template<typename T >
iroha::expected::Result<T, std::string> 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 error otherwise

◆ modelToJson()

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