Hi All,

I'd like to extend protocol buffers by something like this:

message DateFormat {
  optional int32 year = 1 [default = 1970; min = 1970; max = 2010];
  optional int32 month = 2 [min = 1; max = 12];
  optional int32 day = 3 [min = 1; max = 31];
  repeated OtherMsg foobar = 4 [max_size= 10]; 
}

And in the generated code:

DateFormat msg;
...

// returns true if all members are between max and min
bool success = msg.sanityCheck();

// calculate the maximum size of the serialized stream:
int max_bytestream_size = msg.MaxByteStreamSizeIfSerializedToString();

I'm just wondering what could be the easiest way to do this? I'm not too 
familiar with the deep details of protobufs.
My first approach was to write a small parser in python which generates 
helper classes. But it's not very nice, maybe there is nicer solution 
available.

Thx for hints,

Csaba


-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to