[protobuf] Eliminate various strings from compiled binary
Hello, I'm using GPB in a visual studio project. Despite doing a release build with as many optimizations as possible, I've noticed that resulting binaries have strings inside of them that contain the file names for each .cc file resulting from each .proto file, lots of error messages, etc. I think these strings all stem from the code using GOOGLE_LOG, which ends up using __FILE__ and __LINE__, and using whatever logged string is passed along. I'm trying to reduce code size as much as possible, and so I really don't want my release build to include all of those extra strings when they really aren't needed for the execution of the program. Is there a supported way to reduce the amount of string-clutter in compiled, release binaries? Thank you! Pete -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To post to this group, send email to protobuf@googlegroups.com. To unsubscribe from this group, send email to protobuf+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.
[protobuf] GZip Stream examples
Hi, Are there any examples on how to use GzipOUtputStream in ProtoBuf? I've manages so far combo: _raw_out.reset(new ::google::protobuf::io::OstreamOutputStream(_output)); _coded_out.reset(new ::google::protobuf::io::CodedOutputStream(_raw_out.get())); (both objects are boost::shared_pointer's). How am I supposed to use the GzipOutputStream here? thanks. -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To post to this group, send email to protobuf@googlegroups.com. To unsubscribe from this group, send email to protobuf+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.
Re: [protobuf] GZip Stream examples
You wrap GZipOutputStream around your underlying output stream, and use the GZipOutputStream with CodedOutputStream instead: On Tue, Mar 8, 2011 at 10:10 AM, ksamdev samvel.khalat...@gmail.com wrote: Hi, Are there any examples on how to use GzipOUtputStream in ProtoBuf? I've manages so far combo: _raw_out.reset(new ::google::protobuf::io::OstreamOutputStream(_output)); _compressed_out.reset(new ::google::protobuf::io::GZipOutputStream(_raw_out.get())); _coded_out.reset(new ::google::protobuf::io::CodedOutputStream(_compressed_out.get())); (both objects are boost::shared_pointer's). How am I supposed to use the GzipOutputStream here? thanks. -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To post to this group, send email to protobuf@googlegroups.com. To unsubscribe from this group, send email to protobuf+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/protobuf?hl=en. -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To post to this group, send email to protobuf@googlegroups.com. To unsubscribe from this group, send email to protobuf+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.
[protobuf] Re: Serializing part of a message and writing to disk
Thank you for the response. On Mar 8, 5:59 am, Evan Jones ev...@mit.edu wrote: On Mar 8, 2011, at 2:12 , Linus wrote: At a later stage in the code, the values of (say) Message A are changed by the user. Is there a way of modifying only Message A and updating the file on disk, without loading the composite Message C updating the Message A and flushing entire contents to disk again? Not really: protocol buffers are a variable length encoding, so changing Message A could change the length, so overwriting doesn't really work, at least not without additional checks and effort. Evan --http://evanjones.ca/ -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To post to this group, send email to protobuf@googlegroups.com. To unsubscribe from this group, send email to protobuf+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.
Re: [protobuf] GZip Stream examples
Cool, it worked great. Can I mix Raw out and Gzip out in the file? Say, I'd like to write a raw number (4 bytes) at the beginning of the file and then add the message through the Gzip stream. Visually, my file would look like: . where first - 4 bytes written with raw_out and the rest: GG - with Gzip Stream. Of course, the reading sequence would be: 1. read 2. keep reading the rest G through Gzip Stream. -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To post to this group, send email to protobuf@googlegroups.com. To unsubscribe from this group, send email to protobuf+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.
Re: [protobuf] GZip Stream examples
I don't think there are any problems with having a raw prefix, and just wrapping GZipInputStream around the raw input stream after it's been read, but that sounds pretty messy. It seems easier to just make the whole thing a gzip stream - it can then also be easily read by other tools that use zlib. On Tue, Mar 8, 2011 at 8:09 PM, ksamdev samvel.khalat...@gmail.com wrote: Cool, it worked great. Can I mix Raw out and Gzip out in the file? Say, I'd like to write a raw number (4 bytes) at the beginning of the file and then add the message through the Gzip stream. Visually, my file would look like: . where first - 4 bytes written with raw_out and the rest: GG - with Gzip Stream. Of course, the reading sequence would be: 1. read 2. keep reading the rest G through Gzip Stream. -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To post to this group, send email to protobuf@googlegroups.com. To unsubscribe from this group, send email to protobuf+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/protobuf?hl=en. -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To post to this group, send email to protobuf@googlegroups.com. To unsubscribe from this group, send email to protobuf+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.
[protobuf] Failing java tests
I can build and install from the latest version, but both the C and Java tests fail (on OS/X): make check mv: rename src/.deps/gtest.Tpo to src/.deps/gtest.Plo: No such file or directory make[3]: *** [src/gtest.lo] Error 1 mvn test Tests in error: testDynamicMessageAccessors(com.google.protobuf.DynamicMessageTest) testDynamicMessageExtensionAccessors(com.google.protobuf.DynamicMessageTest) testDynamicMessageRepeatedSetters(com.google.protobuf.DynamicMessageTest) testDynamicMessageDefaults(com.google.protobuf.DynamicMessageTest) testDynamicMessageSerialization(com.google.protobuf.DynamicMessageTest) testDynamicMessageParsing(com.google.protobuf.DynamicMessageTest) testDynamicMessagePackedParsing(com.google.protobuf.DynamicMessageTest) testDynamicMessageCopy(com.google.protobuf.DynamicMessageTest) testToBuilder(com.google.protobuf.DynamicMessageTest) testParseKnownAndUnknown(com.google.protobuf.UnknownFieldSetTest) Tests run: 252, Failures: 0, Errors: 10, Skipped: 0 -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To post to this group, send email to protobuf@googlegroups.com. To unsubscribe from this group, send email to protobuf+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.
[protobuf] Specification for the .proto file?
My goal is to port Google's libphonenumber to java-me, so I can use it on a BlackBerry. The current subgoal is to get a Protocol Buffer compiler for java-me that is suitable for porting libphonenumber. There are four existing libraries mentioned on the wiki. I've tried two of them that appeared to have recent development, but ran into trouble. protobuf-j2me on Google Code required a significant number of extra tools to be installed just to build it. Since I am willing to use java to target java-me, I was a little put off by the requirement to use python, and install a whole tool management system in the form of 'gyp' I wasn't able to successfully build this project on my windows box. protobuf-j2me on github. It appears this is the same as the other protobuf-j2me listed above. Why are both listed on the wiki? protobuf-javame on Google Code appears to be a pure java implementation. I was able to run the compiler on my windows box, but it doesn't support comments or default values in the .proto file, I get the impression that those are more recent additions to the protocol buffers spec. After pruning those parts out of the libphonenumber proto files, I also found that this compiler doesn't offer a way to copy protocol buffer message objects, and all the fields are immutable. Both of those conflict with libphonenumber's use of protocolbuffer messages. I looked at fixing the parser to support more recent versions of protocol buffers, but discovered it was primarily driven by inscrutable regex patterns. swingme on Sourceforge appeared a little too generic to me. It says This is a 'bastardized' version of Google Protocol Buffers that allows for Anonymous Objects. so I didn't even try it, since I want to use the real thing. It looks like I need to write my own java-me target for Protocol Buffers. I would like it to be a self contained java codebase, so it seems antlr + stringtemplate are the right tools here.I am looking for a EBNF style specification of the .proto file, but I can't seem to find one. I see the documentation, which covers many examples, but I want an actual spec for the file. I found some pretty detailed information on this prolog page -- http://www.swi-prolog.org/pldoc/package/protobufs.html -- a lot of the text appears to have been written by Google in fact. There are referenced to the protocol buffers spec, too. But I am having trouble finding something similar on the protocol buffers site.So where do I find the spec? -- You received this message because you are subscribed to the Google Groups Protocol Buffers group. To post to this group, send email to protobuf@googlegroups.com. To unsubscribe from this group, send email to protobuf+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.