diff options
Diffstat (limited to 'tools/streaming_proto/stream_proto_utils.h')
-rw-r--r-- | tools/streaming_proto/stream_proto_utils.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tools/streaming_proto/stream_proto_utils.h b/tools/streaming_proto/stream_proto_utils.h new file mode 100644 index 000000000000..5297eccba849 --- /dev/null +++ b/tools/streaming_proto/stream_proto_utils.h @@ -0,0 +1,29 @@ +#include <stdint.h> + +#include "google/protobuf/compiler/plugin.pb.h" +#include "google/protobuf/io/zero_copy_stream_impl.h" + +namespace android { +namespace stream_proto { + +using namespace google::protobuf; +using namespace google::protobuf::compiler; +using namespace std; + +/** + * Get encoded field id from a field. + */ +uint64_t get_field_id(const FieldDescriptorProto& field); + +/** + * Get the string name for a field. + */ +string get_proto_type(const FieldDescriptorProto& field); + +/** + * See if this is the file for this request, and not one of the imported ones. + */ +bool should_generate_for_file(const CodeGeneratorRequest& request, const string& file); + +} // stream_proto +} // android |