Re: [protobuf] Allocator Support for strings

2011-07-13 Thread Gokulakannan Somasundaram
Thanks a lot for the reply. Gokul. On Tue, Jul 12, 2011 at 3:23 PM, Pherl Liu wrote: > In the common.h, we have a "using namespace std;", and we use "string" > directly in runtime libraries. However, we use "::std::string" in generated > file; you need to modify the proto compiler to support d

Re: [protobuf] Allocator Support for strings

2011-07-12 Thread Pherl Liu
In the common.h, we have a "using namespace std;", and we use "string" directly in runtime libraries. However, we use "::std::string" in generated file; you need to modify the proto compiler to support different string allocators. We do have custom allocator support in our TODO list internally, bu

Re: [protobuf] Allocator Support for strings

2011-07-11 Thread Jason Hsueh
+Pherl Hm, not sure how feasible this is. The code generator emits references to ::std::string. I suppose there might be some hack like adding a typedef of ::std::string to ::protobuf::string in one of the header stubs; then you could override that (or perhaps use some kind of preprocessor macro,

Re: [protobuf] Allocator Support for strings

2011-07-08 Thread Gokulakannan Somasundaram
Thanks a lot for the reply. I understood that part. Currently in the .proto file, there is a string definition which gets translated to std::string. What we actually need is a typedef which can be configured as per the end user wish, before building the protobuf. But can i get some assistance on ho

Re: [protobuf] Allocator Support for strings

2011-07-08 Thread Jason Hsueh
We don't support this at this time - the primary problem is that specifying an allocator for C++ string's produces a completely new type. This means allocators can't simply be injected into a particularly message instance; instead it would have to be part of the message definition. On Wed, Jul 6,