diff options
author | ncteisen <ncteisen@gmail.com> | 2018-10-22 16:14:37 -0700 |
---|---|---|
committer | ncteisen <ncteisen@gmail.com> | 2018-10-22 17:08:31 -0700 |
commit | 97134a69bec2f5a23c9350166bff60eec1275b2f (patch) | |
tree | 1062308960b82ef4ba41ec0bc3f76b45d35923b0 /include | |
parent | 2521fefb35c4569680ad1e0722356f05a2243a54 (diff) |
Refactor to support internal build
Diffstat (limited to 'include')
-rw-r--r-- | include/grpcpp/impl/codegen/config_protobuf.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/grpcpp/impl/codegen/config_protobuf.h b/include/grpcpp/impl/codegen/config_protobuf.h index 94e593d1ef..598848ee9f 100644 --- a/include/grpcpp/impl/codegen/config_protobuf.h +++ b/include/grpcpp/impl/codegen/config_protobuf.h @@ -66,6 +66,11 @@ #define GRPC_CUSTOM_CODEDINPUTSTREAM ::google::protobuf::io::CodedInputStream #endif +#ifndef GRPC_CUSTOM_UTIL_STATUS +#include <google/protobuf/util/json_util.h> +#define GRPC_CUSTOM_UTIL_STATUS ::google::protobuf::util::Status +#endif + namespace grpc { namespace protobuf { @@ -83,6 +88,17 @@ typedef GRPC_CUSTOM_SERVICEDESCRIPTOR ServiceDescriptor; typedef GRPC_CUSTOM_SIMPLEDESCRIPTORDATABASE SimpleDescriptorDatabase; typedef GRPC_CUSTOM_SOURCELOCATION SourceLocation; +namespace util { +typedef GRPC_CUSTOM_UTIL_STATUS Status; + +inline util::Status JsonStringToMessage(const std::string& input, + Message* message) { + return ::google::protobuf::util::JsonStringToMessage( + input, message, ::google::protobuf::util::JsonParseOptions()); +} + +} // namespace util + namespace io { typedef GRPC_CUSTOM_ZEROCOPYOUTPUTSTREAM ZeroCopyOutputStream; typedef GRPC_CUSTOM_ZEROCOPYINPUTSTREAM ZeroCopyInputStream; |