nooby question: output file extension from protoc

872 views
Skip to first unread message

Anthony Glaser

unread,
Dec 5, 2013, 5:07:22 PM12/5/13
to prot...@googlegroups.com
By default the protoc commands outputs a file with an extension of .pb.cc from a file foo.proto with --cpp_out .  Is there a way to make the output foo.pb.cpp from that same foo.proto instead of foo.pb.cc? I looked through the configure file and didn't see a way to do it, googled around a bit and came up empty there as well.

If you could point me in the right direction where to look for this info I would appreciate it greatly.

Thank you for your help.

Dan Schmidt Valle

unread,
Dec 6, 2013, 3:49:44 AM12/6/13
to Anthony Glaser, prot...@googlegroups.com
Don't know about the internals, but it should be quite easy to write a script round the command that renames after the generation of the file.


--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to protobuf+u...@googlegroups.com.
To post to this group, send email to prot...@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/groups/opt_out.

Dan

unread,
Dec 8, 2013, 8:37:55 AM12/8/13
to prot...@googlegroups.com
Digging through the source code, there's a function called CppGenerator::Generate in src/google/protobuf/compiler/cpp/cpp_generator.cc that has the extensions. You could change there the .cc to .cpp. A patch to allow the extension would be nice, I guess. Not sure how straight-forward it'd be.
Reply all
Reply to author
Forward
0 new messages