summaryrefslogtreecommitdiff
path: root/upb/bindings/googlepb/proto1.int.h
diff options
context:
space:
mode:
authorJosh Haberman <jhaberman@gmail.com>2014-06-26 20:24:32 -0700
committerJosh Haberman <jhaberman@gmail.com>2014-06-26 20:24:32 -0700
commit2d10fa33071d52d7a35ce3b13bc459cd16a0aa33 (patch)
treebf47d38e2e1cc8ddb4711b23b26e7fd10742e07d /upb/bindings/googlepb/proto1.int.h
parent7d565f1e7a0f107506d3cf31ef2e33e22a504d2b (diff)
Sync from internal Google development.
Diffstat (limited to 'upb/bindings/googlepb/proto1.int.h')
-rw-r--r--upb/bindings/googlepb/proto1.int.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/upb/bindings/googlepb/proto1.int.h b/upb/bindings/googlepb/proto1.int.h
new file mode 100644
index 0000000..64ebb2f
--- /dev/null
+++ b/upb/bindings/googlepb/proto1.int.h
@@ -0,0 +1,45 @@
+//
+// upb - a minimalist implementation of protocol buffers.
+//
+// Copyright (c) 2011-2012 Google Inc. See LICENSE for details.
+// Author: Josh Haberman <jhaberman@gmail.com>
+//
+// Support for registering field handlers that can write into a legacy proto1
+// message. This functionality is only needed inside Google.
+//
+// This is an internal-only interface.
+
+#ifndef UPB_GOOGLE_PROTO1_H_
+#define UPB_GOOGLE_PROTO1_H_
+
+namespace proto2 {
+class FieldDescriptor;
+class Message;
+}
+
+namespace upb {
+class FieldDef;
+class Handlers;
+}
+
+namespace upb {
+namespace googlepb {
+
+// 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);
+
+// 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).
+const proto2::Message* GetProto1FieldPrototype(
+ const proto2::Message& m, const proto2::FieldDescriptor* f);
+
+} // namespace googlepb
+} // namespace upb
+
+#endif // UPB_GOOGLE_PROTO1_H_
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback