[Yunq] Add support for repeated nested fields
This commit is contained in:
parent
05f2403dc2
commit
9c860dd6a4
14 changed files with 207 additions and 61 deletions
|
|
@ -63,7 +63,7 @@ glcr::Status {{message.name}}::ParseFromBytesInternal(const yunq::MessageView& m
|
|||
{%- if not field.repeated %}
|
||||
message.ReadMessage<{{field.cpp_type()}}>({{field.number}}, {{field.name}}_);
|
||||
{%- else %}
|
||||
message.ReadMessageRepeated<{{field.cpp_type()}}>({{field.number}}, {{field.name}}_);
|
||||
message.ReadRepeatedMessage<{{field.cpp_type()}}>({{field.number}}, {{field.name}}_);
|
||||
{% endif %}
|
||||
|
||||
{%- elif field.type != Type.CAPABILITY %}
|
||||
|
|
@ -105,10 +105,12 @@ uint64_t {{message.name}}::SerializeInternal(yunq::Serializer& serializer) const
|
|||
|
||||
{%- else %}
|
||||
|
||||
{%- if field.type != Type.CAPABILITY %}
|
||||
serializer.WriteRepeated<{{field.cpp_type()}}>({{field.number}}, {{field.name}}_);
|
||||
{%- else %}
|
||||
{%- if field.type == Type.MESSAGE %}
|
||||
serializer.WriteRepeatedMessage<{{field.cpp_type()}}>({{field.number}}, {{field.name}}_);
|
||||
{%- elif field.type != Type.CAPABILITY %}
|
||||
serializer.WriteRepeatedCapability({{field.number}}, {{field.name}}_);
|
||||
{%- else %}
|
||||
serializer.WriteRepeated<{{field.cpp_type()}}>({{field.number}}, {{field.name}}_);
|
||||
{%- endif %}
|
||||
|
||||
{%- endif %}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue