Protocol Buffers - Google's data interchange format (grpc依赖)
https://developers.google.com/protocol-buffers/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.2 KiB
40 lines
1.2 KiB
12 years ago
|
// Support for registering field handlers that can write into a legacy proto1
|
||
|
// message. This functionality is only needed inside Google.
|
||
|
//
|
||
11 years ago
|
// This is an internal-only interface.
|
||
12 years ago
|
|
||
|
#ifndef UPB_GOOGLE_PROTO1_H_
|
||
|
#define UPB_GOOGLE_PROTO1_H_
|
||
|
|
||
|
namespace proto2 {
|
||
|
class FieldDescriptor;
|
||
|
class Message;
|
||
|
}
|
||
|
|
||
|
namespace upb {
|
||
|
class FieldDef;
|
||
|
class Handlers;
|
||
|
}
|
||
|
|
||
|
namespace upb {
|
||
11 years ago
|
namespace googlepb {
|
||
12 years ago
|
|
||
|
// Sets field handlers in the given Handlers object for writing to a single
|
||
|
// field (as described by "proto2_f" and "upb_f") into a message constructed
|
||
|
// by the same factory as "prototype." Returns true if this was successful
|
||
|
// (this will fail if "prototype" is not a proto1 message, or if we can't
|
||
|
// handle it for some reason).
|
||
|
bool TrySetProto1WriteHandlers(const proto2::FieldDescriptor* proto2_f,
|
||
|
const proto2::Message& prototype,
|
||
|
const upb::FieldDef* upb_f, upb::Handlers* h);
|
||
|
|
||
11 years ago
|
// Returns a prototype for the given this (possibly-weak) field. Returns NULL
|
||
|
// if this is not a submessage field of any kind (weak or no).
|
||
12 years ago
|
const proto2::Message* GetProto1FieldPrototype(
|
||
12 years ago
|
const proto2::Message& m, const proto2::FieldDescriptor* f);
|
||
12 years ago
|
|
||
11 years ago
|
} // namespace googlepb
|
||
12 years ago
|
} // namespace upb
|
||
|
|
||
|
#endif // UPB_GOOGLE_PROTO1_H_
|