Hate to tell you this, but this looks pretty much identical to the
TextFormat (text_format.{cc,h}) that's already provided by the library (and
the wrapper methods Message::DebugString() and friends). Or are you using
lite mode, which doesn't support this because it's reflection based?

(Generating code for this is probably a non-starter due to the amount of
additional code that would be produced. When you have lots of messages, it's
typically cheaper to just use non-lite mode than to generate special code
for each type.)

On Fri, Nov 19, 2010 at 4:17 PM, Casey Johnson <[email protected]> wrote:

> Hi! My name is Casey Johnson and I am currently working as an intern
> at a company named MusicMasterMind. Recently, my boss asked me to edit
> the google protocol generator for the c++ language to make an extra
> function for the purpose of debugging. The function is created for
> every message and enum and allows the user to receive a string that
> represents that message/enum.
>
> For example, let's consider the addressbook example from the
> tutorials. If a person were to call the void toString(string &str)
> const function, the parameter string would be concatenated to print
> out something similar when the addressbook c++ tutorial demonstrates
> how to write the addressbook to the console.
>
> The following is an example of how the string is constructed based on
> the address book example from the c++ tutorial:
> "number: 805 789 8878
>  Phone_Type: HOME
>  id: 89098
>  name: Casey
>  email: [email protected]"
>
> I would appreciate it if someone could point me somewhere where I can
> submit this patch so that you can take a look at the edited
> cpp_message.cc, cpp_message.h, and cpp_file.c files and try out the
> usefulness of the function to make a decision if google will include
> this function in their next release.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<protobuf%[email protected]>
> .
> 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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.

Reply via email to