I want to access to field by the string. Your answer is by the class name. 
I use this solution at now.

On Tuesday, July 11, 2023 at 7:43:17 PM UTC+3:30 Adam Cozzette wrote:

> You can reference Person::kDayFieldNumber to get the field number, and 
> then look up the field descriptor with something like 
> Person::descriptor()->FindFieldByNumber(Person::kDayFieldNumber).
>
> On Tue, Jul 11, 2023 at 12:51 AM Shahab Nassiri <shahab...@gmail.com> 
> wrote:
>
>> Hi 
>>
>> I want to set numeric_range on protobuf field and read the defined 
>> numeric_range in runtime. I use the file descriptor and field descriptor 
>> for this goal.
>>
>> But i have a problem. I don't want to hard code the name of class 
>> variable.
>>
>> I express one example about this. I define a day field in proto file and 
>> set numeric_range on it as following.
>>
>> message Person{
>>       int32 day  = 1; [range_min = 5; range_max = 10]
>> }
>>
>> now, I want to read the defined numeric_range in runtime.
>>
>> for this goal, i must determine the variable name as hard code.
>>
>> is there any way for determining the variable as string? 
>>
>>
>> thank you 
>>
>> -- 
>> 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+u...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/protobuf/4f45d34e-cee0-44c5-a10c-b3806f72e3acn%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/protobuf/4f45d34e-cee0-44c5-a10c-b3806f72e3acn%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/0e715757-e1da-4d94-8c20-ef32a2b5293en%40googlegroups.com.

Reply via email to