Records
Functions
-
absl::Status MessageToJsonString (const Message & message, std::string * output, const PrintOptions & options)Converts from protobuf message to JSON and appends it to |output|. This is a
simple wrapper of BinaryToJsonString(). It will use the DescriptorPool of the
passed-in message to resolve Any types.
Please note that non-OK statuses are not a stable output of this API and
subject to change without notice.
-
absl::Status JsonStringToMessage (absl::string_view input, Message * message, const ParseOptions & options)Converts from JSON string to protobuf message. This works equivalently to
JsonToBinaryStream(). It will use the DescriptorPool of the passed-in
message to resolve Any types.
Please note that non-OK statuses are not a stable output of this API and
subject to change without notice.
-
absl::Status JsonStreamToMessage (io::ZeroCopyInputStream * input, Message * message, const ParseOptions & options)Converts from JSON stream to protobuf message. Similar to JsonStringToMessage
but with input stream.
Please note that non-OK statuses are not a stable output of this API and
subject to change without notice.
-
absl::Status BinaryToJsonStream (google::protobuf::util::TypeResolver * resolver, const std::string & type_url, io::ZeroCopyInputStream * binary_input, io::ZeroCopyOutputStream * json_output, const PrintOptions & options)Converts protobuf binary data to JSON.
The conversion will fail if:
1. TypeResolver fails to resolve a type.
2. input is not valid protobuf wire format, or conflicts with the type
information returned by TypeResolver.
Note that unknown fields will be discarded silently.
Please note that non-OK statuses are not a stable output of this API and
subject to change without notice.
-
absl::Status MessageToJsonString (const Message & message, std::string * output)Defined at line 67 of file ../../third_party/protobuf/src/google/protobuf/json/json.h
-
absl::Status JsonStringToMessage (absl::string_view input, Message * message)Defined at line 82 of file ../../third_party/protobuf/src/google/protobuf/json/json.h
-
absl::Status JsonStreamToMessage (io::ZeroCopyInputStream * input, Message * message)Defined at line 96 of file ../../third_party/protobuf/src/google/protobuf/json/json.h
-
absl::Status BinaryToJsonStream (google::protobuf::util::TypeResolver * resolver, const std::string & type_url, io::ZeroCopyInputStream * binary_input, io::ZeroCopyOutputStream * json_output)Defined at line 115 of file ../../third_party/protobuf/src/google/protobuf/json/json.h
-
absl::Status BinaryToJsonString (google::protobuf::util::TypeResolver * resolver, const std::string & type_url, const std::string & binary_input, std::string * json_output, const PrintOptions & options) -
absl::Status BinaryToJsonString (google::protobuf::util::TypeResolver * resolver, const std::string & type_url, const std::string & binary_input, std::string * json_output)Defined at line 128 of file ../../third_party/protobuf/src/google/protobuf/json/json.h
-
absl::Status JsonToBinaryStream (google::protobuf::util::TypeResolver * resolver, const std::string & type_url, io::ZeroCopyInputStream * json_input, io::ZeroCopyOutputStream * binary_output, const ParseOptions & options)Converts JSON data to protobuf binary format.
The conversion will fail if:
1. TypeResolver fails to resolve a type.
2. input is not valid JSON format, or conflicts with the type
information returned by TypeResolver.
Please note that non-OK statuses are not a stable output of this API and
subject to change without notice.
-
absl::Status JsonToBinaryStream (google::protobuf::util::TypeResolver * resolver, const std::string & type_url, io::ZeroCopyInputStream * json_input, io::ZeroCopyOutputStream * binary_output)Defined at line 149 of file ../../third_party/protobuf/src/google/protobuf/json/json.h
-
absl::Status JsonToBinaryString (google::protobuf::util::TypeResolver * resolver, const std::string & type_url, absl::string_view json_input, std::string * binary_output, const ParseOptions & options) -
absl::Status JsonToBinaryString (google::protobuf::util::TypeResolver * resolverconst std::string & type_urlabsl::string_view json_inputstd::string * binary_output)Defined at line 162 of file ../../third_party/protobuf/src/google/protobuf/json/json.h