Michael,
On Tue, Jan 1, 2013 at 9:19 AM, MichaelMelamud <
00m...@gmail.com> wrote:
> i am working on a embedded platform,so using protobuf as
> is ,is a kind of problematic.
Have you considered using "optimize_for = LITE_RUNTIME"?
https://developers.google.com/protocol-buffers/docs/proto
Alternatively, would an existing open source project such as
protobuf-embedded-c meet your needs? (I have never used this, so I
have no idea if it is a good candidate or not -- just the #1 result
for "protobuf embeded".)
http://code.google.com/p/protobuf-embedded-c/
If neither of these work, can you describe the expectations of your
embedded environment in greater detail?
> any suggestions on how can i decode the data?
Have you considered looking at the code in the open source protocol
buffer implementation?
> any tutorial or examples?
The page you linked to is the best resource I know of (and reasonably
complete IMO). If you are going to roll your own, have you considered
using the Coded{Input,Output}Stream interface to minimize the amount
of code you need to write (and maximize compatibility)?
Another idea is to use the google's protobuf implementation to
serialize example messages and then make sure your re-implementation
can deserialize them.
> Also is there an option in the protobuf when preparing the data not to
> encode it and leave it as is ?
What do you mean by leaving the data "as-is"? Some serialization
format (field "tags", value length tracking, number
formatting/endianness, etc) must be agreed upon by the code that
serializes and deserializes the messages.
Maybe you are looking for a way to avoid varint encoding? If so, I
guess you could check out the fixed{32,64} datatype which is "stored
in little-endian byte order" (based on the docs in the URL you
reference).
Goodluck.
-Andy