Re: generating proto documentation

2009-03-17 Thread Mark Assad
HI,
  I have a bad solution. What I've been doing has been generating the .cc/.h
files, and then using doxygen to document those classes. You can document
C++ classes from files other than the header files that define the classes.
 It's messy, error prone, and you end up with a lot of extra methods
document that you really don't want. In summary, I'd suggest doing it
another way.  The detailed message documentation is lost in a sea of
undocumented methods.

  In the past, I have started working on patching doxygen to read and parse
.proto files. I didn't get as far as I would have liked. I also looked at
using the compiler/parser that is part of the protobuf source code, but that
strips out the comments.  My other thought was to use a custom option for
the comment string. Then writer a Python script that read in the descriptor
proto file, and generated documentation from that.  The other thought I had
was to patch the C++ code generator class to generate comments in the source
files in the doxygen format, but I didn't want to tie the code generator to
a documentation format.

 I still think the best option would be to update doxygen to support reading
the .proto files, but it is also the most work (maybe not in the long
term).

Mark


On Tue, Mar 17, 2009 at 8:28 PM, bart van deenen
bart.vandee...@gmail.comwrote:


 Hi all

 How do you document .proto files? I'd love to really define our
 protocol with javadoc/qtdoc/doxygen tags inside the .proto files, and
 generate html documentation from that.

 Does anyone already have a solution, or something in the works that we
 can improve on?
 


--~--~-~--~~~---~--~~
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: generating proto documentation

2009-03-17 Thread bart van deenen

I'm thinking of writing some scripting stuff, convert 'message' to
'struct' and stuff like that, and see how far I'll get with converting
proto files into some sort of pseudo-c. I think I'll mogrify the
'optional' and 'required' and 'repeated' flags to some custom doxygen
tags. As soon as I have something, I'll put it on github as an
opensource project.

On Mar 17, 10:49 am, Mark Assad mas...@gmail.com wrote:
 HI,
   I have a bad solution. What I've been doing has been generating the .cc/.h
 files, and then using doxygen to document those classes. You can document
 C++ classes from files other than the header files that define the classes.
  It's messy, error prone, and you end up with a lot of extra methods
 document that you really don't want. In summary, I'd suggest doing it
 another way.  The detailed message documentation is lost in a sea of
 undocumented methods.

   In the past, I have started working on patching doxygen to read and parse
 .proto files. I didn't get as far as I would have liked. I also looked at
 using the compiler/parser that is part of the protobuf source code, but that
 strips out the comments.  My other thought was to use a custom option for
 the comment string. Then writer a Python script that read in the descriptor
 proto file, and generated documentation from that.  The other thought I had
 was to patch the C++ code generator class to generate comments in the source
 files in the doxygen format, but I didn't want to tie the code generator to
 a documentation format.

  I still think the best option would be to update doxygen to support reading
 the .proto files, but it is also the most work (maybe not in the long
 term).

 Mark

 On Tue, Mar 17, 2009 at 8:28 PM, bart van deenen
 bart.vandee...@gmail.comwrote:



  Hi all

  How do you document .proto files? I'd love to really define our
  protocol with javadoc/qtdoc/doxygen tags inside the .proto files, and
  generate html documentation from that.

  Does anyone already have a solution, or something in the works that we
  can improve on?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



invalidTag() exception

2009-03-17 Thread kolahdouzan

I have a C++ code that generates a buffer and sends it to a multicast
address, and Java based receiver that is supposed to get the buffer
and parse it. The problem I am facing is that after issuing
message.parseFrom(received_buf) or message.Builder.mergeFrom
(received_buf), I get the Error:
com.google.protobuf.InvalidProtocolBufferException: Protocol message
contained an invalid tag (zero). exception. I did verify the received
buffer, it has the same length and is identical byte to byte with what
the sender is sending. Also, I have the receiver side in C++, and that
one has no problem whatsoever.
--~--~-~--~~~---~--~~
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: invalidTag() exception

2009-03-17 Thread kolahdouzan

Never mind the question, I found out what the problem was. The buffer
defined for the datagram packet was clearly larger than what I was
expecting to get, and the parser was reading the whole buffer. Once I
copy that buffer to a temporary buffer, up to the number of bytes I am
receiving, and use the temporary buffer for the parser, everything
works fine.


On Mar 17, 12:38 pm, kolahdou...@gmail.com wrote:
 I have a C++ code that generates a buffer and sends it to a multicast
 address, and Java based receiver that is supposed to get the buffer
 and parse it. The problem I am facing is that after issuing
 message.parseFrom(received_buf) or message.Builder.mergeFrom
 (received_buf), I get the Error:
 com.google.protobuf.InvalidProtocolBufferException: Protocol message
 contained an invalid tag (zero). exception. I did verify the received
 buffer, it has the same length and is identical byte to byte with what
 the sender is sending. Also, I have the receiver side in C++, and that
 one has no problem whatsoever.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---