Hy, I am using protocol buffers in my current project. I am coding it with Qt/C++. My application must handle intensive RPC communications between clients and server. RPC is implemented on the basis of protocol buffers. Because application internal data structures uses QString's and QByteArray's, when passing data to protobuf generated message classes I must accomplish lot of conversions from QString to std::string. This involves converting and making deep copy of QString bytes to QByteArray and then another deep copy to std::string. So two deep copies ... for each string field. I was thinking about modifying protobuf compiler to generate QT/C++ based message classes but found that WireFormat classes also make use of std::string's, so it seems that I must modify entire protobuf library :( if I want to take data directly from QByteArray. Maybe it would by wise to introduce some additional methods in future, like:
// Additional methods static void WriteString(field_number, const char *value, int size, output); static void WriteBytes (field_number, const char *value, int size, output); // Current methods static void WriteString(field_number, const string& value, output); static void WriteBytes (field_number, const string& value, output); This would allow not to rely only on std string but also use any other structures for storing string data. So protobuf library coud be more versatile. What do you think? Maybe someone was solving same problems as me? -- You received this message because you are subscribed to the Google Groups "Protocol Buffers" group. To post to this group, send email to proto...@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.