[protobuf] Reading and Writing using CodedOutputStream and CodedInputStream

2010-08-29 Thread Birch
I am having some issues with the following three methods. I need the ability to read and write any arbitrary protobuf message, that has already been deserialized. It is assumed that I will always only read or write the same type. So I have three methods; write(location, data), write(location,

[protobuf] Re: Reading and Writing using CodedOutputStream and CodedInputStream

2010-08-29 Thread Birch
I resolved this issue by slightly adjusting my logic, and changing the way in which i deal with file handling. Now I just have to get it to honor my append parameter so I can expand the file, and eventually truncate it Here is the current code: Birch void FileLogger::write(const string

[protobuf] Re: Reading and Writing using CodedOutputStream and CodedInputStream

2010-08-29 Thread Birch
Ok, here is the final working code which handles the append and purge boolean parameters. If anyone can provide feedback, comments, suggestions, snotty remarks, or anything, I would love to hear them. Especially love to know if you have a more efficient way. Birch void FileLogger::write(const

[protobuf] Re: Reading and Writing using CodedOutputStream and CodedInputStream

2010-08-29 Thread Birch
Ok, I incorporated some suggestions from a someone who replied, but I still core dump in the following method: bool flag = cis-ReadRaw(ret.back(), size); Any ideas? Code is below. Thanks! Birch void FileLogger::write(const string location, const string data,