On Mon, Jul 1, 2013 at 3:20 AM, <[email protected]> wrote: > Hi all, > > I wan't to add numeric range information to fields according to the > following syntax: > > message MyMessage > { > uint32 field1 = 1 > [default = 0, > (myext).min = 0, > (myext).max = 0xffff]; > > double field2 = 2 > [default = 0.0, > (myext).min = 0.0, > (myext).max = 9999.99999999]; > } > > However, since options must have a type I end up with the following > solution: > > message MyMessage > { > uint32 field1 = 1 > [default = 0, > (myext).uint32Min = 0, > (myext).uint32Max = 0xffff]; > > > double field2 = 2 > [default = 0.0, > (myext).doubleMin = 0.0, > (myext).doubleMax = 9999.99999999]; > } > > > Do you know if it is possible to create options that are typeless as the > "default" parameter? > I think the answer is "no". Custom options are essentially protobuf messages and protobuf doesn't support dynamic field type.
> > Kind regards, > Jonas Hansson > > -- > 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 [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/protobuf. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/protobuf. For more options, visit https://groups.google.com/groups/opt_out.
