From 58954f4fce5a294914a0a99579d559f98bf978f9 Mon Sep 17 00:00:00 2001 From: owent <> Date: Wed, 24 Jul 2024 22:34:04 +0800 Subject: [PATCH 01/10] Prepare v2.18.0 --- HISTORY.md | 10 +- LICENSE | 2 +- README.md | 51 +-- header/org/xresloader/Xresloader.java | 314 +++++++++++++++--- pom.xml | 2 +- sample/cxx/v2/kind.pb.cc | 125 +++---- sample/cxx/v2/kind.pb.h | 4 +- sample/cxx/v3/kind.pb.cc | 166 ++++----- sample/cxx/v3/kind.pb.h | 8 +- sample/proto_v2/arr_in_arr_cfg.bin | Bin 866 -> 868 bytes sample/proto_v2/arr_in_arr_cfg.lua | 6 +- sample/proto_v2/arr_in_arr_cfg.xml | 8 +- sample/proto_v2/csv/ArrInArrCfgRec.csv | 2 +- .../csv/Private/ConfigRec/ArrInArr.cpp | 2 +- .../csv/Private/ConfigRec/ArrInArrCfg.cpp | 2 +- .../csv/Private/ConfigRec/Dep2Cfg.cpp | 2 +- .../csv/Private/ConfigRec/EventCfg.cpp | 2 +- .../csv/Private/ConfigRec/EventRewardItem.cpp | 2 +- .../csv/Private/ConfigRec/EventRuleItem.cpp | 2 +- .../ConfigRec/KeepOrStripEmptyListCfg.cpp | 2 +- .../csv/Private/ConfigRec/RoleUpgradeCfg.cpp | 2 +- .../csv/Private/ConfigRec/TestMsgVerifier.cpp | 2 +- .../proto_v2/csv/Public/ConfigRec/ArrInArr.h | 2 +- .../csv/Public/ConfigRec/ArrInArrCfg.h | 2 +- .../proto_v2/csv/Public/ConfigRec/Dep2Cfg.h | 2 +- .../proto_v2/csv/Public/ConfigRec/EventCfg.h | 2 +- .../csv/Public/ConfigRec/EventRewardItem.h | 2 +- .../csv/Public/ConfigRec/EventRuleItem.h | 2 +- .../ConfigRec/KeepOrStripEmptyListCfg.h | 2 +- .../csv/Public/ConfigRec/RoleUpgradeCfg.h | 2 +- .../csv/Public/ConfigRec/TestMsgVerifier.h | 2 +- sample/proto_v2/event_cfg.bin | Bin 420 -> 420 bytes sample/proto_v2/event_cfg.lua | 2 +- sample/proto_v2/json/ArrInArrCfg.json | 10 +- sample/proto_v2/json/KindConst.cpp | 2 +- sample/proto_v2/json/KindConst.h | 2 +- .../json/Private/ConfigRec/ArrInArr.cpp | 2 +- .../json/Private/ConfigRec/ArrInArrCfg.cpp | 2 +- .../json/Private/ConfigRec/Dep2Cfg.cpp | 2 +- .../json/Private/ConfigRec/EventCfg.cpp | 2 +- .../Private/ConfigRec/EventRewardItem.cpp | 2 +- .../json/Private/ConfigRec/EventRuleItem.cpp | 2 +- .../ConfigRec/KeepOrStripEmptyListCfg.cpp | 2 +- .../json/Private/ConfigRec/RoleUpgradeCfg.cpp | 2 +- .../Private/ConfigRec/TestMsgVerifier.cpp | 2 +- .../proto_v2/json/Public/ConfigRec/ArrInArr.h | 2 +- .../json/Public/ConfigRec/ArrInArrCfg.h | 2 +- .../proto_v2/json/Public/ConfigRec/Dep2Cfg.h | 2 +- .../proto_v2/json/Public/ConfigRec/EventCfg.h | 2 +- .../json/Public/ConfigRec/EventRewardItem.h | 2 +- .../json/Public/ConfigRec/EventRuleItem.h | 2 +- .../ConfigRec/KeepOrStripEmptyListCfg.h | 2 +- .../json/Public/ConfigRec/RoleUpgradeCfg.h | 2 +- .../json/Public/ConfigRec/TestMsgVerifier.h | 2 +- sample/proto_v2/keep_empty_list_cfg.bin | Bin 498 -> 498 bytes sample/proto_v2/keep_empty_list_cfg.lua | 2 +- sample/proto_v2/kind.desc.json | 10 +- sample/proto_v2/kind.desc.lua | 6 + sample/proto_v2/kind.pb | Bin 4918 -> 4927 bytes sample/proto_v2/kind.proto | 2 +- sample/proto_v2/kind_option.js | 6 + sample/proto_v2/kind_option.lua | 6 + sample/proto_v2/kind_option.mod.lua | 6 + sample/proto_v2/process_by_script.bin | 2 +- sample/proto_v2/process_by_script.json | 2 +- sample/proto_v2/process_by_script.lua | 2 +- sample/proto_v2/role_cfg.amd.js | 2 +- sample/proto_v2/role_cfg.bin | Bin 1397 -> 1397 bytes sample/proto_v2/role_cfg.js | 2 +- sample/proto_v2/role_cfg.json | 2 +- sample/proto_v2/role_cfg.lua | 2 +- sample/proto_v2/role_cfg.msgpack.bin | Bin 3393 -> 3393 bytes sample/proto_v2/role_cfg.n.js | 2 +- sample/proto_v2/role_cfg.xml | 2 +- sample/proto_v2/role_cfg_module.lua | 2 +- sample/proto_v2/role_upgrade_cfg.bin | Bin 1550 -> 1550 bytes sample/proto_v2/role_upgrade_cfg.json | 2 +- sample/proto_v2/role_upgrade_cfg.lua | 2 +- sample/proto_v2/strip_list_tail_cfg.bin | Bin 490 -> 490 bytes sample/proto_v2/strip_list_tail_cfg.lua | 2 +- sample/proto_v3/arr_in_arr_cfg.bin | Bin 860 -> 862 bytes sample/proto_v3/arr_in_arr_cfg.lua | 6 +- sample/proto_v3/arr_in_arr_cfg.xml | 8 +- sample/proto_v3/csv/ArrInArrCfgRec.csv | 2 +- .../csv/Private/ConfigRec/ArrInArr.cpp | 2 +- .../csv/Private/ConfigRec/ArrInArrCfg.cpp | 2 +- .../csv/Private/ConfigRec/Dep2Cfg.cpp | 2 +- .../proto_v3/csv/Private/ConfigRec/DepCfg.cpp | 2 +- .../csv/Private/ConfigRec/EventCfg.cpp | 2 +- .../csv/Private/ConfigRec/EventRewardItem.cpp | 2 +- .../csv/Private/ConfigRec/EventRuleItem.cpp | 2 +- .../ConfigRec/GoogleProtobufDuration.cpp | 2 +- .../ConfigRec/GoogleProtobufTimestamp.cpp | 2 +- .../ConfigRec/KeepOrStripEmptyListCfg.cpp | 2 +- .../csv/Private/ConfigRec/RoleCfg.cpp | 2 +- .../csv/Private/ConfigRec/RoleUpgradeCfg.cpp | 2 +- .../csv/Private/ConfigRec/TestMsgVerifier.cpp | 2 +- .../proto_v3/csv/Public/ConfigRec/ArrInArr.h | 2 +- .../csv/Public/ConfigRec/ArrInArrCfg.h | 2 +- .../proto_v3/csv/Public/ConfigRec/Dep2Cfg.h | 2 +- sample/proto_v3/csv/Public/ConfigRec/DepCfg.h | 2 +- .../proto_v3/csv/Public/ConfigRec/EventCfg.h | 2 +- .../csv/Public/ConfigRec/EventRewardItem.h | 2 +- .../csv/Public/ConfigRec/EventRuleItem.h | 2 +- .../Public/ConfigRec/GoogleProtobufDuration.h | 2 +- .../ConfigRec/GoogleProtobufTimestamp.h | 2 +- .../ConfigRec/KeepOrStripEmptyListCfg.h | 2 +- .../proto_v3/csv/Public/ConfigRec/RoleCfg.h | 2 +- .../csv/Public/ConfigRec/RoleUpgradeCfg.h | 2 +- .../csv/Public/ConfigRec/TestMsgVerifier.h | 2 +- sample/proto_v3/event_cfg.bin | Bin 420 -> 420 bytes sample/proto_v3/event_cfg.lua | 2 +- sample/proto_v3/json/ArrInArrCfg.json | 10 +- sample/proto_v3/json/KindConst.cpp | 2 +- sample/proto_v3/json/KindConst.h | 2 +- .../json/Private/ConfigRec/ArrInArr.cpp | 2 +- .../json/Private/ConfigRec/ArrInArrCfg.cpp | 2 +- .../json/Private/ConfigRec/Dep2Cfg.cpp | 2 +- .../json/Private/ConfigRec/DepCfg.cpp | 2 +- .../json/Private/ConfigRec/EventCfg.cpp | 2 +- .../Private/ConfigRec/EventRewardItem.cpp | 2 +- .../json/Private/ConfigRec/EventRuleItem.cpp | 2 +- .../ConfigRec/GoogleProtobufDuration.cpp | 2 +- .../ConfigRec/GoogleProtobufTimestamp.cpp | 2 +- .../ConfigRec/KeepOrStripEmptyListCfg.cpp | 2 +- .../json/Private/ConfigRec/RoleCfg.cpp | 2 +- .../json/Private/ConfigRec/RoleUpgradeCfg.cpp | 2 +- .../Private/ConfigRec/TestMsgVerifier.cpp | 2 +- .../proto_v3/json/Public/ConfigRec/ArrInArr.h | 2 +- .../json/Public/ConfigRec/ArrInArrCfg.h | 2 +- .../proto_v3/json/Public/ConfigRec/Dep2Cfg.h | 2 +- .../proto_v3/json/Public/ConfigRec/DepCfg.h | 2 +- .../proto_v3/json/Public/ConfigRec/EventCfg.h | 2 +- .../json/Public/ConfigRec/EventRewardItem.h | 2 +- .../json/Public/ConfigRec/EventRuleItem.h | 2 +- .../Public/ConfigRec/GoogleProtobufDuration.h | 2 +- .../ConfigRec/GoogleProtobufTimestamp.h | 2 +- .../ConfigRec/KeepOrStripEmptyListCfg.h | 2 +- .../proto_v3/json/Public/ConfigRec/RoleCfg.h | 2 +- .../json/Public/ConfigRec/RoleUpgradeCfg.h | 2 +- .../json/Public/ConfigRec/TestMsgVerifier.h | 2 +- sample/proto_v3/keep_empty_list_cfg.bin | Bin 490 -> 490 bytes sample/proto_v3/keep_empty_list_cfg.lua | 2 +- sample/proto_v3/kind.desc.json | 12 + sample/proto_v3/kind.desc.lua | 22 ++ sample/proto_v3/kind.pb | Bin 5616 -> 5635 bytes sample/proto_v3/kind.proto | 4 +- sample/proto_v3/kind_option.js | 22 ++ sample/proto_v3/kind_option.lua | 22 ++ sample/proto_v3/kind_option.mod.lua | 22 ++ sample/proto_v3/process_by_script.bin | 2 +- sample/proto_v3/process_by_script.json | 2 +- sample/proto_v3/process_by_script.lua | 2 +- sample/proto_v3/role_cfg.amd.js | 2 +- sample/proto_v3/role_cfg.bin | Bin 1397 -> 1397 bytes sample/proto_v3/role_cfg.js | 2 +- sample/proto_v3/role_cfg.json | 2 +- sample/proto_v3/role_cfg.lua | 2 +- sample/proto_v3/role_cfg.msgpack.bin | Bin 3393 -> 3393 bytes sample/proto_v3/role_cfg.n.js | 2 +- sample/proto_v3/role_cfg.xml | 2 +- sample/proto_v3/role_cfg_module.lua | 2 +- sample/proto_v3/role_upgrade_cfg.bin | 2 +- sample/proto_v3/role_upgrade_cfg.json | 2 +- sample/proto_v3/role_upgrade_cfg.lua | 2 +- sample/proto_v3/strip_list_tail_cfg.bin | Bin 484 -> 484 bytes sample/proto_v3/strip_list_tail_cfg.lua | 2 +- .../xresloader/core/data/dst/DataDstJava.java | 80 ++++- .../xresloader/core/data/dst/DataDstPb.java | 171 +++++++++- .../core/data/dst/DataDstUEBase.java | 14 +- .../core/data/dst/DataDstUEJson.java | 2 +- .../core/data/dst/DataDstWriterNode.java | 76 +++++ tools/extensions.pb | Bin 2753 -> 3139 bytes tools/gen_header_v2.py | 2 +- 174 files changed, 1060 insertions(+), 405 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index c5d87da7..18479e77 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -2,10 +2,16 @@ ## Unrelease +## 2.18.0 + +1. 增加插件 `org.xresloader.field_list_strip_option=LIST_STRIP_DEFAULT|LIST_STRIP_NOTHING|LIST_STRIP_TAIL|LIST_STRIP_ALL` 用于给单个字段设置数组裁剪。 +2. 增加插件 `org.xresloader.field_list_min_size=` 用于给单个字段数组最小长度要求。 +3. 增加插件 `org.xresloader.field_list_max_size=` 用于给单个字段数组最大长度要求。 + ## 2.17.1 -1. 修复数组别名丢失字段映射的问题 -2. 修复文本模式输出跨分组转出数据没清理干净的问题 +1. 修复数组别名丢失字段映射的问题。 +2. 修复文本模式输出跨分组转出数据没清理干净的问题。 ## 2.17.0 diff --git a/LICENSE b/LICENSE index cec721c2..bd419b92 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2023 xresloader +Copyright (c) 2024 xresloader Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 90403092..bda2a550 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ ![GitHub forks](https://img.shields.io/github/forks/xresloader/xresloader?style=social) ![GitHub stars](https://img.shields.io/github/stars/xresloader/xresloader?style=social) -文档: https://xresloader.atframe.work +文档: ## 主要功能 @@ -37,9 +37,9 @@ 本工程只是转表引擎工具,批处理(批量转表)工具的请参见: -+ 批量转表配置规范: https://github.com/xresloader/xresconv-conf -+ 跨平台GUI工具(Windows/Linux/macOS): https://github.com/xresloader/xresconv-gui -+ 跨平台命令行工具(兼容python2和python3,Windows/Linux/macOS): https://github.com/xresloader/xresconv-cli ++ 批量转表配置规范: ++ 跨平台GUI工具(Windows/Linux/macOS): ++ 跨平台命令行工具(兼容python2和python3,Windows/Linux/macOS): ## v2.11.0-rc2及以前版本更新迁移指引 @@ -139,7 +139,6 @@ echo " | .json | 视作json文件,数据源描述表为json内的第一层子节点名称 | 已实现(必须是UTF-8编码,不支持自动合表) | | .xml | 视作xml文件,数据源描述表为xml内的根节点下的子节点TagName,并且只取第一个 | (暂未支持) | - ## 数据源描述表配置项及示例 | 字段 | 简介 | 主配置 | 次配置 | 补充配置 | 说明 | @@ -187,12 +186,13 @@ echo " > 11. Encoding指明输出的字符串内容都是UTF-8编码。(目前最好只用UTF-8,因为protobuf里写死了UTF-8编码,其他编码不保证完全正常) 12. CallbackScript指向的脚本中,需要满足已下条件: - + 可使用 `gOurInstance` 访问数据源接口( `DataSrcImpl.getOurInstance()` ) - + 可使用 `gSchemeConf` 访问数据转换配置接口( `SchemeConf.getInstance()` ) - + 提供 `function initDataSource()` 函数,将在切换数据源时触发(文件名或sheet名)。 - + 提供 `function currentMessageCallback(originMsg, typeDesc)` 函数,将在切换数据源时触发(文件名或sheet名)。 - + `originMsg` 为原始数据结构的 `HashMap` 结构 - + `typeDesc` 为数据类型描述信息, `org.xresloader.core.data.dst.DataDstWriterNode.DataDstTypeDescriptor` 结构 + ++ 可使用 `gOurInstance` 访问数据源接口( `DataSrcImpl.getOurInstance()` ) ++ 可使用 `gSchemeConf` 访问数据转换配置接口( `SchemeConf.getInstance()` ) ++ 提供 `function initDataSource()` 函数,将在切换数据源时触发(文件名或sheet名)。 ++ 提供 `function currentMessageCallback(originMsg, typeDesc)` 函数,将在切换数据源时触发(文件名或sheet名)。 + + `originMsg` 为原始数据结构的 `HashMap` 结构 + + `typeDesc` 为数据类型描述信息, `org.xresloader.core.data.dst.DataDstWriterNode.DataDstTypeDescriptor` 结构 上面的配置中,数据从第3行读取,Key从第2行读取。那么第一行可以用来写一些说明或描述性数据。 @@ -226,7 +226,7 @@ echo " 转出的数据都采用header+data_block的形式。本工具并不规定怎么读取转表导出的数据,开发者可以按照转出的数据规则自由操作。 > 建议项目中使用导出的协议二进制或者msgpack。协议二进制可以用任意语言加载protobuf或者其他类似工具(如:[pbc][3] 或 [upb][2] )加载。 -> +> > 而其他导出类型可以用于一些外部工具的集成,比如基于Web的GM工具,基于Lua的远程调试工具等等。 但是为了使用方便,在[loader-binding](loader-binding)里提供了几种基本的读表方式。 @@ -329,18 +329,21 @@ validator: | 插件名称 | 插件功能 | | :----------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------: | -| org.xresloader.validator | 验证器,可填范围(log-high),message名,enum名。多个由 `|` 分隔。任意验证器通过检查则认为数据有效 | +| org.xresloader.validator | 验证器,可填范围(log-high),message名,enum名。多个由 `\|` 分隔。任意验证器通过检查则认为数据有效 | | org.xresloader.field_unique_tag | 设置唯一性检测Tag,多个相同tag的字段将合并并在转出数据时检测唯一性(可多个) | | org.xresloader.field_not_null | 如果配置了字段映射且某个数据行对应的oneof数据为空,则忽略此行 | -| org.xresloader.map_key_validator | 用于Map类型Key的验证器,可填范围(log-high),message名,enum名。多个由 `|` 分隔。任意验证器通过检查则认为数据有效 | -| org.xresloader.map_value_validator | 用于Map类型Value的验证器,可填范围(log-high),message名,enum名。多个由 `|` 分隔。任意验证器通过检查则认为数据有效 | +| org.xresloader.map_key_validator | 用于Map类型Key的验证器,可填范围(log-high),message名,enum名。多个由 `\|` 分隔。任意验证器通过检查则认为数据有效 | +| org.xresloader.map_value_validator | 用于Map类型Value的验证器,可填范围(log-high),message名,enum名。多个由 `\|` 分隔。任意验证器通过检查则认为数据有效 | | org.xresloader.field_description | 字段描述信息,会写入输出的header中和代码中 | | org.xresloader.field_alias | 字段别名,配合 **验证器** 功能,允许在数据源中直接填写别名来配置数据 | | org.xresloader.field_ratio | 字段放大,用于比如配置百分率为 0.12,当 org.xresloader.field_ratio=100时转出的数据为12 | -| org.xresloader.field_separator | Plain模式分隔符,可指定多个,用于在一个单元格内配置复杂格式时的分隔符列表,默认值: `,;| ` | +| org.xresloader.field_separator | Plain模式分隔符,可指定多个,用于在一个单元格内配置复杂格式时的分隔符列表,默认值: `,;\| ` | | org.xresloader.field_required | 设置字段为 **required** ,用于向proto3提供,proto2的 **required** 约束 | | org.xresloader.field_origin_value | 写出原始数据到指定字段( `Timestamp` 和 `Duration` 类型) | | org.xresloader.field_allow_missing_in_plain_mode | Plain模式下设置此字段可选,如果未设置则使用默认值(版本 2.16.0 版本开始支持) | +| org.xresloader.field_list_strip_option | 给单个字段设置数组裁剪,可选值( `LIST_STRIP_DEFAULT\|LIST_STRIP_NOTHING\|LIST_STRIP_TAIL\|LIST_STRIP_ALL` )(版本 2.16.0 版本开始支持) | +| org.xresloader.field_list_min_size | 给单个字段设置数组最小长度,可选值(版本 2.18.0 版本开始支持) | +| org.xresloader.field_list_max_size | 给单个字段设置数组最大长度,可选值(版本 2.18.0 版本开始支持) | | org.xresloader.ue.key_tag | 生成UE代码时,如果需要支持多个Key组合成一个Name,用这个字段指定系数(必须大于0) | | org.xresloader.ue.ue_type_name | 生成UE代码时,如果指定了这个字段,那么生成的字段类型将是 `TSoftObjectPtr` , 并且支持蓝图中直接引用 | | org.xresloader.ue.ue_type_is_class | 生成UE代码时,如果指定了这个字段,那么生成的字段类型将是 `TSoftClassPtr` , 并且支持蓝图中直接引用 | @@ -359,17 +362,17 @@ validator: | 插件名称 | 插件功能 | | :----------------------------------------------: | :--------------------------------------------------------------------------------------------------: | | org.xresloader.oneof_description | oneof描述信息,可能会写入输出的header中和代码中 | -| org.xresloader.oneof_separator | Plain模式类型和值字段的分隔符,可指定多个,用于在一个单元格内配置复杂格式时的分隔符列表,默认值: `,; | ` | +| org.xresloader.oneof_separator | Plain模式类型和值字段的分隔符,可指定多个,用于在一个单元格内配置复杂格式时的分隔符列表,默认值: `,;\| ` | | org.xresloader.oneof_not_null | 如果配置了字段映射且某个数据行对应的oneof数据为空,则忽略此行 | | org.xresloader.oneof_allow_missing_in_plain_mode | Plain模式下设置此字段可选,如果未设置则使用默认值(版本 2.16.0 版本开始支持) | ## 生态和工具 -+ [xresconv-gui][5]: GUI批量转表工具。 https://github.com/xresloader/xresconv-gui -+ [xresconv-cli][6]: 命令行批量转表工具。 https://github.com/xresloader/xresconv-cli -+ [xres-code-generator][4]: 读表代码生成工具。 https://github.com/xresloader/xres-code-generator -+ [xresloader-dump-bin][7]: 二进制输出的dump工具。 https://github.com/xresloader/xresloader-dump-bin - > 用于把转表生成的二进制导出为Human-Readable的文本,方便调试。可以直接从 https://github.com/xresloader/xresloader-dump-bin/releases 下载对应平台的可执行程序 ++ [xresconv-gui][5]: GUI批量转表工具。 ++ [xresconv-cli][6]: 命令行批量转表工具。 ++ [xres-code-generator][4]: 读表代码生成工具。 ++ [xresloader-dump-bin][7]: 二进制输出的dump工具。 + > 用于把转表生成的二进制导出为Human-Readable的文本,方便调试。可以直接从 下载对应平台的可执行程序 ## 编译和打包(For developer) @@ -399,7 +402,7 @@ Ans: Excel里编辑过的单元格即便删除了也会留下不可见的样式 2. 为什么Excel里填的时间,但是转出来是一个负数? -Ans: Excel里的日期时间类型转成协议里整数时会转为Unix时间戳,但是Excel的时间是以1900年1月0号为基准的,这意味着如果时间格式是hh:mm:dd的话,49:30:01会被转为1900-1-2 1:31:01。时间戳会是一个很大的负数 +Ans: Excel里的日期时间类型转成协议里整数时会转为Unix时间戳,但是Excel的时间是以1900年1月0号为基准的,这意味着如果时间格式是hh:mm:dd的话,49:30:01会被转为1900-1-2 1:31:01。时间戳会是一个很大的负数 介于这个原因,不建议在Excel中使用时间类型 @@ -460,7 +463,7 @@ Ans: 可以通过环境变量 `TZ` 或者java运行时属性 `user.timezone` 设 可用的区域示例(`+HH:mm`,`-HH:mm`,别名,完整时区名): `+08:00`, `UTC`, `GMT`, `Asia/Shanghai`, `America/Los_Angeles`, `Asia/Singapore` . -See https://en.wikipedia.org/wiki/List_of_tz_database_time_zones and https://www.iana.org/time-zones for details. +See and for details. [1]: https://github.com/xresloader/xresloader/releases [2]: https://github.com/protocolbuffers/upb diff --git a/header/org/xresloader/Xresloader.java b/header/org/xresloader/Xresloader.java index 3683a9d8..c32c3abe 100644 --- a/header/org/xresloader/Xresloader.java +++ b/header/org/xresloader/Xresloader.java @@ -35,6 +35,9 @@ public static void registerAllExtensions( registry.add(org.xresloader.Xresloader.fieldRequired); registry.add(org.xresloader.Xresloader.fieldOriginValue); registry.add(org.xresloader.Xresloader.fieldAllowMissingInPlainMode); + registry.add(org.xresloader.Xresloader.fieldListStripOption); + registry.add(org.xresloader.Xresloader.fieldListMinSize); + registry.add(org.xresloader.Xresloader.fieldListMaxSize); registry.add(org.xresloader.Xresloader.oneofDescription); registry.add(org.xresloader.Xresloader.oneofSeparator); registry.add(org.xresloader.Xresloader.oneofNotNull); @@ -49,6 +52,173 @@ public static void registerAllExtensions( registerAllExtensions( (com.google.protobuf.ExtensionRegistryLite) registry); } + /** + * Protobuf enum {@code org.xresloader.ListStripOption} + */ + public enum ListStripOption + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+     * 使用默认设置(受--list-strip-all-empty/--list-keep-empty/--list-strip-empty-tail影响)
+     * 
+ * + * LIST_STRIP_DEFAULT = 0; + */ + LIST_STRIP_DEFAULT(0), + /** + *
+     * 不裁剪任何值,相当于 --list-keep-empty
+     * 
+ * + * LIST_STRIP_NOTHING = 1; + */ + LIST_STRIP_NOTHING(1), + /** + *
+     * 裁剪尾部空值,相当于 --list-strip-empty-tail
+     * 
+ * + * LIST_STRIP_TAIL = 2; + */ + LIST_STRIP_TAIL(2), + /** + *
+     * 裁剪全部空值,相当于 --list-strip-all-empty
+     * 
+ * + * LIST_STRIP_ALL = 3; + */ + LIST_STRIP_ALL(3), + UNRECOGNIZED(-1), + ; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 27, + /* patch= */ 0, + /* suffix= */ "", + ListStripOption.class.getName()); + } + /** + *
+     * 使用默认设置(受--list-strip-all-empty/--list-keep-empty/--list-strip-empty-tail影响)
+     * 
+ * + * LIST_STRIP_DEFAULT = 0; + */ + public static final int LIST_STRIP_DEFAULT_VALUE = 0; + /** + *
+     * 不裁剪任何值,相当于 --list-keep-empty
+     * 
+ * + * LIST_STRIP_NOTHING = 1; + */ + public static final int LIST_STRIP_NOTHING_VALUE = 1; + /** + *
+     * 裁剪尾部空值,相当于 --list-strip-empty-tail
+     * 
+ * + * LIST_STRIP_TAIL = 2; + */ + public static final int LIST_STRIP_TAIL_VALUE = 2; + /** + *
+     * 裁剪全部空值,相当于 --list-strip-all-empty
+     * 
+ * + * LIST_STRIP_ALL = 3; + */ + public static final int LIST_STRIP_ALL_VALUE = 3; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ListStripOption valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static ListStripOption forNumber(int value) { + switch (value) { + case 0: return LIST_STRIP_DEFAULT; + case 1: return LIST_STRIP_NOTHING; + case 2: return LIST_STRIP_TAIL; + case 3: return LIST_STRIP_ALL; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + ListStripOption> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ListStripOption findValueByNumber(int number) { + return ListStripOption.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return org.xresloader.Xresloader.getDescriptor().getEnumTypes().get(0); + } + + private static final ListStripOption[] VALUES = values(); + + public static ListStripOption valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private ListStripOption(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:org.xresloader.ListStripOption) + } + public static final int FILE_DESCRIPTION_FIELD_NUMBER = 1001; /** *
@@ -305,6 +475,51 @@ public static void registerAllExtensions(
           .newFileScopedGeneratedExtension(
         java.lang.Boolean.class,
         null);
+  public static final int FIELD_LIST_STRIP_OPTION_FIELD_NUMBER = 1018;
+  /**
+   * 
+   * List类型裁剪选项
+   * 
+ * + * extend .google.protobuf.FieldOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FieldOptions, + org.xresloader.Xresloader.ListStripOption> fieldListStripOption = com.google.protobuf.GeneratedMessage + .newFileScopedGeneratedExtension( + org.xresloader.Xresloader.ListStripOption.class, + null); + public static final int FIELD_LIST_MIN_SIZE_FIELD_NUMBER = 1019; + /** + *
+   * List类型最小长度
+   * 
+ * + * extend .google.protobuf.FieldOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FieldOptions, + java.lang.Integer> fieldListMinSize = com.google.protobuf.GeneratedMessage + .newFileScopedGeneratedExtension( + java.lang.Integer.class, + null); + public static final int FIELD_LIST_MAX_SIZE_FIELD_NUMBER = 1020; + /** + *
+   * List类型最大长度
+   * 
+ * + * extend .google.protobuf.FieldOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FieldOptions, + java.lang.Integer> fieldListMaxSize = com.google.protobuf.GeneratedMessage + .newFileScopedGeneratedExtension( + java.lang.Integer.class, + null); public static final int ONEOF_DESCRIPTION_FIELD_NUMBER = 1001; /** *
@@ -420,43 +635,51 @@ public static void registerAllExtensions(
   static {
     java.lang.String[] descriptorData = {
       "\n\020xresloader.proto\022\016org.xresloader\032 goog" +
-      "le/protobuf/descriptor.proto:7\n\020file_des" +
-      "cription\022\034.google.protobuf.FileOptions\030\351" +
-      "\007 \001(\t:9\n\017msg_description\022\037.google.protob" +
-      "uf.MessageOptions\030\351\007 \001(\t:A\n\027msg_require_" +
-      "mapping_all\022\037.google.protobuf.MessageOpt" +
-      "ions\030\363\007 \001(\010:7\n\rmsg_separator\022\037.google.pr" +
-      "otobuf.MessageOptions\030\364\007 \001(\t:1\n\tvalidato" +
-      "r\022\035.google.protobuf.FieldOptions\030\351\007 \001(\t:" +
-      "8\n\020field_unique_tag\022\035.google.protobuf.Fi" +
-      "eldOptions\030\352\007 \003(\t:6\n\016field_not_null\022\035.go" +
-      "ogle.protobuf.FieldOptions\030\353\007 \001(\010:9\n\021map" +
-      "_key_validator\022\035.google.protobuf.FieldOp" +
-      "tions\030\354\007 \001(\t:;\n\023map_value_validator\022\035.go" +
-      "ogle.protobuf.FieldOptions\030\355\007 \001(\t:0\n\010ver" +
-      "ifier\022\035.google.protobuf.FieldOptions\030\361\007 " +
-      "\001(\t:9\n\021field_description\022\035.google.protob" +
-      "uf.FieldOptions\030\363\007 \001(\t:3\n\013field_alias\022\035." +
-      "google.protobuf.FieldOptions\030\364\007 \003(\t:3\n\013f" +
-      "ield_ratio\022\035.google.protobuf.FieldOption" +
-      "s\030\365\007 \001(\005:7\n\017field_separator\022\035.google.pro" +
-      "tobuf.FieldOptions\030\366\007 \001(\t:6\n\016field_requi" +
-      "red\022\035.google.protobuf.FieldOptions\030\367\007 \001(" +
-      "\010::\n\022field_origin_value\022\035.google.protobu" +
-      "f.FieldOptions\030\370\007 \001(\t:I\n!field_allow_mis" +
-      "sing_in_plain_mode\022\035.google.protobuf.Fie" +
-      "ldOptions\030\371\007 \001(\010:9\n\021oneof_description\022\035." +
-      "google.protobuf.OneofOptions\030\351\007 \001(\t:7\n\017o" +
-      "neof_separator\022\035.google.protobuf.OneofOp" +
-      "tions\030\352\007 \001(\t:6\n\016oneof_not_null\022\035.google." +
-      "protobuf.OneofOptions\030\353\007 \001(\010:I\n!oneof_al" +
-      "low_missing_in_plain_mode\022\035.google.proto" +
-      "buf.OneofOptions\030\354\007 \001(\010:7\n\020enum_descript" +
-      "ion\022\034.google.protobuf.EnumOptions\030\351\007 \001(\t" +
-      ":=\n\021enumv_description\022!.google.protobuf." +
-      "EnumValueOptions\030\351\007 \001(\t:6\n\nenum_alias\022!." +
-      "google.protobuf.EnumValueOptions\030\352\007 \003(\tb" +
-      "\006proto3"
+      "le/protobuf/descriptor.proto*j\n\017ListStri" +
+      "pOption\022\026\n\022LIST_STRIP_DEFAULT\020\000\022\026\n\022LIST_" +
+      "STRIP_NOTHING\020\001\022\023\n\017LIST_STRIP_TAIL\020\002\022\022\n\016" +
+      "LIST_STRIP_ALL\020\003:7\n\020file_description\022\034.g" +
+      "oogle.protobuf.FileOptions\030\351\007 \001(\t:9\n\017msg" +
+      "_description\022\037.google.protobuf.MessageOp" +
+      "tions\030\351\007 \001(\t:A\n\027msg_require_mapping_all\022" +
+      "\037.google.protobuf.MessageOptions\030\363\007 \001(\010:" +
+      "7\n\rmsg_separator\022\037.google.protobuf.Messa" +
+      "geOptions\030\364\007 \001(\t:1\n\tvalidator\022\035.google.p" +
+      "rotobuf.FieldOptions\030\351\007 \001(\t:8\n\020field_uni" +
+      "que_tag\022\035.google.protobuf.FieldOptions\030\352" +
+      "\007 \003(\t:6\n\016field_not_null\022\035.google.protobu" +
+      "f.FieldOptions\030\353\007 \001(\010:9\n\021map_key_validat" +
+      "or\022\035.google.protobuf.FieldOptions\030\354\007 \001(\t" +
+      ":;\n\023map_value_validator\022\035.google.protobu" +
+      "f.FieldOptions\030\355\007 \001(\t:0\n\010verifier\022\035.goog" +
+      "le.protobuf.FieldOptions\030\361\007 \001(\t:9\n\021field" +
+      "_description\022\035.google.protobuf.FieldOpti" +
+      "ons\030\363\007 \001(\t:3\n\013field_alias\022\035.google.proto" +
+      "buf.FieldOptions\030\364\007 \003(\t:3\n\013field_ratio\022\035" +
+      ".google.protobuf.FieldOptions\030\365\007 \001(\005:7\n\017" +
+      "field_separator\022\035.google.protobuf.FieldO" +
+      "ptions\030\366\007 \001(\t:6\n\016field_required\022\035.google" +
+      ".protobuf.FieldOptions\030\367\007 \001(\010::\n\022field_o" +
+      "rigin_value\022\035.google.protobuf.FieldOptio" +
+      "ns\030\370\007 \001(\t:I\n!field_allow_missing_in_plai" +
+      "n_mode\022\035.google.protobuf.FieldOptions\030\371\007" +
+      " \001(\010:`\n\027field_list_strip_option\022\035.google" +
+      ".protobuf.FieldOptions\030\372\007 \001(\0162\037.org.xres" +
+      "loader.ListStripOption:;\n\023field_list_min" +
+      "_size\022\035.google.protobuf.FieldOptions\030\373\007 " +
+      "\001(\005:;\n\023field_list_max_size\022\035.google.prot" +
+      "obuf.FieldOptions\030\374\007 \001(\005:9\n\021oneof_descri" +
+      "ption\022\035.google.protobuf.OneofOptions\030\351\007 " +
+      "\001(\t:7\n\017oneof_separator\022\035.google.protobuf" +
+      ".OneofOptions\030\352\007 \001(\t:6\n\016oneof_not_null\022\035" +
+      ".google.protobuf.OneofOptions\030\353\007 \001(\010:I\n!" +
+      "oneof_allow_missing_in_plain_mode\022\035.goog" +
+      "le.protobuf.OneofOptions\030\354\007 \001(\010:7\n\020enum_" +
+      "description\022\034.google.protobuf.EnumOption" +
+      "s\030\351\007 \001(\t:=\n\021enumv_description\022!.google.p" +
+      "rotobuf.EnumValueOptions\030\351\007 \001(\t:6\n\nenum_" +
+      "alias\022!.google.protobuf.EnumValueOptions" +
+      "\030\352\007 \003(\tb\006proto3"
     };
     descriptor = com.google.protobuf.Descriptors.FileDescriptor
       .internalBuildGeneratedFileFrom(descriptorData,
@@ -480,13 +703,16 @@ public static void registerAllExtensions(
     fieldRequired.internalInit(descriptor.getExtensions().get(14));
     fieldOriginValue.internalInit(descriptor.getExtensions().get(15));
     fieldAllowMissingInPlainMode.internalInit(descriptor.getExtensions().get(16));
-    oneofDescription.internalInit(descriptor.getExtensions().get(17));
-    oneofSeparator.internalInit(descriptor.getExtensions().get(18));
-    oneofNotNull.internalInit(descriptor.getExtensions().get(19));
-    oneofAllowMissingInPlainMode.internalInit(descriptor.getExtensions().get(20));
-    enumDescription.internalInit(descriptor.getExtensions().get(21));
-    enumvDescription.internalInit(descriptor.getExtensions().get(22));
-    enumAlias.internalInit(descriptor.getExtensions().get(23));
+    fieldListStripOption.internalInit(descriptor.getExtensions().get(17));
+    fieldListMinSize.internalInit(descriptor.getExtensions().get(18));
+    fieldListMaxSize.internalInit(descriptor.getExtensions().get(19));
+    oneofDescription.internalInit(descriptor.getExtensions().get(20));
+    oneofSeparator.internalInit(descriptor.getExtensions().get(21));
+    oneofNotNull.internalInit(descriptor.getExtensions().get(22));
+    oneofAllowMissingInPlainMode.internalInit(descriptor.getExtensions().get(23));
+    enumDescription.internalInit(descriptor.getExtensions().get(24));
+    enumvDescription.internalInit(descriptor.getExtensions().get(25));
+    enumAlias.internalInit(descriptor.getExtensions().get(26));
     descriptor.resolveAllFeaturesImmutable();
     com.google.protobuf.DescriptorProtos.getDescriptor();
   }
diff --git a/pom.xml b/pom.xml
index b8bb3286..1882f39f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
 
     org.xresloader
     xresloader
-    2.17.1
+    2.18.0
     jar
     xresloader
 
diff --git a/sample/cxx/v2/kind.pb.cc b/sample/cxx/v2/kind.pb.cc
index 4cc682cf..e2cd3c65 100755
--- a/sample/cxx/v2/kind.pb.cc
+++ b/sample/cxx/v2/kind.pb.cc
@@ -770,64 +770,65 @@ const char descriptor_table_protodef_kind_2eproto[] ABSL_ATTRIBUTE_SECTION_VARIA
     "ade_cfg with multi keys\352D\006helper\"o\n\021test"
     "_msg_verifier\022\022\n\ttest_id_1\030\221N \001(\r\022&\n\ttes"
     "t_id_2\030\222N \001(\rB\022\242\?\017\346\265\213\350\257\225ID\345\210\253\345\220\2152\022\027\n\ttes"
-    "t_id_3\030\223N \001(\rB\003\310\?\001:\005\242\?\002-^\"o\n\narr_in_arr\022"
+    "t_id_3\030\223N \001(\rB\003\310\?\001:\005\242\?\002-^\"x\n\narr_in_arr\022"
     "-\n\004name\030\001 \001(\tB\037\232\?\034This is a test name in"
-    " array\022\023\n\007int_arr\030\002 \003(\005B\002\020\001\022\017\n\007str_arr\030\003"
-    " \003(\t:\014\352D\006helper\360D\001\"\362\003\n\016arr_in_arr_cfg\022\037\n"
-    "\002id\030\001 \001(\rB\023\232\?\rThis is a Key\350D\001\022\030\n\003arr\030\002 "
-    "\003(\0132\013.arr_in_arr\022\032\n\022test_plain_int_arr\030\003"
-    " \003(\005\022\'\n\023test_plain_enum_arr\030\004 \003(\0162\n.cost"
-    "_type\0220\n\016test_plain_msg\030\005 \001(\0132\022.test_msg"
-    "_verifierB\004\262\?\001&\022.\n\022test_plain_msg_arr\030\006 "
-    "\003(\0132\022.test_msg_verifier\0223\n\013test_map_is\030\007"
-    " \003(\0132\036.arr_in_arr_cfg.TestMapIsEntry\0229\n\013"
-    "test_map_sm\030\010 \003(\0132\036.arr_in_arr_cfg.TestM"
-    "apSmEntryB\004\262\?\001|\0320\n\016TestMapIsEntry\022\013\n\003key"
-    "\030\001 \001(\005\022\r\n\005value\030\002 \001(\t:\0028\001\032;\n\016TestMapSmEn"
-    "try\022\013\n\003key\030\001 \001(\t\022\030\n\005value\030\002 \001(\0132\t.dep2_c"
-    "fg:\0028\001:\037\312>\023Test arr_in_arr_cfg\352D\006helper\""
-    "\243\001\n\021event_reward_item\022\017\n\007item_id\030\001 \001(\r\022\022"
-    "\n\nitem_count\030\002 \001(\r\022&\n\013nested_note\030\013 \001(\tB"
-    "\017\242\?\014\346\217\217\350\277\260\346\226\207\346\234\254H\000\0227\n\020nested_enum_type\030\014"
-    " \001(\0162\n.cost_typeB\017\242\?\014\350\264\247\345\270\201\347\261\273\345\236\213H\000B\010\n\006n"
-    "ested\"\241\001\n\017event_rule_item\022\017\n\007rule_id\030\001 \001"
-    "(\r\022\022\n\nrule_param\030\002 \001(\r\022&\n\013nested_note\030\013 "
-    "\001(\tB\017\242\?\014\346\217\217\350\277\260\346\226\207\346\234\254H\000\0227\n\020nested_enum_ty"
-    "pe\030\014 \001(\0162\n.cost_typeB\017\242\?\014\350\264\247\345\270\201\347\261\273\345\236\213H\000B"
-    "\010\n\006nested\"\244\004\n\tevent_cfg\022.\n\002id\030\001 \001(\rB\"\312>\014"
-    "custom_rule4\322>\nunique_tag\330>\001\350Dd\022$\n\007proce"
-    "ss\030\002 \001(\rB\023\322>\nunique_tag\330>\001\350D\001\022\036\n\004rule\030\006 "
-    "\001(\0132\020.event_rule_item\022\'\n\rspecify_field\030\007"
-    " \001(\0132\020.event_rule_item\0223\n\004item\030\013 \001(\0132\022.e"
-    "vent_reward_itemB\017\242\?\014\345\245\226\345\212\261\351\201\223\345\205\267H\000\022#\n\010u"
-    "ser_exp\030\014 \001(\003B\017\242\?\014\345\245\226\345\212\261\347\273\217\351\252\214H\000\022\037\n\004note"
-    "\030\r \001(\tB\017\242\?\014\346\217\217\350\277\260\346\226\207\346\234\254H\000\0220\n\tenum_type\030\016"
-    " \001(\0162\n.cost_typeB\017\242\?\014\350\264\247\345\270\201\347\261\273\345\236\213H\000\022%\n\nu"
-    "ser_level\0303 \001(\rB\017\242\?\014\347\216\251\345\256\266\347\255\211\347\272\247H\001\022(\n\010te"
-    "st_arr\030[ \003(\0132\020.event_rule_itemB\004\262\?\001;\022.\n\016"
-    "test_empty_arr\030\\ \003(\0132\020.event_rule_itemB\004"
-    "\262\?\001;:,\312> Test event_cfg with oneof field"
-    "s\352D\006helperB\r\n\006reward\022\003\330>\001B\r\n\013unlock_type"
-    "\"\266\001\n\034keep_or_strip_empty_list_cfg\022\037\n\002id\030"
-    "\001 \001(\rB\023\232\?\rThis is a Key\350D\001\022\034\n\tarray_msg\030"
-    "\002 \003(\0132\t.dep2_cfg\022\"\n\017array_plain_msg\030\003 \003("
-    "\0132\t.dep2_cfg\022\023\n\013array_int32\030\004 \003(\005\022\023\n\013arr"
-    "ay_int64\030\005 \003(\003:\t\352D\006helper\"4\n\ncombine_id\022"
-    "\016\n\006prefix\030\001 \001(\r\022\026\n\002id\030\002 \001(\rB\n\312>\0070-99999\""
-    "\224\003\n\021process_by_script\022\n\n\002id\030\001 \001(\r\022<\n\016map"
-    "_u32_string\030\002 \003(\0132$.process_by_script.Ma"
-    "pU32StringEntry\0226\n\013test_map_is\030\007 \003(\0132!.p"
-    "rocess_by_script.TestMapIsEntry\022<\n\013test_"
-    "map_sm\030\010 \003(\0132!.process_by_script.TestMap"
-    "SmEntryB\004\262\?\001|\022\033\n\005id_id\030\351\007 \001(\0132\013.combine_"
-    "id\0323\n\021MapU32StringEntry\022\013\n\003key\030\001 \001(\r\022\r\n\005"
-    "value\030\002 \001(\t:\0028\001\0320\n\016TestMapIsEntry\022\013\n\003key"
-    "\030\001 \001(\005\022\r\n\005value\030\002 \001(\t:\0028\001\032;\n\016TestMapSmEn"
-    "try\022\013\n\003key\030\001 \001(\t\022\030\n\005value\030\002 \001(\0132\t.dep2_c"
-    "fg:\0028\001\"\222\001\n\017large_file_test\022\n\n\002id\030\001 \001(\r\022\020"
-    "\n\010i32value\030\002 \001(\005\022\020\n\010u64value\030\003 \001(\004\022\020\n\010f6"
-    "4value\030\004 \001(\001\022\020\n\010f32value\030\005 \001(\002\022\017\n\007szvalu"
-    "e\030\006 \001(\t\022\032\n\005id_id\030\007 \001(\0132\013.combine_id"
+    " array\022\034\n\007int_arr\030\002 \003(\005B\013\020\001\320\?\001\330\?\001\340\?\003\022\017\n\007"
+    "str_arr\030\003 \003(\t:\014\352D\006helper\360D\001\"\362\003\n\016arr_in_a"
+    "rr_cfg\022\037\n\002id\030\001 \001(\rB\023\232\?\rThis is a Key\350D\001\022"
+    "\030\n\003arr\030\002 \003(\0132\013.arr_in_arr\022\032\n\022test_plain_"
+    "int_arr\030\003 \003(\005\022\'\n\023test_plain_enum_arr\030\004 \003"
+    "(\0162\n.cost_type\0220\n\016test_plain_msg\030\005 \001(\0132\022"
+    ".test_msg_verifierB\004\262\?\001&\022.\n\022test_plain_m"
+    "sg_arr\030\006 \003(\0132\022.test_msg_verifier\0223\n\013test"
+    "_map_is\030\007 \003(\0132\036.arr_in_arr_cfg.TestMapIs"
+    "Entry\0229\n\013test_map_sm\030\010 \003(\0132\036.arr_in_arr_"
+    "cfg.TestMapSmEntryB\004\262\?\001|\0320\n\016TestMapIsEnt"
+    "ry\022\013\n\003key\030\001 \001(\005\022\r\n\005value\030\002 \001(\t:\0028\001\032;\n\016Te"
+    "stMapSmEntry\022\013\n\003key\030\001 \001(\t\022\030\n\005value\030\002 \001(\013"
+    "2\t.dep2_cfg:\0028\001:\037\312>\023Test arr_in_arr_cfg\352"
+    "D\006helper\"\243\001\n\021event_reward_item\022\017\n\007item_i"
+    "d\030\001 \001(\r\022\022\n\nitem_count\030\002 \001(\r\022&\n\013nested_no"
+    "te\030\013 \001(\tB\017\242\?\014\346\217\217\350\277\260\346\226\207\346\234\254H\000\0227\n\020nested_en"
+    "um_type\030\014 \001(\0162\n.cost_typeB\017\242\?\014\350\264\247\345\270\201\347\261\273\345"
+    "\236\213H\000B\010\n\006nested\"\241\001\n\017event_rule_item\022\017\n\007ru"
+    "le_id\030\001 \001(\r\022\022\n\nrule_param\030\002 \001(\r\022&\n\013neste"
+    "d_note\030\013 \001(\tB\017\242\?\014\346\217\217\350\277\260\346\226\207\346\234\254H\000\0227\n\020neste"
+    "d_enum_type\030\014 \001(\0162\n.cost_typeB\017\242\?\014\350\264\247\345\270\201"
+    "\347\261\273\345\236\213H\000B\010\n\006nested\"\244\004\n\tevent_cfg\022.\n\002id\030\001"
+    " \001(\rB\"\312>\014custom_rule4\322>\nunique_tag\330>\001\350Dd"
+    "\022$\n\007process\030\002 \001(\rB\023\322>\nunique_tag\330>\001\350D\001\022\036"
+    "\n\004rule\030\006 \001(\0132\020.event_rule_item\022\'\n\rspecif"
+    "y_field\030\007 \001(\0132\020.event_rule_item\0223\n\004item\030"
+    "\013 \001(\0132\022.event_reward_itemB\017\242\?\014\345\245\226\345\212\261\351\201\223\345"
+    "\205\267H\000\022#\n\010user_exp\030\014 \001(\003B\017\242\?\014\345\245\226\345\212\261\347\273\217\351\252\214H"
+    "\000\022\037\n\004note\030\r \001(\tB\017\242\?\014\346\217\217\350\277\260\346\226\207\346\234\254H\000\0220\n\ten"
+    "um_type\030\016 \001(\0162\n.cost_typeB\017\242\?\014\350\264\247\345\270\201\347\261\273\345"
+    "\236\213H\000\022%\n\nuser_level\0303 \001(\rB\017\242\?\014\347\216\251\345\256\266\347\255\211\347\272"
+    "\247H\001\022(\n\010test_arr\030[ \003(\0132\020.event_rule_itemB"
+    "\004\262\?\001;\022.\n\016test_empty_arr\030\\ \003(\0132\020.event_ru"
+    "le_itemB\004\262\?\001;:,\312> Test event_cfg with on"
+    "eof fields\352D\006helperB\r\n\006reward\022\003\330>\001B\r\n\013un"
+    "lock_type\"\266\001\n\034keep_or_strip_empty_list_c"
+    "fg\022\037\n\002id\030\001 \001(\rB\023\232\?\rThis is a Key\350D\001\022\034\n\ta"
+    "rray_msg\030\002 \003(\0132\t.dep2_cfg\022\"\n\017array_plain"
+    "_msg\030\003 \003(\0132\t.dep2_cfg\022\023\n\013array_int32\030\004 \003"
+    "(\005\022\023\n\013array_int64\030\005 \003(\003:\t\352D\006helper\"4\n\nco"
+    "mbine_id\022\016\n\006prefix\030\001 \001(\r\022\026\n\002id\030\002 \001(\rB\n\312>"
+    "\0070-99999\"\224\003\n\021process_by_script\022\n\n\002id\030\001 \001"
+    "(\r\022<\n\016map_u32_string\030\002 \003(\0132$.process_by_"
+    "script.MapU32StringEntry\0226\n\013test_map_is\030"
+    "\007 \003(\0132!.process_by_script.TestMapIsEntry"
+    "\022<\n\013test_map_sm\030\010 \003(\0132!.process_by_scrip"
+    "t.TestMapSmEntryB\004\262\?\001|\022\033\n\005id_id\030\351\007 \001(\0132\013"
+    ".combine_id\0323\n\021MapU32StringEntry\022\013\n\003key\030"
+    "\001 \001(\r\022\r\n\005value\030\002 \001(\t:\0028\001\0320\n\016TestMapIsEnt"
+    "ry\022\013\n\003key\030\001 \001(\005\022\r\n\005value\030\002 \001(\t:\0028\001\032;\n\016Te"
+    "stMapSmEntry\022\013\n\003key\030\001 \001(\t\022\030\n\005value\030\002 \001(\013"
+    "2\t.dep2_cfg:\0028\001\"\222\001\n\017large_file_test\022\n\n\002i"
+    "d\030\001 \001(\r\022\020\n\010i32value\030\002 \001(\005\022\020\n\010u64value\030\003 "
+    "\001(\004\022\020\n\010f64value\030\004 \001(\001\022\020\n\010f32value\030\005 \001(\002\022"
+    "\017\n\007szvalue\030\006 \001(\t\022\032\n\005id_id\030\007 \001(\0132\013.combin"
+    "e_id"
 };
 static const ::_pbi::DescriptorTable* const descriptor_table_kind_2eproto_deps[6] =
     {
@@ -842,7 +843,7 @@ static ::absl::once_flag descriptor_table_kind_2eproto_once;
 PROTOBUF_CONSTINIT const ::_pbi::DescriptorTable descriptor_table_kind_2eproto = {
     false,
     false,
-    3435,
+    3444,
     descriptor_table_protodef_kind_2eproto,
     "kind.proto",
     &descriptor_table_kind_2eproto_once,
@@ -2229,7 +2230,7 @@ const ::_pbi::TcParseTable<2, 3, 0, 30, 2> arr_in_arr::_table_ = {
     // optional string name = 1 [(.org.xresloader.field_description) = "This is a test name in array"];
     {::_pbi::TcParser::FastSS1,
      {10, 0, 0, PROTOBUF_FIELD_OFFSET(arr_in_arr, _impl_.name_)}},
-    // repeated int32 int_arr = 2 [packed = true];
+    // repeated int32 int_arr = 2 [packed = true, (.org.xresloader.field_list_strip_option) = LIST_STRIP_NOTHING, (.org.xresloader.field_list_min_size) = 1, (.org.xresloader.field_list_max_size) = 3];
     {::_pbi::TcParser::FastV32P1,
      {18, 63, 0, PROTOBUF_FIELD_OFFSET(arr_in_arr, _impl_.int_arr_)}},
     // repeated string str_arr = 3;
@@ -2241,7 +2242,7 @@ const ::_pbi::TcParseTable<2, 3, 0, 30, 2> arr_in_arr::_table_ = {
     // optional string name = 1 [(.org.xresloader.field_description) = "This is a test name in array"];
     {PROTOBUF_FIELD_OFFSET(arr_in_arr, _impl_.name_), _Internal::kHasBitsOffset + 0, 0,
     (0 | ::_fl::kFcOptional | ::_fl::kRawString | ::_fl::kRepAString)},
-    // repeated int32 int_arr = 2 [packed = true];
+    // repeated int32 int_arr = 2 [packed = true, (.org.xresloader.field_list_strip_option) = LIST_STRIP_NOTHING, (.org.xresloader.field_list_min_size) = 1, (.org.xresloader.field_list_max_size) = 3];
     {PROTOBUF_FIELD_OFFSET(arr_in_arr, _impl_.int_arr_), -1, 0,
     (0 | ::_fl::kFcRepeated | ::_fl::kPackedInt32)},
     // repeated string str_arr = 3;
@@ -2290,7 +2291,7 @@ ::uint8_t* arr_in_arr::_InternalSerialize(
     target = stream->WriteStringMaybeAliased(1, _s, target);
   }
 
-  // repeated int32 int_arr = 2 [packed = true];
+  // repeated int32 int_arr = 2 [packed = true, (.org.xresloader.field_list_strip_option) = LIST_STRIP_NOTHING, (.org.xresloader.field_list_min_size) = 1, (.org.xresloader.field_list_max_size) = 3];
   {
     int byte_size = _impl_._int_arr_cached_byte_size_.Get();
     if (byte_size > 0) {
@@ -2325,7 +2326,7 @@ ::size_t arr_in_arr::ByteSizeLong() const {
   (void) cached_has_bits;
 
   ::_pbi::Prefetch5LinesFrom7Lines(reinterpret_cast(this));
-  // repeated int32 int_arr = 2 [packed = true];
+  // repeated int32 int_arr = 2 [packed = true, (.org.xresloader.field_list_strip_option) = LIST_STRIP_NOTHING, (.org.xresloader.field_list_min_size) = 1, (.org.xresloader.field_list_max_size) = 3];
   {
     std::size_t data_size = ::_pbi::WireFormatLite::Int32Size(
         this->_internal_int_arr())
diff --git a/sample/cxx/v2/kind.pb.h b/sample/cxx/v2/kind.pb.h
index 33f88329..cbef9f50 100755
--- a/sample/cxx/v2/kind.pb.h
+++ b/sample/cxx/v2/kind.pb.h
@@ -1398,7 +1398,7 @@ class arr_in_arr final : public ::google::protobuf::Message
     kStrArrFieldNumber = 3,
     kNameFieldNumber = 1,
   };
-  // repeated int32 int_arr = 2 [packed = true];
+  // repeated int32 int_arr = 2 [packed = true, (.org.xresloader.field_list_strip_option) = LIST_STRIP_NOTHING, (.org.xresloader.field_list_min_size) = 1, (.org.xresloader.field_list_max_size) = 3];
   int int_arr_size() const;
   private:
   int _internal_int_arr_size() const;
@@ -4911,7 +4911,7 @@ inline void arr_in_arr::set_allocated_name(std::string* value) {
   // @@protoc_insertion_point(field_set_allocated:arr_in_arr.name)
 }
 
-// repeated int32 int_arr = 2 [packed = true];
+// repeated int32 int_arr = 2 [packed = true, (.org.xresloader.field_list_strip_option) = LIST_STRIP_NOTHING, (.org.xresloader.field_list_min_size) = 1, (.org.xresloader.field_list_max_size) = 3];
 inline int arr_in_arr::_internal_int_arr_size() const {
   return _internal_int_arr().size();
 }
diff --git a/sample/cxx/v3/kind.pb.cc b/sample/cxx/v3/kind.pb.cc
index 6417aa1d..010bd094 100755
--- a/sample/cxx/v3/kind.pb.cc
+++ b/sample/cxx/v3/kind.pb.cc
@@ -791,81 +791,81 @@ const char descriptor_table_protodef_kind_2eproto[] ABSL_ATTRIBUTE_SECTION_VARIA
     "\001(\rB\003\350D\001\0226\n\010CostType\030\003 \001(\005B$\312>\014custom_ru"
     "le1\232\?\022Refer to cost_type\022\021\n\tCostValue\030\004 "
     "\001(\003\022\020\n\010ScoreAdd\030\005 \001(\005:1\312>%Test role_upgr"
-    "ade_cfg with multi keys\352D\006helper\"\277\004\n\narr"
+    "ade_cfg with multi keys\352D\006helper\"\312\004\n\narr"
     "_in_arr\022-\n\004name\030\001 \001(\tB\037\232\?\034This is a test"
-    " name in array\022\017\n\007int_arr\030\002 \003(\005\022\017\n\007str_a"
-    "rr\030\003 \003(\t\022#\n\016test_info_role\030\013 \001(\0132\t.role_"
-    "cfgH\000\0222\n\025test_role_upgrade_cfg\030\014 \001(\0132\021.r"
-    "ole_upgrade_cfgH\000\032\373\001\n\023test_nested_messag"
-    "e\0222\n\035test_nested_message_info_role\030\013 \001(\013"
-    "2\t.role_cfgH\000\022A\n$test_nested_message_rol"
-    "e_upgrade_cfg\030\014 \001(\0132\021.role_upgrade_cfgH\000"
-    "\"`\n\020test_nested_enum\022%\n!EN_TEST_NESTED_M"
-    "ESSAGE_ENUM_VAL_1\020\000\022%\n!EN_TEST_NESTED_ME"
-    "SSAGE_ENUM_VAL_2\020{B\013\n\ttest_onof\"P\n\020test_"
-    "nested_enum\022\035\n\031EN_TEST_NESTED_ENUM_VAL_1"
-    "\020\000\022\035\n\031EN_TEST_NESTED_ENUM_VAL_2\020{:*\352D\006he"
-    "lper\360D\001\202E\033Engine/CompositeDataTable.hB\013\n"
-    "\ttest_onof\"o\n\021test_msg_verifier\022\022\n\ttest_"
-    "id_1\030\221N \001(\r\022&\n\ttest_id_2\030\222N \001(\rB\022\242\?\017\346\265\213\350"
-    "\257\225ID\345\210\253\345\220\2152\022\027\n\ttest_id_3\030\223N \001(\rB\003\310\?\001:\005\242\?"
-    "\002-^\"\362\003\n\016arr_in_arr_cfg\022\037\n\002id\030\001 \001(\rB\023\232\?\rT"
-    "his is a Key\350D\001\022\030\n\003arr\030\002 \003(\0132\013.arr_in_ar"
-    "r\022\032\n\022test_plain_int_arr\030\003 \003(\005\022\'\n\023test_pl"
-    "ain_enum_arr\030\004 \003(\0162\n.cost_type\0220\n\016test_p"
-    "lain_msg\030\005 \001(\0132\022.test_msg_verifierB\004\262\?\001&"
-    "\022.\n\022test_plain_msg_arr\030\006 \003(\0132\022.test_msg_"
-    "verifier\0223\n\013test_map_is\030\007 \003(\0132\036.arr_in_a"
-    "rr_cfg.TestMapIsEntry\0229\n\013test_map_sm\030\010 \003"
-    "(\0132\036.arr_in_arr_cfg.TestMapSmEntryB\004\262\?\001|"
-    "\0320\n\016TestMapIsEntry\022\013\n\003key\030\001 \001(\005\022\r\n\005value"
-    "\030\002 \001(\t:\0028\001\032;\n\016TestMapSmEntry\022\013\n\003key\030\001 \001("
-    "\t\022\030\n\005value\030\002 \001(\0132\t.dep2_cfg:\0028\001:\037\312>\023Test"
-    " arr_in_arr_cfg\352D\006helper\"\243\001\n\021event_rewar"
-    "d_item\022\017\n\007item_id\030\001 \001(\r\022\022\n\nitem_count\030\002 "
-    "\001(\r\022&\n\013nested_note\030\013 \001(\tB\017\242\?\014\346\217\217\350\277\260\346\226\207\346\234"
-    "\254H\000\0227\n\020nested_enum_type\030\014 \001(\0162\n.cost_typ"
-    "eB\017\242\?\014\350\264\247\345\270\201\347\261\273\345\236\213H\000B\010\n\006nested\"\241\001\n\017event"
-    "_rule_item\022\017\n\007rule_id\030\001 \001(\r\022\022\n\nrule_para"
-    "m\030\002 \001(\r\022&\n\013nested_note\030\013 \001(\tB\017\242\?\014\346\217\217\350\277\260\346"
-    "\226\207\346\234\254H\000\0227\n\020nested_enum_type\030\014 \001(\0162\n.cost"
-    "_typeB\017\242\?\014\350\264\247\345\270\201\347\261\273\345\236\213H\000B\010\n\006nested\"\244\004\n\te"
-    "vent_cfg\022.\n\002id\030\001 \001(\rB\"\312>\014custom_rule4\322>\n"
-    "unique_tag\330>\001\350Dd\022$\n\007process\030\002 \001(\rB\023\322>\nun"
-    "ique_tag\330>\001\350D\001\022\036\n\004rule\030\006 \001(\0132\020.event_rul"
-    "e_item\022\'\n\rspecify_field\030\007 \001(\0132\020.event_ru"
-    "le_item\0223\n\004item\030\013 \001(\0132\022.event_reward_ite"
-    "mB\017\242\?\014\345\245\226\345\212\261\351\201\223\345\205\267H\000\022#\n\010user_exp\030\014 \001(\003B\017"
-    "\242\?\014\345\245\226\345\212\261\347\273\217\351\252\214H\000\022\037\n\004note\030\r \001(\tB\017\242\?\014\346\217\217\350"
-    "\277\260\346\226\207\346\234\254H\000\0220\n\tenum_type\030\016 \001(\0162\n.cost_typ"
-    "eB\017\242\?\014\350\264\247\345\270\201\347\261\273\345\236\213H\000\022%\n\nuser_level\0303 \001(\r"
-    "B\017\242\?\014\347\216\251\345\256\266\347\255\211\347\272\247H\001\022(\n\010test_arr\030[ \003(\0132\020."
-    "event_rule_itemB\004\262\?\001;\022.\n\016test_empty_arr\030"
-    "\\ \003(\0132\020.event_rule_itemB\004\262\?\001;:,\312> Test e"
-    "vent_cfg with oneof fields\352D\006helperB\r\n\006r"
-    "eward\022\003\330>\001B\r\n\013unlock_type\"\266\001\n\034keep_or_st"
-    "rip_empty_list_cfg\022\037\n\002id\030\001 \001(\rB\023\232\?\rThis "
-    "is a Key\350D\001\022\034\n\tarray_msg\030\002 \003(\0132\t.dep2_cf"
-    "g\022\"\n\017array_plain_msg\030\003 \003(\0132\t.dep2_cfg\022\023\n"
-    "\013array_int32\030\004 \003(\005\022\023\n\013array_int64\030\005 \003(\003:"
-    "\t\352D\006helper\"4\n\ncombine_id\022\016\n\006prefix\030\001 \001(\r"
-    "\022\026\n\002id\030\002 \001(\rB\n\312>\0070-99999\"\333\003\n\021process_by_"
-    "script\022\n\n\002id\030\001 \001(\r\022<\n\016map_u32_string\030\002 \003"
-    "(\0132$.process_by_script.MapU32StringEntry"
-    "\022\033\n\023human_readable_date\030\003 \001(\t\022(\n\004date\030\004 "
-    "\001(\0132\032.google.protobuf.Timestamp\0226\n\013test_"
-    "map_is\030\007 \003(\0132!.process_by_script.TestMap"
-    "IsEntry\022<\n\013test_map_sm\030\010 \003(\0132!.process_b"
-    "y_script.TestMapSmEntryB\004\262\?\001|\022\033\n\005id_id\030\351"
-    "\007 \001(\0132\013.combine_id\0323\n\021MapU32StringEntry\022"
-    "\013\n\003key\030\001 \001(\r\022\r\n\005value\030\002 \001(\t:\0028\001\0320\n\016TestM"
-    "apIsEntry\022\013\n\003key\030\001 \001(\005\022\r\n\005value\030\002 \001(\t:\0028"
-    "\001\032;\n\016TestMapSmEntry\022\013\n\003key\030\001 \001(\t\022\030\n\005valu"
-    "e\030\002 \001(\0132\t.dep2_cfg:\0028\001\"\222\001\n\017large_file_te"
-    "st\022\n\n\002id\030\001 \001(\r\022\020\n\010i32value\030\002 \001(\005\022\020\n\010u64v"
-    "alue\030\003 \001(\004\022\020\n\010f64value\030\004 \001(\001\022\020\n\010f32value"
-    "\030\005 \001(\002\022\017\n\007szvalue\030\006 \001(\t\022\032\n\005id_id\030\007 \001(\0132\013"
-    ".combine_idb\006proto3"
+    " name in array\022\032\n\007int_arr\030\002 \003(\005B\t\320\?\001\330\?\001\340"
+    "\?\003\022\017\n\007str_arr\030\003 \003(\t\022#\n\016test_info_role\030\013 "
+    "\001(\0132\t.role_cfgH\000\0222\n\025test_role_upgrade_cf"
+    "g\030\014 \001(\0132\021.role_upgrade_cfgH\000\032\373\001\n\023test_ne"
+    "sted_message\0222\n\035test_nested_message_info"
+    "_role\030\013 \001(\0132\t.role_cfgH\000\022A\n$test_nested_"
+    "message_role_upgrade_cfg\030\014 \001(\0132\021.role_up"
+    "grade_cfgH\000\"`\n\020test_nested_enum\022%\n!EN_TE"
+    "ST_NESTED_MESSAGE_ENUM_VAL_1\020\000\022%\n!EN_TES"
+    "T_NESTED_MESSAGE_ENUM_VAL_2\020{B\013\n\ttest_on"
+    "of\"P\n\020test_nested_enum\022\035\n\031EN_TEST_NESTED"
+    "_ENUM_VAL_1\020\000\022\035\n\031EN_TEST_NESTED_ENUM_VAL"
+    "_2\020{:*\352D\006helper\360D\001\202E\033Engine/CompositeDat"
+    "aTable.hB\013\n\ttest_onof\"o\n\021test_msg_verifi"
+    "er\022\022\n\ttest_id_1\030\221N \001(\r\022&\n\ttest_id_2\030\222N \001"
+    "(\rB\022\242\?\017\346\265\213\350\257\225ID\345\210\253\345\220\2152\022\027\n\ttest_id_3\030\223N \001"
+    "(\rB\003\310\?\001:\005\242\?\002-^\"\372\003\n\016arr_in_arr_cfg\022\037\n\002id\030"
+    "\001 \001(\rB\023\232\?\rThis is a Key\350D\001\022\030\n\003arr\030\002 \003(\0132"
+    "\013.arr_in_arr\022\"\n\022test_plain_int_arr\030\003 \003(\005"
+    "B\006\330\?\001\340\?\003\022\'\n\023test_plain_enum_arr\030\004 \003(\0162\n."
+    "cost_type\0220\n\016test_plain_msg\030\005 \001(\0132\022.test"
+    "_msg_verifierB\004\262\?\001&\022.\n\022test_plain_msg_ar"
+    "r\030\006 \003(\0132\022.test_msg_verifier\0223\n\013test_map_"
+    "is\030\007 \003(\0132\036.arr_in_arr_cfg.TestMapIsEntry"
+    "\0229\n\013test_map_sm\030\010 \003(\0132\036.arr_in_arr_cfg.T"
+    "estMapSmEntryB\004\262\?\001|\0320\n\016TestMapIsEntry\022\013\n"
+    "\003key\030\001 \001(\005\022\r\n\005value\030\002 \001(\t:\0028\001\032;\n\016TestMap"
+    "SmEntry\022\013\n\003key\030\001 \001(\t\022\030\n\005value\030\002 \001(\0132\t.de"
+    "p2_cfg:\0028\001:\037\312>\023Test arr_in_arr_cfg\352D\006hel"
+    "per\"\243\001\n\021event_reward_item\022\017\n\007item_id\030\001 \001"
+    "(\r\022\022\n\nitem_count\030\002 \001(\r\022&\n\013nested_note\030\013 "
+    "\001(\tB\017\242\?\014\346\217\217\350\277\260\346\226\207\346\234\254H\000\0227\n\020nested_enum_ty"
+    "pe\030\014 \001(\0162\n.cost_typeB\017\242\?\014\350\264\247\345\270\201\347\261\273\345\236\213H\000B"
+    "\010\n\006nested\"\241\001\n\017event_rule_item\022\017\n\007rule_id"
+    "\030\001 \001(\r\022\022\n\nrule_param\030\002 \001(\r\022&\n\013nested_not"
+    "e\030\013 \001(\tB\017\242\?\014\346\217\217\350\277\260\346\226\207\346\234\254H\000\0227\n\020nested_enu"
+    "m_type\030\014 \001(\0162\n.cost_typeB\017\242\?\014\350\264\247\345\270\201\347\261\273\345\236"
+    "\213H\000B\010\n\006nested\"\244\004\n\tevent_cfg\022.\n\002id\030\001 \001(\rB"
+    "\"\312>\014custom_rule4\322>\nunique_tag\330>\001\350Dd\022$\n\007p"
+    "rocess\030\002 \001(\rB\023\322>\nunique_tag\330>\001\350D\001\022\036\n\004rul"
+    "e\030\006 \001(\0132\020.event_rule_item\022\'\n\rspecify_fie"
+    "ld\030\007 \001(\0132\020.event_rule_item\0223\n\004item\030\013 \001(\013"
+    "2\022.event_reward_itemB\017\242\?\014\345\245\226\345\212\261\351\201\223\345\205\267H\000\022"
+    "#\n\010user_exp\030\014 \001(\003B\017\242\?\014\345\245\226\345\212\261\347\273\217\351\252\214H\000\022\037\n\004"
+    "note\030\r \001(\tB\017\242\?\014\346\217\217\350\277\260\346\226\207\346\234\254H\000\0220\n\tenum_ty"
+    "pe\030\016 \001(\0162\n.cost_typeB\017\242\?\014\350\264\247\345\270\201\347\261\273\345\236\213H\000\022"
+    "%\n\nuser_level\0303 \001(\rB\017\242\?\014\347\216\251\345\256\266\347\255\211\347\272\247H\001\022("
+    "\n\010test_arr\030[ \003(\0132\020.event_rule_itemB\004\262\?\001;"
+    "\022.\n\016test_empty_arr\030\\ \003(\0132\020.event_rule_it"
+    "emB\004\262\?\001;:,\312> Test event_cfg with oneof f"
+    "ields\352D\006helperB\r\n\006reward\022\003\330>\001B\r\n\013unlock_"
+    "type\"\266\001\n\034keep_or_strip_empty_list_cfg\022\037\n"
+    "\002id\030\001 \001(\rB\023\232\?\rThis is a Key\350D\001\022\034\n\tarray_"
+    "msg\030\002 \003(\0132\t.dep2_cfg\022\"\n\017array_plain_msg\030"
+    "\003 \003(\0132\t.dep2_cfg\022\023\n\013array_int32\030\004 \003(\005\022\023\n"
+    "\013array_int64\030\005 \003(\003:\t\352D\006helper\"4\n\ncombine"
+    "_id\022\016\n\006prefix\030\001 \001(\r\022\026\n\002id\030\002 \001(\rB\n\312>\0070-99"
+    "999\"\333\003\n\021process_by_script\022\n\n\002id\030\001 \001(\r\022<\n"
+    "\016map_u32_string\030\002 \003(\0132$.process_by_scrip"
+    "t.MapU32StringEntry\022\033\n\023human_readable_da"
+    "te\030\003 \001(\t\022(\n\004date\030\004 \001(\0132\032.google.protobuf"
+    ".Timestamp\0226\n\013test_map_is\030\007 \003(\0132!.proces"
+    "s_by_script.TestMapIsEntry\022<\n\013test_map_s"
+    "m\030\010 \003(\0132!.process_by_script.TestMapSmEnt"
+    "ryB\004\262\?\001|\022\033\n\005id_id\030\351\007 \001(\0132\013.combine_id\0323\n"
+    "\021MapU32StringEntry\022\013\n\003key\030\001 \001(\r\022\r\n\005value"
+    "\030\002 \001(\t:\0028\001\0320\n\016TestMapIsEntry\022\013\n\003key\030\001 \001("
+    "\005\022\r\n\005value\030\002 \001(\t:\0028\001\032;\n\016TestMapSmEntry\022\013"
+    "\n\003key\030\001 \001(\t\022\030\n\005value\030\002 \001(\0132\t.dep2_cfg:\0028"
+    "\001\"\222\001\n\017large_file_test\022\n\n\002id\030\001 \001(\r\022\020\n\010i32"
+    "value\030\002 \001(\005\022\020\n\010u64value\030\003 \001(\004\022\020\n\010f64valu"
+    "e\030\004 \001(\001\022\020\n\010f32value\030\005 \001(\002\022\017\n\007szvalue\030\006 \001"
+    "(\t\022\032\n\005id_id\030\007 \001(\0132\013.combine_idb\006proto3"
 };
 static const ::_pbi::DescriptorTable* const descriptor_table_kind_2eproto_deps[6] =
     {
@@ -880,7 +880,7 @@ static ::absl::once_flag descriptor_table_kind_2eproto_once;
 PROTOBUF_CONSTINIT const ::_pbi::DescriptorTable descriptor_table_kind_2eproto = {
     false,
     false,
-    3979,
+    3998,
     descriptor_table_protodef_kind_2eproto,
     "kind.proto",
     &descriptor_table_kind_2eproto_once,
@@ -2418,7 +2418,7 @@ const ::_pbi::TcParseTable<2, 5, 2, 30, 2> arr_in_arr::_table_ = {
     // string name = 1 [(.org.xresloader.field_description) = "This is a test name in array"];
     {::_pbi::TcParser::FastUS1,
      {10, 63, 0, PROTOBUF_FIELD_OFFSET(arr_in_arr, _impl_.name_)}},
-    // repeated int32 int_arr = 2;
+    // repeated int32 int_arr = 2 [(.org.xresloader.field_list_strip_option) = LIST_STRIP_NOTHING, (.org.xresloader.field_list_min_size) = 1, (.org.xresloader.field_list_max_size) = 3];
     {::_pbi::TcParser::FastV32P1,
      {18, 63, 0, PROTOBUF_FIELD_OFFSET(arr_in_arr, _impl_.int_arr_)}},
     // repeated string str_arr = 3;
@@ -2430,7 +2430,7 @@ const ::_pbi::TcParseTable<2, 5, 2, 30, 2> arr_in_arr::_table_ = {
     // string name = 1 [(.org.xresloader.field_description) = "This is a test name in array"];
     {PROTOBUF_FIELD_OFFSET(arr_in_arr, _impl_.name_), 0, 0,
     (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)},
-    // repeated int32 int_arr = 2;
+    // repeated int32 int_arr = 2 [(.org.xresloader.field_list_strip_option) = LIST_STRIP_NOTHING, (.org.xresloader.field_list_min_size) = 1, (.org.xresloader.field_list_max_size) = 3];
     {PROTOBUF_FIELD_OFFSET(arr_in_arr, _impl_.int_arr_), 0, 0,
     (0 | ::_fl::kFcRepeated | ::_fl::kPackedInt32)},
     // repeated string str_arr = 3;
@@ -2482,7 +2482,7 @@ ::uint8_t* arr_in_arr::_InternalSerialize(
     target = stream->WriteStringMaybeAliased(1, _s, target);
   }
 
-  // repeated int32 int_arr = 2;
+  // repeated int32 int_arr = 2 [(.org.xresloader.field_list_strip_option) = LIST_STRIP_NOTHING, (.org.xresloader.field_list_min_size) = 1, (.org.xresloader.field_list_max_size) = 3];
   {
     int byte_size = _impl_._int_arr_cached_byte_size_.Get();
     if (byte_size > 0) {
@@ -2531,7 +2531,7 @@ ::size_t arr_in_arr::ByteSizeLong() const {
   (void) cached_has_bits;
 
   ::_pbi::Prefetch5LinesFrom7Lines(reinterpret_cast(this));
-  // repeated int32 int_arr = 2;
+  // repeated int32 int_arr = 2 [(.org.xresloader.field_list_strip_option) = LIST_STRIP_NOTHING, (.org.xresloader.field_list_min_size) = 1, (.org.xresloader.field_list_max_size) = 3];
   {
     std::size_t data_size = ::_pbi::WireFormatLite::Int32Size(
         this->_internal_int_arr())
@@ -3050,7 +3050,7 @@ const ::_pbi::TcParseTable<3, 8, 6, 53, 2> arr_in_arr_cfg::_table_ = {
     // repeated .arr_in_arr arr = 2;
     {::_pbi::TcParser::FastMtR1,
      {18, 63, 0, PROTOBUF_FIELD_OFFSET(arr_in_arr_cfg, _impl_.arr_)}},
-    // repeated int32 test_plain_int_arr = 3;
+    // repeated int32 test_plain_int_arr = 3 [(.org.xresloader.field_list_min_size) = 1, (.org.xresloader.field_list_max_size) = 3];
     {::_pbi::TcParser::FastV32P1,
      {26, 63, 0, PROTOBUF_FIELD_OFFSET(arr_in_arr_cfg, _impl_.test_plain_int_arr_)}},
     // repeated .cost_type test_plain_enum_arr = 4;
@@ -3072,7 +3072,7 @@ const ::_pbi::TcParseTable<3, 8, 6, 53, 2> arr_in_arr_cfg::_table_ = {
     // repeated .arr_in_arr arr = 2;
     {PROTOBUF_FIELD_OFFSET(arr_in_arr_cfg, _impl_.arr_), -1, 0,
     (0 | ::_fl::kFcRepeated | ::_fl::kMessage | ::_fl::kTvTable)},
-    // repeated int32 test_plain_int_arr = 3;
+    // repeated int32 test_plain_int_arr = 3 [(.org.xresloader.field_list_min_size) = 1, (.org.xresloader.field_list_max_size) = 3];
     {PROTOBUF_FIELD_OFFSET(arr_in_arr_cfg, _impl_.test_plain_int_arr_), -1, 0,
     (0 | ::_fl::kFcRepeated | ::_fl::kPackedInt32)},
     // repeated .cost_type test_plain_enum_arr = 4;
@@ -3159,7 +3159,7 @@ ::uint8_t* arr_in_arr_cfg::_InternalSerialize(
             target, stream);
   }
 
-  // repeated int32 test_plain_int_arr = 3;
+  // repeated int32 test_plain_int_arr = 3 [(.org.xresloader.field_list_min_size) = 1, (.org.xresloader.field_list_max_size) = 3];
   {
     int byte_size = _impl_._test_plain_int_arr_cached_byte_size_.Get();
     if (byte_size > 0) {
@@ -3272,7 +3272,7 @@ ::size_t arr_in_arr_cfg::ByteSizeLong() const {
   for (const auto& msg : this->_internal_arr()) {
     total_size += ::google::protobuf::internal::WireFormatLite::MessageSize(msg);
   }
-  // repeated int32 test_plain_int_arr = 3;
+  // repeated int32 test_plain_int_arr = 3 [(.org.xresloader.field_list_min_size) = 1, (.org.xresloader.field_list_max_size) = 3];
   {
     std::size_t data_size = ::_pbi::WireFormatLite::Int32Size(
         this->_internal_test_plain_int_arr())
diff --git a/sample/cxx/v3/kind.pb.h b/sample/cxx/v3/kind.pb.h
index 3f830cab..0b623878 100755
--- a/sample/cxx/v3/kind.pb.h
+++ b/sample/cxx/v3/kind.pb.h
@@ -3387,7 +3387,7 @@ class arr_in_arr final : public ::google::protobuf::Message
     kTestInfoRoleFieldNumber = 11,
     kTestRoleUpgradeCfgFieldNumber = 12,
   };
-  // repeated int32 int_arr = 2;
+  // repeated int32 int_arr = 2 [(.org.xresloader.field_list_strip_option) = LIST_STRIP_NOTHING, (.org.xresloader.field_list_min_size) = 1, (.org.xresloader.field_list_max_size) = 3];
   int int_arr_size() const;
   private:
   int _internal_int_arr_size() const;
@@ -3688,7 +3688,7 @@ class arr_in_arr_cfg final : public ::google::protobuf::Message
   const ::arr_in_arr& arr(int index) const;
   ::arr_in_arr* add_arr();
   const ::google::protobuf::RepeatedPtrField<::arr_in_arr>& arr() const;
-  // repeated int32 test_plain_int_arr = 3;
+  // repeated int32 test_plain_int_arr = 3 [(.org.xresloader.field_list_min_size) = 1, (.org.xresloader.field_list_max_size) = 3];
   int test_plain_int_arr_size() const;
   private:
   int _internal_test_plain_int_arr_size() const;
@@ -5204,7 +5204,7 @@ inline void arr_in_arr::set_allocated_name(std::string* value) {
   // @@protoc_insertion_point(field_set_allocated:arr_in_arr.name)
 }
 
-// repeated int32 int_arr = 2;
+// repeated int32 int_arr = 2 [(.org.xresloader.field_list_strip_option) = LIST_STRIP_NOTHING, (.org.xresloader.field_list_min_size) = 1, (.org.xresloader.field_list_max_size) = 3];
 inline int arr_in_arr::_internal_int_arr_size() const {
   return _internal_int_arr().size();
 }
@@ -5667,7 +5667,7 @@ arr_in_arr_cfg::_internal_mutable_arr() {
   return &_impl_.arr_;
 }
 
-// repeated int32 test_plain_int_arr = 3;
+// repeated int32 test_plain_int_arr = 3 [(.org.xresloader.field_list_min_size) = 1, (.org.xresloader.field_list_max_size) = 3];
 inline int arr_in_arr_cfg::_internal_test_plain_int_arr_size() const {
   return _internal_test_plain_int_arr().size();
 }
diff --git a/sample/proto_v2/arr_in_arr_cfg.bin b/sample/proto_v2/arr_in_arr_cfg.bin
index dec4c57058c847c225eaa56996e055e41c2b9c69..303e7a31e56f4f97b9b7f8e1bd63d3ac60ddd697 100755
GIT binary patch
delta 152
zcmaFF_Jl2-YZfCHn~|QOg`R;ByP=)|2ud(3xff?78kw3|nH#4Wnj0A=n;RGyr=}Sg
zrWvOgn^>e8rX-u2C0SSkg;LWjOpJ|_4bqIvOe|AO6HSfNk}Xn9(@YJL4a`$E#@jP#
rZ(-z^>?b6|#rny~)mWe?~0a?sRh?!yXai-Y-3coG{

delta 150
zcmaFD_J}Q>YZfCHn~|QOxt^gAyP=)|2ud(3xff?78kw3|85kHQnj0Efq*@po8YZQg
z85^Y-7?>C(rWlzUnJ1?hB$=3)7+NG6q$DOMB_
     1.0.0.0
     Test arr_in_arr_cfg
-    sha256:6b2919a501f5cb402ca608dd55aa11785ba4214ff99908aba25609118cb9e0e7
-    2.17.1
+    sha256:dd55e67e5c1312ca507fedd631c54b8c1266ab82859ed36bd535db90ac36a95f
+    2.18.0
   
   
     
@@ -121,10 +121,12 @@
     
       
         301
+        0
         测试项-C
       
       
-        311
+        0
+        311
         测试项-B
         哦哦哦哦
       
diff --git a/sample/proto_v2/csv/ArrInArrCfgRec.csv b/sample/proto_v2/csv/ArrInArrCfgRec.csv
index f29070ec..b42d02e6 100644
--- a/sample/proto_v2/csv/ArrInArrCfgRec.csv
+++ b/sample/proto_v2/csv/ArrInArrCfgRec.csv
@@ -1,4 +1,4 @@
 "---","Name","Id","Arr","TestPlainIntArr","TestPlainEnumArr","TestPlainMsg","TestPlainMsgArr","TestMapIs","TestMapSm"
 "10001","10001","10001","((Name=""第一个-A"",IntArr=(101,102),StrArr=(""啦啦啦啦"",""嘞嘞嘞嘞"")),(Name=""第一个-B"",IntArr=(111,112),StrArr=(""嘟嘟嘟嘟"",""嚓嚓嚓嚓"")))","(1,2,3)","(10001,10001,10001)","(TestId1=1,TestId2=2,TestId3=0)","((TestId1=1,TestId2=2,TestId3=0),(TestId1=3,TestId2=4,TestId3=0),(TestId1=5,TestId2=6,TestId3=0))","((""10"",""Map嵌套模式[0].value""),(""11"",""Map嵌套模式[1].value""))","((""aa"",(Id=111,Level=""112"")),(""特殊:字符"",(Id=121,Level=""122"")))"
 "10002","10002","10002","((Name=""测试项-A"",IntArr=(201,202),StrArr=(""biubiubiubiu"",""唰唰唰唰"")),(Name=""测试项-B"",IntArr=(211,212),StrArr=(""哦哦哦哦"",""哈哈哈哈"")))","(4,5,6)","(10101,10101,10101)","(TestId1=3,TestId2=4,TestId3=5)","((TestId1=7,TestId2=8,TestId3=0),(TestId1=9,TestId2=10,TestId3=0))","((""20"",""Map嵌套模式[0].value""),(""21"",""Map嵌套模式[1].value""))","((""ba"",(Id=211,Level=""212"")),(""特殊.字符"",(Id=221,Level=""222"")))"
-"10003","10003","10003","((Name=""测试项-C"",IntArr=(301),StrArr=()),(Name=""测试项-B"",IntArr=(311),StrArr=(""哦哦哦哦"")))","(7,8,9)","(10001,10001,10001)","(TestId1=6,TestId2=0,TestId3=0)","((TestId1=11,TestId2=12,TestId3=0))","((""30"",""Map嵌套模式[0].value""),(""31"",""Map嵌套模式[1].value""))","((""ca"",(Id=311,Level=""312"")),(""cb"",(Id=321,Level=""322"")))"
+"10003","10003","10003","((Name=""测试项-C"",IntArr=(301,0),StrArr=()),(Name=""测试项-B"",IntArr=(0,311),StrArr=(""哦哦哦哦"")))","(7,8,9)","(10001,10001,10001)","(TestId1=6,TestId2=0,TestId3=0)","((TestId1=11,TestId2=12,TestId3=0))","((""30"",""Map嵌套模式[0].value""),(""31"",""Map嵌套模式[1].value""))","((""ca"",(Id=311,Level=""312"")),(""cb"",(Id=321,Level=""322"")))"
diff --git a/sample/proto_v2/csv/Private/ConfigRec/ArrInArr.cpp b/sample/proto_v2/csv/Private/ConfigRec/ArrInArr.cpp
index 0af10b9a..bcf057a7 100644
--- a/sample/proto_v2/csv/Private/ConfigRec/ArrInArr.cpp
+++ b/sample/proto_v2/csv/Private/ConfigRec/ArrInArr.cpp
@@ -1,5 +1,5 @@
 /**
- * This file is generated by xresloader 2.17.1, please don't edit it.
+ * This file is generated by xresloader 2.18.0, please don't edit it.
  * You can find more information about this xresloader on https://xresloader.atframe.work/ .
  * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues .
  */
diff --git a/sample/proto_v2/csv/Private/ConfigRec/ArrInArrCfg.cpp b/sample/proto_v2/csv/Private/ConfigRec/ArrInArrCfg.cpp
index 3648010f..b75590f8 100644
--- a/sample/proto_v2/csv/Private/ConfigRec/ArrInArrCfg.cpp
+++ b/sample/proto_v2/csv/Private/ConfigRec/ArrInArrCfg.cpp
@@ -1,5 +1,5 @@
 /**
- * This file is generated by xresloader 2.17.1, please don't edit it.
+ * This file is generated by xresloader 2.18.0, please don't edit it.
  * You can find more information about this xresloader on https://xresloader.atframe.work/ .
  * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues .
  */
diff --git a/sample/proto_v2/csv/Private/ConfigRec/Dep2Cfg.cpp b/sample/proto_v2/csv/Private/ConfigRec/Dep2Cfg.cpp
index 6d2bd99e..0c678071 100644
--- a/sample/proto_v2/csv/Private/ConfigRec/Dep2Cfg.cpp
+++ b/sample/proto_v2/csv/Private/ConfigRec/Dep2Cfg.cpp
@@ -1,5 +1,5 @@
 /**
- * This file is generated by xresloader 2.17.1, please don't edit it.
+ * This file is generated by xresloader 2.18.0, please don't edit it.
  * You can find more information about this xresloader on https://xresloader.atframe.work/ .
  * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues .
  */
diff --git a/sample/proto_v2/csv/Private/ConfigRec/EventCfg.cpp b/sample/proto_v2/csv/Private/ConfigRec/EventCfg.cpp
index 06a0e2a7..cf6013da 100644
--- a/sample/proto_v2/csv/Private/ConfigRec/EventCfg.cpp
+++ b/sample/proto_v2/csv/Private/ConfigRec/EventCfg.cpp
@@ -1,5 +1,5 @@
 /**
- * This file is generated by xresloader 2.17.1, please don't edit it.
+ * This file is generated by xresloader 2.18.0, please don't edit it.
  * You can find more information about this xresloader on https://xresloader.atframe.work/ .
  * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues .
  */
diff --git a/sample/proto_v2/csv/Private/ConfigRec/EventRewardItem.cpp b/sample/proto_v2/csv/Private/ConfigRec/EventRewardItem.cpp
index 701b93ac..46c708f3 100644
--- a/sample/proto_v2/csv/Private/ConfigRec/EventRewardItem.cpp
+++ b/sample/proto_v2/csv/Private/ConfigRec/EventRewardItem.cpp
@@ -1,5 +1,5 @@
 /**
- * This file is generated by xresloader 2.17.1, please don't edit it.
+ * This file is generated by xresloader 2.18.0, please don't edit it.
  * You can find more information about this xresloader on https://xresloader.atframe.work/ .
  * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues .
  */
diff --git a/sample/proto_v2/csv/Private/ConfigRec/EventRuleItem.cpp b/sample/proto_v2/csv/Private/ConfigRec/EventRuleItem.cpp
index 127c2d82..09fe6036 100644
--- a/sample/proto_v2/csv/Private/ConfigRec/EventRuleItem.cpp
+++ b/sample/proto_v2/csv/Private/ConfigRec/EventRuleItem.cpp
@@ -1,5 +1,5 @@
 /**
- * This file is generated by xresloader 2.17.1, please don't edit it.
+ * This file is generated by xresloader 2.18.0, please don't edit it.
  * You can find more information about this xresloader on https://xresloader.atframe.work/ .
  * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues .
  */
diff --git a/sample/proto_v2/csv/Private/ConfigRec/KeepOrStripEmptyListCfg.cpp b/sample/proto_v2/csv/Private/ConfigRec/KeepOrStripEmptyListCfg.cpp
index 81c68853..ed2be73c 100644
--- a/sample/proto_v2/csv/Private/ConfigRec/KeepOrStripEmptyListCfg.cpp
+++ b/sample/proto_v2/csv/Private/ConfigRec/KeepOrStripEmptyListCfg.cpp
@@ -1,5 +1,5 @@
 /**
- * This file is generated by xresloader 2.17.1, please don't edit it.
+ * This file is generated by xresloader 2.18.0, please don't edit it.
  * You can find more information about this xresloader on https://xresloader.atframe.work/ .
  * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues .
  */
diff --git a/sample/proto_v2/csv/Private/ConfigRec/RoleUpgradeCfg.cpp b/sample/proto_v2/csv/Private/ConfigRec/RoleUpgradeCfg.cpp
index b4e66228..12523130 100644
--- a/sample/proto_v2/csv/Private/ConfigRec/RoleUpgradeCfg.cpp
+++ b/sample/proto_v2/csv/Private/ConfigRec/RoleUpgradeCfg.cpp
@@ -1,5 +1,5 @@
 /**
- * This file is generated by xresloader 2.17.1, please don't edit it.
+ * This file is generated by xresloader 2.18.0, please don't edit it.
  * You can find more information about this xresloader on https://xresloader.atframe.work/ .
  * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues .
  */
diff --git a/sample/proto_v2/csv/Private/ConfigRec/TestMsgVerifier.cpp b/sample/proto_v2/csv/Private/ConfigRec/TestMsgVerifier.cpp
index de75635b..82cf10b0 100644
--- a/sample/proto_v2/csv/Private/ConfigRec/TestMsgVerifier.cpp
+++ b/sample/proto_v2/csv/Private/ConfigRec/TestMsgVerifier.cpp
@@ -1,5 +1,5 @@
 /**
- * This file is generated by xresloader 2.17.1, please don't edit it.
+ * This file is generated by xresloader 2.18.0, please don't edit it.
  * You can find more information about this xresloader on https://xresloader.atframe.work/ .
  * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues .
  */
diff --git a/sample/proto_v2/csv/Public/ConfigRec/ArrInArr.h b/sample/proto_v2/csv/Public/ConfigRec/ArrInArr.h
index b532f332..d9002bb9 100644
--- a/sample/proto_v2/csv/Public/ConfigRec/ArrInArr.h
+++ b/sample/proto_v2/csv/Public/ConfigRec/ArrInArr.h
@@ -1,5 +1,5 @@
 /**
- * This file is generated by xresloader 2.17.1, please don't edit it.
+ * This file is generated by xresloader 2.18.0, please don't edit it.
  * You can find more information about this xresloader on https://xresloader.atframe.work/ .
  * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues .
  */
diff --git a/sample/proto_v2/csv/Public/ConfigRec/ArrInArrCfg.h b/sample/proto_v2/csv/Public/ConfigRec/ArrInArrCfg.h
index d7d93e5d..01e8f8d1 100644
--- a/sample/proto_v2/csv/Public/ConfigRec/ArrInArrCfg.h
+++ b/sample/proto_v2/csv/Public/ConfigRec/ArrInArrCfg.h
@@ -1,5 +1,5 @@
 /**
- * This file is generated by xresloader 2.17.1, please don't edit it.
+ * This file is generated by xresloader 2.18.0, please don't edit it.
  * You can find more information about this xresloader on https://xresloader.atframe.work/ .
  * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues .
  */
diff --git a/sample/proto_v2/csv/Public/ConfigRec/Dep2Cfg.h b/sample/proto_v2/csv/Public/ConfigRec/Dep2Cfg.h
index 425ed52d..910962b9 100644
--- a/sample/proto_v2/csv/Public/ConfigRec/Dep2Cfg.h
+++ b/sample/proto_v2/csv/Public/ConfigRec/Dep2Cfg.h
@@ -1,5 +1,5 @@
 /**
- * This file is generated by xresloader 2.17.1, please don't edit it.
+ * This file is generated by xresloader 2.18.0, please don't edit it.
  * You can find more information about this xresloader on https://xresloader.atframe.work/ .
  * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues .
  */
diff --git a/sample/proto_v2/csv/Public/ConfigRec/EventCfg.h b/sample/proto_v2/csv/Public/ConfigRec/EventCfg.h
index 0d124e36..adb9ffbb 100644
--- a/sample/proto_v2/csv/Public/ConfigRec/EventCfg.h
+++ b/sample/proto_v2/csv/Public/ConfigRec/EventCfg.h
@@ -1,5 +1,5 @@
 /**
- * This file is generated by xresloader 2.17.1, please don't edit it.
+ * This file is generated by xresloader 2.18.0, please don't edit it.
  * You can find more information about this xresloader on https://xresloader.atframe.work/ .
  * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues .
  */
diff --git a/sample/proto_v2/csv/Public/ConfigRec/EventRewardItem.h b/sample/proto_v2/csv/Public/ConfigRec/EventRewardItem.h
index 344ea03c..533eee8f 100644
--- a/sample/proto_v2/csv/Public/ConfigRec/EventRewardItem.h
+++ b/sample/proto_v2/csv/Public/ConfigRec/EventRewardItem.h
@@ -1,5 +1,5 @@
 /**
- * This file is generated by xresloader 2.17.1, please don't edit it.
+ * This file is generated by xresloader 2.18.0, please don't edit it.
  * You can find more information about this xresloader on https://xresloader.atframe.work/ .
  * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues .
  */
diff --git a/sample/proto_v2/csv/Public/ConfigRec/EventRuleItem.h b/sample/proto_v2/csv/Public/ConfigRec/EventRuleItem.h
index 688345c4..1f43bb23 100644
--- a/sample/proto_v2/csv/Public/ConfigRec/EventRuleItem.h
+++ b/sample/proto_v2/csv/Public/ConfigRec/EventRuleItem.h
@@ -1,5 +1,5 @@
 /**
- * This file is generated by xresloader 2.17.1, please don't edit it.
+ * This file is generated by xresloader 2.18.0, please don't edit it.
  * You can find more information about this xresloader on https://xresloader.atframe.work/ .
  * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues .
  */
diff --git a/sample/proto_v2/csv/Public/ConfigRec/KeepOrStripEmptyListCfg.h b/sample/proto_v2/csv/Public/ConfigRec/KeepOrStripEmptyListCfg.h
index ad2e8da9..320c215f 100644
--- a/sample/proto_v2/csv/Public/ConfigRec/KeepOrStripEmptyListCfg.h
+++ b/sample/proto_v2/csv/Public/ConfigRec/KeepOrStripEmptyListCfg.h
@@ -1,5 +1,5 @@
 /**
- * This file is generated by xresloader 2.17.1, please don't edit it.
+ * This file is generated by xresloader 2.18.0, please don't edit it.
  * You can find more information about this xresloader on https://xresloader.atframe.work/ .
  * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues .
  */
diff --git a/sample/proto_v2/csv/Public/ConfigRec/RoleUpgradeCfg.h b/sample/proto_v2/csv/Public/ConfigRec/RoleUpgradeCfg.h
index 69ce889d..416ab967 100644
--- a/sample/proto_v2/csv/Public/ConfigRec/RoleUpgradeCfg.h
+++ b/sample/proto_v2/csv/Public/ConfigRec/RoleUpgradeCfg.h
@@ -1,5 +1,5 @@
 /**
- * This file is generated by xresloader 2.17.1, please don't edit it.
+ * This file is generated by xresloader 2.18.0, please don't edit it.
  * You can find more information about this xresloader on https://xresloader.atframe.work/ .
  * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues .
  */
diff --git a/sample/proto_v2/csv/Public/ConfigRec/TestMsgVerifier.h b/sample/proto_v2/csv/Public/ConfigRec/TestMsgVerifier.h
index a311384b..aa42a46a 100644
--- a/sample/proto_v2/csv/Public/ConfigRec/TestMsgVerifier.h
+++ b/sample/proto_v2/csv/Public/ConfigRec/TestMsgVerifier.h
@@ -1,5 +1,5 @@
 /**
- * This file is generated by xresloader 2.17.1, please don't edit it.
+ * This file is generated by xresloader 2.18.0, please don't edit it.
  * You can find more information about this xresloader on https://xresloader.atframe.work/ .
  * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues .
  */
diff --git a/sample/proto_v2/event_cfg.bin b/sample/proto_v2/event_cfg.bin
index 27b01520ec8fb0adf98330db42d455b5826eb07e..ada2dcc051179219183451cabb4b534bde4a73a5 100644
GIT binary patch
delta 20
bcmZ3&yo8yXYdIqqn~|QOg`UAi?wO1LFvSF!

delta 20
bcmZ3&yo8yXYdIqqn~|QOxt`%h?wO1LFvA3y

diff --git a/sample/proto_v2/event_cfg.lua b/sample/proto_v2/event_cfg.lua
index 903e4312..100ccc01 100644
--- a/sample/proto_v2/event_cfg.lua
+++ b/sample/proto_v2/event_cfg.lua
@@ -13,7 +13,7 @@ return {
     data_ver = "1.0.0.0",
     description = "Test event_cfg with oneof fields",
     hash_code = "sha256:f54ea4a17140ed6e75a9136bff6c0053251bb5a4cd3954d905cf5bac8fcce998",
-    xres_ver = "2.17.1",
+    xres_ver = "2.18.0",
   },
   [2] = "event_cfg",
   event_cfg = {
diff --git a/sample/proto_v2/json/ArrInArrCfg.json b/sample/proto_v2/json/ArrInArrCfg.json
index 4172d654..b11a860e 100644
--- a/sample/proto_v2/json/ArrInArrCfg.json
+++ b/sample/proto_v2/json/ArrInArrCfg.json
@@ -145,12 +145,18 @@
     {
         "Arr": [
             {
-                "IntArr": [301],
+                "IntArr": [
+                    301,
+                    0
+                ],
                 "Name": "测试项-C",
                 "StrArr": []
             },
             {
-                "IntArr": [311],
+                "IntArr": [
+                    0,
+                    311
+                ],
                 "Name": "测试项-B",
                 "StrArr": ["哦哦哦哦"]
             }
diff --git a/sample/proto_v2/json/KindConst.cpp b/sample/proto_v2/json/KindConst.cpp
index 17a92323..014a078b 100644
--- a/sample/proto_v2/json/KindConst.cpp
+++ b/sample/proto_v2/json/KindConst.cpp
@@ -1,5 +1,5 @@
 /**
- * This file is generated by xresloader 2.17.1, please don't edit it.
+ * This file is generated by xresloader 2.18.0, please don't edit it.
  * You can find more information about this xresloader on https://xresloader.atframe.work/ .
  * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues .
  */
diff --git a/sample/proto_v2/json/KindConst.h b/sample/proto_v2/json/KindConst.h
index b2886682..b69d0595 100644
--- a/sample/proto_v2/json/KindConst.h
+++ b/sample/proto_v2/json/KindConst.h
@@ -1,5 +1,5 @@
 /**
- * This file is generated by xresloader 2.17.1, please don't edit it.
+ * This file is generated by xresloader 2.18.0, please don't edit it.
  * You can find more information about this xresloader on https://xresloader.atframe.work/ .
  * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues .
  */
diff --git a/sample/proto_v2/json/Private/ConfigRec/ArrInArr.cpp b/sample/proto_v2/json/Private/ConfigRec/ArrInArr.cpp
index 6498851b..b8ce0664 100644
--- a/sample/proto_v2/json/Private/ConfigRec/ArrInArr.cpp
+++ b/sample/proto_v2/json/Private/ConfigRec/ArrInArr.cpp
@@ -1,5 +1,5 @@
 /**
- * This file is generated by xresloader 2.17.1, please don't edit it.
+ * This file is generated by xresloader 2.18.0, please don't edit it.
  * You can find more information about this xresloader on https://xresloader.atframe.work/ .
  * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues .
  */
diff --git a/sample/proto_v2/json/Private/ConfigRec/ArrInArrCfg.cpp b/sample/proto_v2/json/Private/ConfigRec/ArrInArrCfg.cpp
index a5051279..a4eae93e 100644
--- a/sample/proto_v2/json/Private/ConfigRec/ArrInArrCfg.cpp
+++ b/sample/proto_v2/json/Private/ConfigRec/ArrInArrCfg.cpp
@@ -1,5 +1,5 @@
 /**
- * This file is generated by xresloader 2.17.1, please don't edit it.
+ * This file is generated by xresloader 2.18.0, please don't edit it.
  * You can find more information about this xresloader on https://xresloader.atframe.work/ .
  * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues .
  */
diff --git a/sample/proto_v2/json/Private/ConfigRec/Dep2Cfg.cpp b/sample/proto_v2/json/Private/ConfigRec/Dep2Cfg.cpp
index 6816a6e6..246108e2 100644
--- a/sample/proto_v2/json/Private/ConfigRec/Dep2Cfg.cpp
+++ b/sample/proto_v2/json/Private/ConfigRec/Dep2Cfg.cpp
@@ -1,5 +1,5 @@
 /**
- * This file is generated by xresloader 2.17.1, please don't edit it.
+ * This file is generated by xresloader 2.18.0, please don't edit it.
  * You can find more information about this xresloader on https://xresloader.atframe.work/ .
  * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues .
  */
diff --git a/sample/proto_v2/json/Private/ConfigRec/EventCfg.cpp b/sample/proto_v2/json/Private/ConfigRec/EventCfg.cpp
index 7e27ea88..9739e60c 100644
--- a/sample/proto_v2/json/Private/ConfigRec/EventCfg.cpp
+++ b/sample/proto_v2/json/Private/ConfigRec/EventCfg.cpp
@@ -1,5 +1,5 @@
 /**
- * This file is generated by xresloader 2.17.1, please don't edit it.
+ * This file is generated by xresloader 2.18.0, please don't edit it.
  * You can find more information about this xresloader on https://xresloader.atframe.work/ .
  * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues .
  */
diff --git a/sample/proto_v2/json/Private/ConfigRec/EventRewardItem.cpp b/sample/proto_v2/json/Private/ConfigRec/EventRewardItem.cpp
index c1afcfbd..8d9feac3 100644
--- a/sample/proto_v2/json/Private/ConfigRec/EventRewardItem.cpp
+++ b/sample/proto_v2/json/Private/ConfigRec/EventRewardItem.cpp
@@ -1,5 +1,5 @@
 /**
- * This file is generated by xresloader 2.17.1, please don't edit it.
+ * This file is generated by xresloader 2.18.0, please don't edit it.
  * You can find more information about this xresloader on https://xresloader.atframe.work/ .
  * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues .
  */
diff --git a/sample/proto_v2/json/Private/ConfigRec/EventRuleItem.cpp b/sample/proto_v2/json/Private/ConfigRec/EventRuleItem.cpp
index 7f3562d2..9ea3ce4e 100644
--- a/sample/proto_v2/json/Private/ConfigRec/EventRuleItem.cpp
+++ b/sample/proto_v2/json/Private/ConfigRec/EventRuleItem.cpp
@@ -1,5 +1,5 @@
 /**
- * This file is generated by xresloader 2.17.1, please don't edit it.
+ * This file is generated by xresloader 2.18.0, please don't edit it.
  * You can find more information about this xresloader on https://xresloader.atframe.work/ .
  * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues .
  */
diff --git a/sample/proto_v2/json/Private/ConfigRec/KeepOrStripEmptyListCfg.cpp b/sample/proto_v2/json/Private/ConfigRec/KeepOrStripEmptyListCfg.cpp
index 81c68853..ed2be73c 100644
--- a/sample/proto_v2/json/Private/ConfigRec/KeepOrStripEmptyListCfg.cpp
+++ b/sample/proto_v2/json/Private/ConfigRec/KeepOrStripEmptyListCfg.cpp
@@ -1,5 +1,5 @@
 /**
- * This file is generated by xresloader 2.17.1, please don't edit it.
+ * This file is generated by xresloader 2.18.0, please don't edit it.
  * You can find more information about this xresloader on https://xresloader.atframe.work/ .
  * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues .
  */
diff --git a/sample/proto_v2/json/Private/ConfigRec/RoleUpgradeCfg.cpp b/sample/proto_v2/json/Private/ConfigRec/RoleUpgradeCfg.cpp
index 6c1c24a5..86d4ad23 100644
--- a/sample/proto_v2/json/Private/ConfigRec/RoleUpgradeCfg.cpp
+++ b/sample/proto_v2/json/Private/ConfigRec/RoleUpgradeCfg.cpp
@@ -1,5 +1,5 @@
 /**
- * This file is generated by xresloader 2.17.1, please don't edit it.
+ * This file is generated by xresloader 2.18.0, please don't edit it.
  * You can find more information about this xresloader on https://xresloader.atframe.work/ .
  * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues .
  */
diff --git a/sample/proto_v2/json/Private/ConfigRec/TestMsgVerifier.cpp b/sample/proto_v2/json/Private/ConfigRec/TestMsgVerifier.cpp
index 580dab33..83df1c1e 100644
--- a/sample/proto_v2/json/Private/ConfigRec/TestMsgVerifier.cpp
+++ b/sample/proto_v2/json/Private/ConfigRec/TestMsgVerifier.cpp
@@ -1,5 +1,5 @@
 /**
- * This file is generated by xresloader 2.17.1, please don't edit it.
+ * This file is generated by xresloader 2.18.0, please don't edit it.
  * You can find more information about this xresloader on https://xresloader.atframe.work/ .
  * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues .
  */
diff --git a/sample/proto_v2/json/Public/ConfigRec/ArrInArr.h b/sample/proto_v2/json/Public/ConfigRec/ArrInArr.h
index 92149634..33ecc2ef 100644
--- a/sample/proto_v2/json/Public/ConfigRec/ArrInArr.h
+++ b/sample/proto_v2/json/Public/ConfigRec/ArrInArr.h
@@ -1,5 +1,5 @@
 /**
- * This file is generated by xresloader 2.17.1, please don't edit it.
+ * This file is generated by xresloader 2.18.0, please don't edit it.
  * You can find more information about this xresloader on https://xresloader.atframe.work/ .
  * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues .
  */
diff --git a/sample/proto_v2/json/Public/ConfigRec/ArrInArrCfg.h b/sample/proto_v2/json/Public/ConfigRec/ArrInArrCfg.h
index 3062e0fa..c5ff6f0e 100644
--- a/sample/proto_v2/json/Public/ConfigRec/ArrInArrCfg.h
+++ b/sample/proto_v2/json/Public/ConfigRec/ArrInArrCfg.h
@@ -1,5 +1,5 @@
 /**
- * This file is generated by xresloader 2.17.1, please don't edit it.
+ * This file is generated by xresloader 2.18.0, please don't edit it.
  * You can find more information about this xresloader on https://xresloader.atframe.work/ .
  * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues .
  */
diff --git a/sample/proto_v2/json/Public/ConfigRec/Dep2Cfg.h b/sample/proto_v2/json/Public/ConfigRec/Dep2Cfg.h
index 852b0d8c..962ab40c 100644
--- a/sample/proto_v2/json/Public/ConfigRec/Dep2Cfg.h
+++ b/sample/proto_v2/json/Public/ConfigRec/Dep2Cfg.h
@@ -1,5 +1,5 @@
 /**
- * This file is generated by xresloader 2.17.1, please don't edit it.
+ * This file is generated by xresloader 2.18.0, please don't edit it.
  * You can find more information about this xresloader on https://xresloader.atframe.work/ .
  * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues .
  */
diff --git a/sample/proto_v2/json/Public/ConfigRec/EventCfg.h b/sample/proto_v2/json/Public/ConfigRec/EventCfg.h
index 2eef977e..1f1c5fb3 100644
--- a/sample/proto_v2/json/Public/ConfigRec/EventCfg.h
+++ b/sample/proto_v2/json/Public/ConfigRec/EventCfg.h
@@ -1,5 +1,5 @@
 /**
- * This file is generated by xresloader 2.17.1, please don't edit it.
+ * This file is generated by xresloader 2.18.0, please don't edit it.
  * You can find more information about this xresloader on https://xresloader.atframe.work/ .
  * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues .
  */
diff --git a/sample/proto_v2/json/Public/ConfigRec/EventRewardItem.h b/sample/proto_v2/json/Public/ConfigRec/EventRewardItem.h
index 6aa0b1ca..793e7108 100644
--- a/sample/proto_v2/json/Public/ConfigRec/EventRewardItem.h
+++ b/sample/proto_v2/json/Public/ConfigRec/EventRewardItem.h
@@ -1,5 +1,5 @@
 /**
- * This file is generated by xresloader 2.17.1, please don't edit it.
+ * This file is generated by xresloader 2.18.0, please don't edit it.
  * You can find more information about this xresloader on https://xresloader.atframe.work/ .
  * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues .
  */
diff --git a/sample/proto_v2/json/Public/ConfigRec/EventRuleItem.h b/sample/proto_v2/json/Public/ConfigRec/EventRuleItem.h
index 70cf63b8..56e6bc87 100644
--- a/sample/proto_v2/json/Public/ConfigRec/EventRuleItem.h
+++ b/sample/proto_v2/json/Public/ConfigRec/EventRuleItem.h
@@ -1,5 +1,5 @@
 /**
- * This file is generated by xresloader 2.17.1, please don't edit it.
+ * This file is generated by xresloader 2.18.0, please don't edit it.
  * You can find more information about this xresloader on https://xresloader.atframe.work/ .
  * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues .
  */
diff --git a/sample/proto_v2/json/Public/ConfigRec/KeepOrStripEmptyListCfg.h b/sample/proto_v2/json/Public/ConfigRec/KeepOrStripEmptyListCfg.h
index ad2e8da9..320c215f 100644
--- a/sample/proto_v2/json/Public/ConfigRec/KeepOrStripEmptyListCfg.h
+++ b/sample/proto_v2/json/Public/ConfigRec/KeepOrStripEmptyListCfg.h
@@ -1,5 +1,5 @@
 /**
- * This file is generated by xresloader 2.17.1, please don't edit it.
+ * This file is generated by xresloader 2.18.0, please don't edit it.
  * You can find more information about this xresloader on https://xresloader.atframe.work/ .
  * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues .
  */
diff --git a/sample/proto_v2/json/Public/ConfigRec/RoleUpgradeCfg.h b/sample/proto_v2/json/Public/ConfigRec/RoleUpgradeCfg.h
index 79aa8f0a..354e91e2 100644
--- a/sample/proto_v2/json/Public/ConfigRec/RoleUpgradeCfg.h
+++ b/sample/proto_v2/json/Public/ConfigRec/RoleUpgradeCfg.h
@@ -1,5 +1,5 @@
 /**
- * This file is generated by xresloader 2.17.1, please don't edit it.
+ * This file is generated by xresloader 2.18.0, please don't edit it.
  * You can find more information about this xresloader on https://xresloader.atframe.work/ .
  * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues .
  */
diff --git a/sample/proto_v2/json/Public/ConfigRec/TestMsgVerifier.h b/sample/proto_v2/json/Public/ConfigRec/TestMsgVerifier.h
index 4e8185ad..8520782d 100644
--- a/sample/proto_v2/json/Public/ConfigRec/TestMsgVerifier.h
+++ b/sample/proto_v2/json/Public/ConfigRec/TestMsgVerifier.h
@@ -1,5 +1,5 @@
 /**
- * This file is generated by xresloader 2.17.1, please don't edit it.
+ * This file is generated by xresloader 2.18.0, please don't edit it.
  * You can find more information about this xresloader on https://xresloader.atframe.work/ .
  * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues .
  */
diff --git a/sample/proto_v2/keep_empty_list_cfg.bin b/sample/proto_v2/keep_empty_list_cfg.bin
index 4af753a8cebd4212b0958a1683687497dc666ddf..53fae97aa8ba3964bbaee9ffd0f18c7a3486079b 100644
GIT binary patch
delta 20
bcmeyw{E3;HYceAjn~|QOg`UAi?&pjEJKY6u

delta 20
bcmeyw{E3;HYceAjn~|QOxt`%h?&pjEJKF_s

diff --git a/sample/proto_v2/keep_empty_list_cfg.lua b/sample/proto_v2/keep_empty_list_cfg.lua
index 0f13df0a..2ac8ada7 100644
--- a/sample/proto_v2/keep_empty_list_cfg.lua
+++ b/sample/proto_v2/keep_empty_list_cfg.lua
@@ -12,7 +12,7 @@ return {
     },
     data_ver = "1.0.0.0",
     hash_code = "sha256:e192b1278aea13633eb67e367edc99aa2bb8b487e32f3e8a0f9c5b975230304e",
-    xres_ver = "2.17.1",
+    xres_ver = "2.18.0",
   },
   [2] = "keep_or_strip_empty_list_cfg",
   keep_or_strip_empty_list_cfg = {
diff --git a/sample/proto_v2/kind.desc.json b/sample/proto_v2/kind.desc.json
index 2a832bfe..c167933f 100644
--- a/sample/proto_v2/kind.desc.json
+++ b/sample/proto_v2/kind.desc.json
@@ -118,7 +118,15 @@
           "int_arr": {
             "name": "int_arr",
             "number": 2,
-            "options": {"packed": true},
+            "options": {
+              "field_list_max_size": 3,
+              "field_list_min_size": 1,
+              "field_list_strip_option": {
+                "name": "LIST_STRIP_NOTHING",
+                "number": 1
+              },
+              "packed": true
+            },
             "type_name": "INT32"
           },
           "name": {
diff --git a/sample/proto_v2/kind.desc.lua b/sample/proto_v2/kind.desc.lua
index 1137fb73..7386a116 100644
--- a/sample/proto_v2/kind.desc.lua
+++ b/sample/proto_v2/kind.desc.lua
@@ -46,6 +46,12 @@ local const_res = {
               name = "int_arr",
               number = 2,
               options = {
+                field_list_max_size = 3,
+                field_list_min_size = 1,
+                field_list_strip_option = {
+                  name = "LIST_STRIP_NOTHING",
+                  number = 1,
+                },
                 packed = true,
               },
               type_name = "INT32",
diff --git a/sample/proto_v2/kind.pb b/sample/proto_v2/kind.pb
index ca6c3804738ddf034f885b9ab6afdcfbe3406218..2dfc0209f1315c640d067b61914bacc3771cdd92 100755
GIT binary patch
delta 55
zcmdm{wqI>S3KQea&8bX>SQ+~!Yj8Nrs&KJq=9R=J78OY_DKKlWI&ljyUa)7pVbA!$
Lo_TXU$966NSQ%Robx>-;K4uF&gN+9pcmOON1)Kl?

delta 14
VcmX>obx>-;K4x=0!;J?UcmOOL1)Kl?

diff --git a/sample/proto_v2/role_cfg.n.js b/sample/proto_v2/role_cfg.n.js
index 0cb3d1f1..7f15ff65 100755
--- a/sample/proto_v2/role_cfg.n.js
+++ b/sample/proto_v2/role_cfg.n.js
@@ -12,7 +12,7 @@ exports.role_cfg_header = {
   ],
   data_ver : "1.0.0.0",
   hash_code : "sha256:eeaf27d61a221566a4129cce5f868e1d929d571f6ad2859de106242f0acc820f",
-  xres_ver : "2.17.1"
+  xres_ver : "2.18.0"
 };
 exports.role_cfg = [
   {
diff --git a/sample/proto_v2/role_cfg.xml b/sample/proto_v2/role_cfg.xml
index 17015090..2a113743 100755
--- a/sample/proto_v2/role_cfg.xml
+++ b/sample/proto_v2/role_cfg.xml
@@ -1,2 +1,2 @@
 
-
77资源转换示例.xlsxkind1.0.0.0sha256:eeaf27d61a221566a4129cce5f868e1d929d571f6ad2859de106242f0acc820f2.17.1
04591504951504591501666627200016693056000166662720011012014/10/1351123100010欧若拉12:45:1513:45:1512:45:152022-10-252022-11-252022-10-25lalal欧若拉小魔女1000104591504951504591501666673115016693515150166667311522012014/10/1461654100021杰克4591549515459152022-10-25 12:45:152022-11-25 12:45:152022-10-25 12:45:15blebleble杰克海盗王子100011010139045915049515044555901666673115016693515150166667311543012014/10/1571sdadasd100032库拉4591513:45:15123:45:59166667311516693515151666673115hahaha库拉喵少年100011000110101850495150445520016666731150166935151501666701915840119:10:5081ffff100043莫瑞茨13:45:15123:45:20Z16666731152022-11-25 12:45:152022-10-25 12:45:15Zangel莫瑞茨1220445559123000000416720016693515151230000001666673115124123:45:59123:45:20.123+08:002022-11-25 12:45:152022-10-25 12:45:15.123+08:001230000004455201230000001666673115999995019:10:50 上午91gggg100055爱丽丝123:45:20.1232022-10-25 12:45:15.12318310001laopo爱丽丝1230000004591512300000016666731159996012014-10-20 19:50:50101hhhhh100066都玛西亚45915.1231666673115.12327410101keai都玛西亚role_cfg
\ No newline at end of file +
77资源转换示例.xlsxkind1.0.0.0sha256:eeaf27d61a221566a4129cce5f868e1d929d571f6ad2859de106242f0acc820f2.18.0
04591504951504591501666627200016693056000166662720011012014/10/1351123100010欧若拉12:45:1513:45:1512:45:152022-10-252022-11-252022-10-25lalal欧若拉小魔女1000104591504951504591501666673115016693515150166667311522012014/10/1461654100021杰克4591549515459152022-10-25 12:45:152022-11-25 12:45:152022-10-25 12:45:15blebleble杰克海盗王子100011010139045915049515044555901666673115016693515150166667311543012014/10/1571sdadasd100032库拉4591513:45:15123:45:59166667311516693515151666673115hahaha库拉喵少年100011000110101850495150445520016666731150166935151501666701915840119:10:5081ffff100043莫瑞茨13:45:15123:45:20Z16666731152022-11-25 12:45:152022-10-25 12:45:15Zangel莫瑞茨1220445559123000000416720016693515151230000001666673115124123:45:59123:45:20.123+08:002022-11-25 12:45:152022-10-25 12:45:15.123+08:001230000004455201230000001666673115999995019:10:50 上午91gggg100055爱丽丝123:45:20.1232022-10-25 12:45:15.12318310001laopo爱丽丝1230000004591512300000016666731159996012014-10-20 19:50:50101hhhhh100066都玛西亚45915.1231666673115.12327410101keai都玛西亚role_cfg
\ No newline at end of file diff --git a/sample/proto_v2/role_cfg_module.lua b/sample/proto_v2/role_cfg_module.lua index f4f1ff59..bdfca136 100755 --- a/sample/proto_v2/role_cfg_module.lua +++ b/sample/proto_v2/role_cfg_module.lua @@ -1,5 +1,5 @@ module("ProtoData.Kind.role_cfg", package.seeall) -- this file is generated by xresloader, please don't edit it. - header = { count = 7, data_source = { { count = 7, file = "资源转换示例.xlsx", sheet = "kind", }, }, data_ver = "1.0.0.0", hash_code = "sha256:f83885dbe713ab6b423cf917a202d67da647d58a4636dbad41575d5479a6e87a", xres_ver = "2.17.1", } + header = { count = 7, data_source = { { count = 7, file = "资源转换示例.xlsx", sheet = "kind", }, }, data_ver = "1.0.0.0", hash_code = "sha256:f83885dbe713ab6b423cf917a202d67da647d58a4636dbad41575d5479a6e87a", xres_ver = "2.18.0", } data_message_type = "role_cfg" role_cfg = { { convert_duration_arr = { { nanos = 0, seconds = 45915, }, { nanos = 0, seconds = 49515, }, }, convert_duration_one = { nanos = 0, seconds = 45915, }, convert_timepoint_arr = { { nanos = 0, seconds = 1666627200, }, { nanos = 0, seconds = 1669305600, }, }, convert_timepoint_one = { nanos = 0, seconds = 1666627200, }, cost_value = 1, dep_test = { dep2 = { id = 101, level = "2014/10/13", }, id = 51, name = "123", }, id = 10001, int_as_string = "0", name = "欧若拉", origin_duration_arr = { "12:45:15", "13:45:15", }, origin_duration_one = "12:45:15", origin_timepoint_arr = { "2022-10-25", "2022-11-25", }, origin_timepoint_one = "2022-10-25", test_array = { "lalal", "欧若拉", "小魔女", }, test_plain_enum_array = { 10001, }, }, { convert_duration_arr = { { nanos = 0, seconds = 45915, }, { nanos = 0, seconds = 49515, }, }, convert_duration_one = { nanos = 0, seconds = 45915, }, convert_timepoint_arr = { { nanos = 0, seconds = 1666673115, }, { nanos = 0, seconds = 1669351515, }, }, convert_timepoint_one = { nanos = 0, seconds = 1666673115, }, cost_value = 2, dep_test = { dep2 = { id = 201, level = "2014/10/14", }, id = 61, name = "654", }, id = 10002, int_as_string = "1", name = "杰克", origin_duration_arr = { "45915", "49515", }, origin_duration_one = "45915", origin_timepoint_arr = { "2022-10-25 12:45:15", "2022-11-25 12:45:15", }, origin_timepoint_one = "2022-10-25 12:45:15", test_array = { "blebleble", "杰克", "海盗王子", }, test_plain_enum_array = { 10001, 10101, }, unlock_level = 39, }, { convert_duration_arr = { { nanos = 0, seconds = 45915, }, { nanos = 0, seconds = 49515, }, }, convert_duration_one = { nanos = 0, seconds = 445559, }, convert_timepoint_arr = { { nanos = 0, seconds = 1666673115, }, { nanos = 0, seconds = 1669351515, }, }, convert_timepoint_one = { nanos = 0, seconds = 1666673115, }, cost_value = 4, dep_test = { dep2 = { id = 301, level = "2014/10/15", }, id = 71, name = "sdadasd", }, id = 10003, int_as_string = "2", name = "库拉", origin_duration_arr = { "45915", "13:45:15", }, origin_duration_one = "123:45:59", origin_timepoint_arr = { "1666673115", "1669351515", }, origin_timepoint_one = "1666673115", test_array = { "hahaha", "库拉", "喵少年", }, test_plain_enum_array = { 10001, 10001, 10101, }, unlock_level = 85, }, { convert_duration_arr = { { nanos = 0, seconds = 49515, }, }, convert_duration_one = { nanos = 0, seconds = 445520, }, convert_timepoint_arr = { { nanos = 0, seconds = 1666673115, }, { nanos = 0, seconds = 1669351515, }, }, convert_timepoint_one = { nanos = 0, seconds = 1666701915, }, cost_value = 8, dep_test = { dep2 = { id = 401, level = "19:10:50", }, id = 81, name = "ffff", }, id = 10004, int_as_string = "3", name = "莫瑞茨", origin_duration_arr = { "", "13:45:15", }, origin_duration_one = "123:45:20Z", origin_timepoint_arr = { "1666673115", "2022-11-25 12:45:15", }, origin_timepoint_one = "2022-10-25 12:45:15Z", test_array = { "angel", "莫瑞茨", }, unlock_level = 122, }, { convert_duration_arr = { { nanos = 0, seconds = 445559, }, }, convert_duration_one = { nanos = 123000000, seconds = 416720, }, convert_timepoint_arr = { { nanos = 0, seconds = 1669351515, }, }, convert_timepoint_one = { nanos = 123000000, seconds = 1666673115, }, dep_test = { id = 12, }, int_as_string = "4", origin_duration_arr = { "", "123:45:59", }, origin_duration_one = "123:45:20.123+08:00", origin_timepoint_arr = { "", "2022-11-25 12:45:15", }, origin_timepoint_one = "2022-10-25 12:45:15.123+08:00", }, { convert_duration_one = { nanos = 123000000, seconds = 445520, }, convert_timepoint_one = { nanos = 123000000, seconds = 1666673115, }, cost_type = 10001, cost_value = 99999, dep_test = { dep2 = { id = 501, level = "9:10:50 上午", }, id = 91, name = "gggg", }, id = 10005, int_as_string = "5", name = "爱丽丝", origin_duration_one = "123:45:20.123", origin_timepoint_one = "2022-10-25 12:45:15.123", test_array = { "laopo", "爱丽丝", }, unlock_level = 183, }, { convert_duration_one = { nanos = 123000000, seconds = 45915, }, convert_timepoint_one = { nanos = 123000000, seconds = 1666673115, }, cost_type = 10101, cost_value = 999, dep_test = { dep2 = { id = 601, level = "2014-10-20 19:50:50", }, id = 101, name = "hhhhh", }, id = 10006, int_as_string = "6", name = "都玛西亚", origin_duration_one = "45915.123", origin_timepoint_one = "1666673115.123", test_array = { "keai", "都玛西亚", }, unlock_level = 274, }, } \ No newline at end of file diff --git a/sample/proto_v2/role_upgrade_cfg.bin b/sample/proto_v2/role_upgrade_cfg.bin index ac4b473e74f016d35cc4b7713039f649fa64f3e1..0e235bb2cedba94807d0497fd6e421e974efcd65 100644 GIT binary patch delta 20 bcmeC<>Eq$%YGUGIGtx7(&@E2RU< delta 20 bcmeC<>Eq$%YGUGIGtx6O*E8J6&CCV>E29I- diff --git a/sample/proto_v2/role_upgrade_cfg.json b/sample/proto_v2/role_upgrade_cfg.json index db45e975..571d4a2e 100755 --- a/sample/proto_v2/role_upgrade_cfg.json +++ b/sample/proto_v2/role_upgrade_cfg.json @@ -16,7 +16,7 @@ "data_ver": "1.0.0.0", "description": "Test role_upgrade_cfg with multi keys\r\nTest role_upgrade_cfg with multi keys", "hash_code": "sha256:e356806bc55be9cc8a6c701d4295989e0fc3887b368681bb9457b0e51df8f445", - "xres_ver": "2.17.1" + "xres_ver": "2.18.0" }, {"role_upgrade_cfg": [ { diff --git a/sample/proto_v2/role_upgrade_cfg.lua b/sample/proto_v2/role_upgrade_cfg.lua index fd2e7564..12e026bb 100755 --- a/sample/proto_v2/role_upgrade_cfg.lua +++ b/sample/proto_v2/role_upgrade_cfg.lua @@ -18,7 +18,7 @@ return { data_ver = "1.0.0.0", description = "Test role_upgrade_cfg with multi keys\r\nTest role_upgrade_cfg with multi keys", hash_code = "sha256:e356806bc55be9cc8a6c701d4295989e0fc3887b368681bb9457b0e51df8f445", - xres_ver = "2.17.1", + xres_ver = "2.18.0", }, [2] = "role_upgrade_cfg", role_upgrade_cfg = { diff --git a/sample/proto_v2/strip_list_tail_cfg.bin b/sample/proto_v2/strip_list_tail_cfg.bin index 189a3bd16f92d36bf7dbdf135364d7d88de808fa..26322022503950ed0177763f3e785868aff99d6d 100644 GIT binary patch delta 20 bcmaFG{EC^IYceAjn~|QOg`UAi?)!`YI-Lbq delta 20 bcmaFG{EC^IYceAjn~|QOxt`%h?)!`YI-3Po diff --git a/sample/proto_v2/strip_list_tail_cfg.lua b/sample/proto_v2/strip_list_tail_cfg.lua index 4957f103..6dc247f3 100644 --- a/sample/proto_v2/strip_list_tail_cfg.lua +++ b/sample/proto_v2/strip_list_tail_cfg.lua @@ -12,7 +12,7 @@ return { }, data_ver = "1.0.0.0", hash_code = "sha256:bef5c76679b43b65aec7906f42010530fadae99f0e386d94e3a77e94a7d12e8e", - xres_ver = "2.17.1", + xres_ver = "2.18.0", }, [2] = "keep_or_strip_empty_list_cfg", keep_or_strip_empty_list_cfg = { diff --git a/sample/proto_v3/arr_in_arr_cfg.bin b/sample/proto_v3/arr_in_arr_cfg.bin index c0ef9f8e6e0026cdbe7a1e81a3bd5caea7768d7a..a1a9471408b17594636bec254a421ab8f87ec457 100755 GIT binary patch delta 152 zcmcb^c8@KdYZfCHn~|QOg`R;ByP=)|2ud(3xff?78kw3|8Je3Iq#Bu+8zdVTSSFjA zCz_-t8(5^8CmN+%m>47{C#IRCB`2mDr5GhzS{kP&r5PtBCz_|4m?W84q^261Zj85P s(%!_#G1*T@h>QE#*6tVUr@macQ`cFDc`XxzkOH!plMpk*JZ;o12&!S{S7mCL0?XnV6ZRTBaDJrWu=?nWm*!q!}4nm?xT;7+M-9Zj85P q(%itvG1*T@kc<1-*6tVUr@macQ`cFDX)TkGJhG6J5YyzNOfvz*!Y#o7 diff --git a/sample/proto_v3/arr_in_arr_cfg.lua b/sample/proto_v3/arr_in_arr_cfg.lua index 51656ec7..7da80c06 100755 --- a/sample/proto_v3/arr_in_arr_cfg.lua +++ b/sample/proto_v3/arr_in_arr_cfg.lua @@ -12,8 +12,8 @@ return { }, data_ver = "1.0.0.0", description = "Test arr_in_arr_cfg", - hash_code = "sha256:6b2919a501f5cb402ca608dd55aa11785ba4214ff99908aba25609118cb9e0e7", - xres_ver = "2.17.1", + hash_code = "sha256:dd55e67e5c1312ca507fedd631c54b8c1266ab82859ed36bd535db90ac36a95f", + xres_ver = "2.18.0", }, [2] = "arr_in_arr_cfg", arr_in_arr_cfg = { @@ -157,11 +157,13 @@ return { { int_arr = { 301, + 0, }, name = "测试项-C", }, { int_arr = { + 0, 311, }, name = "测试项-B", diff --git a/sample/proto_v3/arr_in_arr_cfg.xml b/sample/proto_v3/arr_in_arr_cfg.xml index 58b8868f..26f7efdb 100644 --- a/sample/proto_v3/arr_in_arr_cfg.xml +++ b/sample/proto_v3/arr_in_arr_cfg.xml @@ -11,8 +11,8 @@ 1.0.0.0 Test arr_in_arr_cfg - sha256:6b2919a501f5cb402ca608dd55aa11785ba4214ff99908aba25609118cb9e0e7 - 2.17.1 + sha256:dd55e67e5c1312ca507fedd631c54b8c1266ab82859ed36bd535db90ac36a95f + 2.18.0 @@ -121,10 +121,12 @@ 301 + 0 测试项-C - 311 + 0 + 311 测试项-B 哦哦哦哦 diff --git a/sample/proto_v3/csv/ArrInArrCfgRec.csv b/sample/proto_v3/csv/ArrInArrCfgRec.csv index cc54c293..c2005dda 100644 --- a/sample/proto_v3/csv/ArrInArrCfgRec.csv +++ b/sample/proto_v3/csv/ArrInArrCfgRec.csv @@ -1,4 +1,4 @@ "---","Name","Id","Arr","TestPlainIntArr","TestPlainEnumArr","TestPlainMsg","TestPlainMsgArr","TestMapIs","TestMapSm" "10001","10001","10001","((TestOnof="""",Name=""第一个-A"",IntArr=(101,102),StrArr=(""啦啦啦啦"",""嘞嘞嘞嘞""),TestInfoRole=(Id=0,UnlockLevel=0,CostType=0,CostValue=0,Name="""",DepTest=(Id=0,Name="""",Dep2=(Id=0,Level="""")),TestArray=(),IntAsString="""",TestPlainEnumArray=(),ConvertTimepointOne=(Seconds=0,Nanos=0),OriginTimepointOne="""",ConvertDurationOne=(Seconds=0,Nanos=0),OriginDurationOne="""",ConvertTimepointArr=(),OriginTimepointArr=(),ConvertDurationArr=(),OriginDurationArr=()),TestRoleUpgradeCfg=(Id=0,Level=0,CostType=0,CostValue=0,ScoreAdd=0)),(TestOnof="""",Name=""第一个-B"",IntArr=(111,112),StrArr=(""嘟嘟嘟嘟"",""嚓嚓嚓嚓""),TestInfoRole=(Id=0,UnlockLevel=0,CostType=0,CostValue=0,Name="""",DepTest=(Id=0,Name="""",Dep2=(Id=0,Level="""")),TestArray=(),IntAsString="""",TestPlainEnumArray=(),ConvertTimepointOne=(Seconds=0,Nanos=0),OriginTimepointOne="""",ConvertDurationOne=(Seconds=0,Nanos=0),OriginDurationOne="""",ConvertTimepointArr=(),OriginTimepointArr=(),ConvertDurationArr=(),OriginDurationArr=()),TestRoleUpgradeCfg=(Id=0,Level=0,CostType=0,CostValue=0,ScoreAdd=0)))","(1,2,3)","(10001,10001,10001)","(TestId1=1,TestId2=2,TestId3=0)","((TestId1=1,TestId2=2,TestId3=0),(TestId1=3,TestId2=4,TestId3=0),(TestId1=5,TestId2=6,TestId3=0))","((""10"",""Map嵌套模式[0].value""),(""11"",""Map嵌套模式[1].value""))","((""aa"",(Id=111,Level=""112"")),(""特殊:字符"",(Id=121,Level=""122"")))" "10002","10002","10002","((TestOnof="""",Name=""测试项-A"",IntArr=(201,202),StrArr=(""biubiubiubiu"",""唰唰唰唰""),TestInfoRole=(Id=0,UnlockLevel=0,CostType=0,CostValue=0,Name="""",DepTest=(Id=0,Name="""",Dep2=(Id=0,Level="""")),TestArray=(),IntAsString="""",TestPlainEnumArray=(),ConvertTimepointOne=(Seconds=0,Nanos=0),OriginTimepointOne="""",ConvertDurationOne=(Seconds=0,Nanos=0),OriginDurationOne="""",ConvertTimepointArr=(),OriginTimepointArr=(),ConvertDurationArr=(),OriginDurationArr=()),TestRoleUpgradeCfg=(Id=0,Level=0,CostType=0,CostValue=0,ScoreAdd=0)),(TestOnof="""",Name=""测试项-B"",IntArr=(211,212),StrArr=(""哦哦哦哦"",""哈哈哈哈""),TestInfoRole=(Id=0,UnlockLevel=0,CostType=0,CostValue=0,Name="""",DepTest=(Id=0,Name="""",Dep2=(Id=0,Level="""")),TestArray=(),IntAsString="""",TestPlainEnumArray=(),ConvertTimepointOne=(Seconds=0,Nanos=0),OriginTimepointOne="""",ConvertDurationOne=(Seconds=0,Nanos=0),OriginDurationOne="""",ConvertTimepointArr=(),OriginTimepointArr=(),ConvertDurationArr=(),OriginDurationArr=()),TestRoleUpgradeCfg=(Id=0,Level=0,CostType=0,CostValue=0,ScoreAdd=0)))","(4,5,6)","(10101,10101,10101)","(TestId1=3,TestId2=4,TestId3=5)","((TestId1=7,TestId2=8,TestId3=0),(TestId1=9,TestId2=10,TestId3=0))","((""20"",""Map嵌套模式[0].value""),(""21"",""Map嵌套模式[1].value""))","((""ba"",(Id=211,Level=""212"")),(""特殊.字符"",(Id=221,Level=""222"")))" -"10003","10003","10003","((TestOnof="""",Name=""测试项-C"",IntArr=(301),StrArr=(),TestInfoRole=(Id=0,UnlockLevel=0,CostType=0,CostValue=0,Name="""",DepTest=(Id=0,Name="""",Dep2=(Id=0,Level="""")),TestArray=(),IntAsString="""",TestPlainEnumArray=(),ConvertTimepointOne=(Seconds=0,Nanos=0),OriginTimepointOne="""",ConvertDurationOne=(Seconds=0,Nanos=0),OriginDurationOne="""",ConvertTimepointArr=(),OriginTimepointArr=(),ConvertDurationArr=(),OriginDurationArr=()),TestRoleUpgradeCfg=(Id=0,Level=0,CostType=0,CostValue=0,ScoreAdd=0)),(TestOnof="""",Name=""测试项-B"",IntArr=(311),StrArr=(""哦哦哦哦""),TestInfoRole=(Id=0,UnlockLevel=0,CostType=0,CostValue=0,Name="""",DepTest=(Id=0,Name="""",Dep2=(Id=0,Level="""")),TestArray=(),IntAsString="""",TestPlainEnumArray=(),ConvertTimepointOne=(Seconds=0,Nanos=0),OriginTimepointOne="""",ConvertDurationOne=(Seconds=0,Nanos=0),OriginDurationOne="""",ConvertTimepointArr=(),OriginTimepointArr=(),ConvertDurationArr=(),OriginDurationArr=()),TestRoleUpgradeCfg=(Id=0,Level=0,CostType=0,CostValue=0,ScoreAdd=0)))","(7,8,9)","(10001,10001,10001)","(TestId1=6,TestId2=0,TestId3=0)","((TestId1=11,TestId2=12,TestId3=0))","((""30"",""Map嵌套模式[0].value""),(""31"",""Map嵌套模式[1].value""))","((""ca"",(Id=311,Level=""312"")),(""cb"",(Id=321,Level=""322"")))" +"10003","10003","10003","((TestOnof="""",Name=""测试项-C"",IntArr=(301,0),StrArr=(),TestInfoRole=(Id=0,UnlockLevel=0,CostType=0,CostValue=0,Name="""",DepTest=(Id=0,Name="""",Dep2=(Id=0,Level="""")),TestArray=(),IntAsString="""",TestPlainEnumArray=(),ConvertTimepointOne=(Seconds=0,Nanos=0),OriginTimepointOne="""",ConvertDurationOne=(Seconds=0,Nanos=0),OriginDurationOne="""",ConvertTimepointArr=(),OriginTimepointArr=(),ConvertDurationArr=(),OriginDurationArr=()),TestRoleUpgradeCfg=(Id=0,Level=0,CostType=0,CostValue=0,ScoreAdd=0)),(TestOnof="""",Name=""测试项-B"",IntArr=(0,311),StrArr=(""哦哦哦哦""),TestInfoRole=(Id=0,UnlockLevel=0,CostType=0,CostValue=0,Name="""",DepTest=(Id=0,Name="""",Dep2=(Id=0,Level="""")),TestArray=(),IntAsString="""",TestPlainEnumArray=(),ConvertTimepointOne=(Seconds=0,Nanos=0),OriginTimepointOne="""",ConvertDurationOne=(Seconds=0,Nanos=0),OriginDurationOne="""",ConvertTimepointArr=(),OriginTimepointArr=(),ConvertDurationArr=(),OriginDurationArr=()),TestRoleUpgradeCfg=(Id=0,Level=0,CostType=0,CostValue=0,ScoreAdd=0)))","(7,8,9)","(10001,10001,10001)","(TestId1=6,TestId2=0,TestId3=0)","((TestId1=11,TestId2=12,TestId3=0))","((""30"",""Map嵌套模式[0].value""),(""31"",""Map嵌套模式[1].value""))","((""ca"",(Id=311,Level=""312"")),(""cb"",(Id=321,Level=""322"")))" diff --git a/sample/proto_v3/csv/Private/ConfigRec/ArrInArr.cpp b/sample/proto_v3/csv/Private/ConfigRec/ArrInArr.cpp index 5e826ed8..66e06d16 100644 --- a/sample/proto_v3/csv/Private/ConfigRec/ArrInArr.cpp +++ b/sample/proto_v3/csv/Private/ConfigRec/ArrInArr.cpp @@ -1,5 +1,5 @@ /** - * This file is generated by xresloader 2.17.1, please don't edit it. + * This file is generated by xresloader 2.18.0, please don't edit it. * You can find more information about this xresloader on https://xresloader.atframe.work/ . * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues . */ diff --git a/sample/proto_v3/csv/Private/ConfigRec/ArrInArrCfg.cpp b/sample/proto_v3/csv/Private/ConfigRec/ArrInArrCfg.cpp index 3648010f..b75590f8 100644 --- a/sample/proto_v3/csv/Private/ConfigRec/ArrInArrCfg.cpp +++ b/sample/proto_v3/csv/Private/ConfigRec/ArrInArrCfg.cpp @@ -1,5 +1,5 @@ /** - * This file is generated by xresloader 2.17.1, please don't edit it. + * This file is generated by xresloader 2.18.0, please don't edit it. * You can find more information about this xresloader on https://xresloader.atframe.work/ . * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues . */ diff --git a/sample/proto_v3/csv/Private/ConfigRec/Dep2Cfg.cpp b/sample/proto_v3/csv/Private/ConfigRec/Dep2Cfg.cpp index 6d2bd99e..0c678071 100644 --- a/sample/proto_v3/csv/Private/ConfigRec/Dep2Cfg.cpp +++ b/sample/proto_v3/csv/Private/ConfigRec/Dep2Cfg.cpp @@ -1,5 +1,5 @@ /** - * This file is generated by xresloader 2.17.1, please don't edit it. + * This file is generated by xresloader 2.18.0, please don't edit it. * You can find more information about this xresloader on https://xresloader.atframe.work/ . * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues . */ diff --git a/sample/proto_v3/csv/Private/ConfigRec/DepCfg.cpp b/sample/proto_v3/csv/Private/ConfigRec/DepCfg.cpp index db66801f..ac75fc1c 100644 --- a/sample/proto_v3/csv/Private/ConfigRec/DepCfg.cpp +++ b/sample/proto_v3/csv/Private/ConfigRec/DepCfg.cpp @@ -1,5 +1,5 @@ /** - * This file is generated by xresloader 2.17.1, please don't edit it. + * This file is generated by xresloader 2.18.0, please don't edit it. * You can find more information about this xresloader on https://xresloader.atframe.work/ . * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues . */ diff --git a/sample/proto_v3/csv/Private/ConfigRec/EventCfg.cpp b/sample/proto_v3/csv/Private/ConfigRec/EventCfg.cpp index 06a0e2a7..cf6013da 100644 --- a/sample/proto_v3/csv/Private/ConfigRec/EventCfg.cpp +++ b/sample/proto_v3/csv/Private/ConfigRec/EventCfg.cpp @@ -1,5 +1,5 @@ /** - * This file is generated by xresloader 2.17.1, please don't edit it. + * This file is generated by xresloader 2.18.0, please don't edit it. * You can find more information about this xresloader on https://xresloader.atframe.work/ . * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues . */ diff --git a/sample/proto_v3/csv/Private/ConfigRec/EventRewardItem.cpp b/sample/proto_v3/csv/Private/ConfigRec/EventRewardItem.cpp index 701b93ac..46c708f3 100644 --- a/sample/proto_v3/csv/Private/ConfigRec/EventRewardItem.cpp +++ b/sample/proto_v3/csv/Private/ConfigRec/EventRewardItem.cpp @@ -1,5 +1,5 @@ /** - * This file is generated by xresloader 2.17.1, please don't edit it. + * This file is generated by xresloader 2.18.0, please don't edit it. * You can find more information about this xresloader on https://xresloader.atframe.work/ . * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues . */ diff --git a/sample/proto_v3/csv/Private/ConfigRec/EventRuleItem.cpp b/sample/proto_v3/csv/Private/ConfigRec/EventRuleItem.cpp index 127c2d82..09fe6036 100644 --- a/sample/proto_v3/csv/Private/ConfigRec/EventRuleItem.cpp +++ b/sample/proto_v3/csv/Private/ConfigRec/EventRuleItem.cpp @@ -1,5 +1,5 @@ /** - * This file is generated by xresloader 2.17.1, please don't edit it. + * This file is generated by xresloader 2.18.0, please don't edit it. * You can find more information about this xresloader on https://xresloader.atframe.work/ . * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues . */ diff --git a/sample/proto_v3/csv/Private/ConfigRec/GoogleProtobufDuration.cpp b/sample/proto_v3/csv/Private/ConfigRec/GoogleProtobufDuration.cpp index 0ac87ec2..efbe7831 100644 --- a/sample/proto_v3/csv/Private/ConfigRec/GoogleProtobufDuration.cpp +++ b/sample/proto_v3/csv/Private/ConfigRec/GoogleProtobufDuration.cpp @@ -1,5 +1,5 @@ /** - * This file is generated by xresloader 2.17.1, please don't edit it. + * This file is generated by xresloader 2.18.0, please don't edit it. * You can find more information about this xresloader on https://xresloader.atframe.work/ . * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues . */ diff --git a/sample/proto_v3/csv/Private/ConfigRec/GoogleProtobufTimestamp.cpp b/sample/proto_v3/csv/Private/ConfigRec/GoogleProtobufTimestamp.cpp index b13d299b..6ee5b922 100644 --- a/sample/proto_v3/csv/Private/ConfigRec/GoogleProtobufTimestamp.cpp +++ b/sample/proto_v3/csv/Private/ConfigRec/GoogleProtobufTimestamp.cpp @@ -1,5 +1,5 @@ /** - * This file is generated by xresloader 2.17.1, please don't edit it. + * This file is generated by xresloader 2.18.0, please don't edit it. * You can find more information about this xresloader on https://xresloader.atframe.work/ . * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues . */ diff --git a/sample/proto_v3/csv/Private/ConfigRec/KeepOrStripEmptyListCfg.cpp b/sample/proto_v3/csv/Private/ConfigRec/KeepOrStripEmptyListCfg.cpp index 81c68853..ed2be73c 100644 --- a/sample/proto_v3/csv/Private/ConfigRec/KeepOrStripEmptyListCfg.cpp +++ b/sample/proto_v3/csv/Private/ConfigRec/KeepOrStripEmptyListCfg.cpp @@ -1,5 +1,5 @@ /** - * This file is generated by xresloader 2.17.1, please don't edit it. + * This file is generated by xresloader 2.18.0, please don't edit it. * You can find more information about this xresloader on https://xresloader.atframe.work/ . * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues . */ diff --git a/sample/proto_v3/csv/Private/ConfigRec/RoleCfg.cpp b/sample/proto_v3/csv/Private/ConfigRec/RoleCfg.cpp index 88c851a2..40f0c1f7 100644 --- a/sample/proto_v3/csv/Private/ConfigRec/RoleCfg.cpp +++ b/sample/proto_v3/csv/Private/ConfigRec/RoleCfg.cpp @@ -1,5 +1,5 @@ /** - * This file is generated by xresloader 2.17.1, please don't edit it. + * This file is generated by xresloader 2.18.0, please don't edit it. * You can find more information about this xresloader on https://xresloader.atframe.work/ . * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues . */ diff --git a/sample/proto_v3/csv/Private/ConfigRec/RoleUpgradeCfg.cpp b/sample/proto_v3/csv/Private/ConfigRec/RoleUpgradeCfg.cpp index 99dba6e4..4062ec1f 100644 --- a/sample/proto_v3/csv/Private/ConfigRec/RoleUpgradeCfg.cpp +++ b/sample/proto_v3/csv/Private/ConfigRec/RoleUpgradeCfg.cpp @@ -1,5 +1,5 @@ /** - * This file is generated by xresloader 2.17.1, please don't edit it. + * This file is generated by xresloader 2.18.0, please don't edit it. * You can find more information about this xresloader on https://xresloader.atframe.work/ . * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues . */ diff --git a/sample/proto_v3/csv/Private/ConfigRec/TestMsgVerifier.cpp b/sample/proto_v3/csv/Private/ConfigRec/TestMsgVerifier.cpp index de75635b..82cf10b0 100644 --- a/sample/proto_v3/csv/Private/ConfigRec/TestMsgVerifier.cpp +++ b/sample/proto_v3/csv/Private/ConfigRec/TestMsgVerifier.cpp @@ -1,5 +1,5 @@ /** - * This file is generated by xresloader 2.17.1, please don't edit it. + * This file is generated by xresloader 2.18.0, please don't edit it. * You can find more information about this xresloader on https://xresloader.atframe.work/ . * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues . */ diff --git a/sample/proto_v3/csv/Public/ConfigRec/ArrInArr.h b/sample/proto_v3/csv/Public/ConfigRec/ArrInArr.h index d0350cc9..ddbe6cfd 100644 --- a/sample/proto_v3/csv/Public/ConfigRec/ArrInArr.h +++ b/sample/proto_v3/csv/Public/ConfigRec/ArrInArr.h @@ -1,5 +1,5 @@ /** - * This file is generated by xresloader 2.17.1, please don't edit it. + * This file is generated by xresloader 2.18.0, please don't edit it. * You can find more information about this xresloader on https://xresloader.atframe.work/ . * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues . */ diff --git a/sample/proto_v3/csv/Public/ConfigRec/ArrInArrCfg.h b/sample/proto_v3/csv/Public/ConfigRec/ArrInArrCfg.h index d7d93e5d..01e8f8d1 100644 --- a/sample/proto_v3/csv/Public/ConfigRec/ArrInArrCfg.h +++ b/sample/proto_v3/csv/Public/ConfigRec/ArrInArrCfg.h @@ -1,5 +1,5 @@ /** - * This file is generated by xresloader 2.17.1, please don't edit it. + * This file is generated by xresloader 2.18.0, please don't edit it. * You can find more information about this xresloader on https://xresloader.atframe.work/ . * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues . */ diff --git a/sample/proto_v3/csv/Public/ConfigRec/Dep2Cfg.h b/sample/proto_v3/csv/Public/ConfigRec/Dep2Cfg.h index 425ed52d..910962b9 100644 --- a/sample/proto_v3/csv/Public/ConfigRec/Dep2Cfg.h +++ b/sample/proto_v3/csv/Public/ConfigRec/Dep2Cfg.h @@ -1,5 +1,5 @@ /** - * This file is generated by xresloader 2.17.1, please don't edit it. + * This file is generated by xresloader 2.18.0, please don't edit it. * You can find more information about this xresloader on https://xresloader.atframe.work/ . * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues . */ diff --git a/sample/proto_v3/csv/Public/ConfigRec/DepCfg.h b/sample/proto_v3/csv/Public/ConfigRec/DepCfg.h index 699af680..4aa4f10a 100644 --- a/sample/proto_v3/csv/Public/ConfigRec/DepCfg.h +++ b/sample/proto_v3/csv/Public/ConfigRec/DepCfg.h @@ -1,5 +1,5 @@ /** - * This file is generated by xresloader 2.17.1, please don't edit it. + * This file is generated by xresloader 2.18.0, please don't edit it. * You can find more information about this xresloader on https://xresloader.atframe.work/ . * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues . */ diff --git a/sample/proto_v3/csv/Public/ConfigRec/EventCfg.h b/sample/proto_v3/csv/Public/ConfigRec/EventCfg.h index 0d124e36..adb9ffbb 100644 --- a/sample/proto_v3/csv/Public/ConfigRec/EventCfg.h +++ b/sample/proto_v3/csv/Public/ConfigRec/EventCfg.h @@ -1,5 +1,5 @@ /** - * This file is generated by xresloader 2.17.1, please don't edit it. + * This file is generated by xresloader 2.18.0, please don't edit it. * You can find more information about this xresloader on https://xresloader.atframe.work/ . * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues . */ diff --git a/sample/proto_v3/csv/Public/ConfigRec/EventRewardItem.h b/sample/proto_v3/csv/Public/ConfigRec/EventRewardItem.h index 344ea03c..533eee8f 100644 --- a/sample/proto_v3/csv/Public/ConfigRec/EventRewardItem.h +++ b/sample/proto_v3/csv/Public/ConfigRec/EventRewardItem.h @@ -1,5 +1,5 @@ /** - * This file is generated by xresloader 2.17.1, please don't edit it. + * This file is generated by xresloader 2.18.0, please don't edit it. * You can find more information about this xresloader on https://xresloader.atframe.work/ . * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues . */ diff --git a/sample/proto_v3/csv/Public/ConfigRec/EventRuleItem.h b/sample/proto_v3/csv/Public/ConfigRec/EventRuleItem.h index 688345c4..1f43bb23 100644 --- a/sample/proto_v3/csv/Public/ConfigRec/EventRuleItem.h +++ b/sample/proto_v3/csv/Public/ConfigRec/EventRuleItem.h @@ -1,5 +1,5 @@ /** - * This file is generated by xresloader 2.17.1, please don't edit it. + * This file is generated by xresloader 2.18.0, please don't edit it. * You can find more information about this xresloader on https://xresloader.atframe.work/ . * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues . */ diff --git a/sample/proto_v3/csv/Public/ConfigRec/GoogleProtobufDuration.h b/sample/proto_v3/csv/Public/ConfigRec/GoogleProtobufDuration.h index 60ecfe78..e6085c93 100644 --- a/sample/proto_v3/csv/Public/ConfigRec/GoogleProtobufDuration.h +++ b/sample/proto_v3/csv/Public/ConfigRec/GoogleProtobufDuration.h @@ -1,5 +1,5 @@ /** - * This file is generated by xresloader 2.17.1, please don't edit it. + * This file is generated by xresloader 2.18.0, please don't edit it. * You can find more information about this xresloader on https://xresloader.atframe.work/ . * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues . */ diff --git a/sample/proto_v3/csv/Public/ConfigRec/GoogleProtobufTimestamp.h b/sample/proto_v3/csv/Public/ConfigRec/GoogleProtobufTimestamp.h index 11e9feae..65a7fc57 100644 --- a/sample/proto_v3/csv/Public/ConfigRec/GoogleProtobufTimestamp.h +++ b/sample/proto_v3/csv/Public/ConfigRec/GoogleProtobufTimestamp.h @@ -1,5 +1,5 @@ /** - * This file is generated by xresloader 2.17.1, please don't edit it. + * This file is generated by xresloader 2.18.0, please don't edit it. * You can find more information about this xresloader on https://xresloader.atframe.work/ . * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues . */ diff --git a/sample/proto_v3/csv/Public/ConfigRec/KeepOrStripEmptyListCfg.h b/sample/proto_v3/csv/Public/ConfigRec/KeepOrStripEmptyListCfg.h index ad2e8da9..320c215f 100644 --- a/sample/proto_v3/csv/Public/ConfigRec/KeepOrStripEmptyListCfg.h +++ b/sample/proto_v3/csv/Public/ConfigRec/KeepOrStripEmptyListCfg.h @@ -1,5 +1,5 @@ /** - * This file is generated by xresloader 2.17.1, please don't edit it. + * This file is generated by xresloader 2.18.0, please don't edit it. * You can find more information about this xresloader on https://xresloader.atframe.work/ . * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues . */ diff --git a/sample/proto_v3/csv/Public/ConfigRec/RoleCfg.h b/sample/proto_v3/csv/Public/ConfigRec/RoleCfg.h index da9710b2..f81cf85e 100644 --- a/sample/proto_v3/csv/Public/ConfigRec/RoleCfg.h +++ b/sample/proto_v3/csv/Public/ConfigRec/RoleCfg.h @@ -1,5 +1,5 @@ /** - * This file is generated by xresloader 2.17.1, please don't edit it. + * This file is generated by xresloader 2.18.0, please don't edit it. * You can find more information about this xresloader on https://xresloader.atframe.work/ . * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues . */ diff --git a/sample/proto_v3/csv/Public/ConfigRec/RoleUpgradeCfg.h b/sample/proto_v3/csv/Public/ConfigRec/RoleUpgradeCfg.h index 69ce889d..416ab967 100644 --- a/sample/proto_v3/csv/Public/ConfigRec/RoleUpgradeCfg.h +++ b/sample/proto_v3/csv/Public/ConfigRec/RoleUpgradeCfg.h @@ -1,5 +1,5 @@ /** - * This file is generated by xresloader 2.17.1, please don't edit it. + * This file is generated by xresloader 2.18.0, please don't edit it. * You can find more information about this xresloader on https://xresloader.atframe.work/ . * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues . */ diff --git a/sample/proto_v3/csv/Public/ConfigRec/TestMsgVerifier.h b/sample/proto_v3/csv/Public/ConfigRec/TestMsgVerifier.h index a311384b..aa42a46a 100644 --- a/sample/proto_v3/csv/Public/ConfigRec/TestMsgVerifier.h +++ b/sample/proto_v3/csv/Public/ConfigRec/TestMsgVerifier.h @@ -1,5 +1,5 @@ /** - * This file is generated by xresloader 2.17.1, please don't edit it. + * This file is generated by xresloader 2.18.0, please don't edit it. * You can find more information about this xresloader on https://xresloader.atframe.work/ . * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues . */ diff --git a/sample/proto_v3/event_cfg.bin b/sample/proto_v3/event_cfg.bin index 27b01520ec8fb0adf98330db42d455b5826eb07e..ada2dcc051179219183451cabb4b534bde4a73a5 100644 GIT binary patch delta 20 bcmZ3&yo8yXYdIqqn~|QOg`UAi?wO1LFvSF! delta 20 bcmZ3&yo8yXYdIqqn~|QOxt`%h?wO1LFvA3y diff --git a/sample/proto_v3/event_cfg.lua b/sample/proto_v3/event_cfg.lua index 903e4312..100ccc01 100644 --- a/sample/proto_v3/event_cfg.lua +++ b/sample/proto_v3/event_cfg.lua @@ -13,7 +13,7 @@ return { data_ver = "1.0.0.0", description = "Test event_cfg with oneof fields", hash_code = "sha256:f54ea4a17140ed6e75a9136bff6c0053251bb5a4cd3954d905cf5bac8fcce998", - xres_ver = "2.17.1", + xres_ver = "2.18.0", }, [2] = "event_cfg", event_cfg = { diff --git a/sample/proto_v3/json/ArrInArrCfg.json b/sample/proto_v3/json/ArrInArrCfg.json index 3a091b2e..47cf3c50 100644 --- a/sample/proto_v3/json/ArrInArrCfg.json +++ b/sample/proto_v3/json/ArrInArrCfg.json @@ -305,7 +305,10 @@ { "Arr": [ { - "IntArr": [301], + "IntArr": [ + 301, + 0 + ], "Name": "测试项-C", "StrArr": [], "TestInfoRole": { @@ -350,7 +353,10 @@ } }, { - "IntArr": [311], + "IntArr": [ + 0, + 311 + ], "Name": "测试项-B", "StrArr": ["哦哦哦哦"], "TestInfoRole": { diff --git a/sample/proto_v3/json/KindConst.cpp b/sample/proto_v3/json/KindConst.cpp index 17a92323..014a078b 100644 --- a/sample/proto_v3/json/KindConst.cpp +++ b/sample/proto_v3/json/KindConst.cpp @@ -1,5 +1,5 @@ /** - * This file is generated by xresloader 2.17.1, please don't edit it. + * This file is generated by xresloader 2.18.0, please don't edit it. * You can find more information about this xresloader on https://xresloader.atframe.work/ . * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues . */ diff --git a/sample/proto_v3/json/KindConst.h b/sample/proto_v3/json/KindConst.h index b2886682..b69d0595 100644 --- a/sample/proto_v3/json/KindConst.h +++ b/sample/proto_v3/json/KindConst.h @@ -1,5 +1,5 @@ /** - * This file is generated by xresloader 2.17.1, please don't edit it. + * This file is generated by xresloader 2.18.0, please don't edit it. * You can find more information about this xresloader on https://xresloader.atframe.work/ . * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues . */ diff --git a/sample/proto_v3/json/Private/ConfigRec/ArrInArr.cpp b/sample/proto_v3/json/Private/ConfigRec/ArrInArr.cpp index c602e35e..b4547916 100644 --- a/sample/proto_v3/json/Private/ConfigRec/ArrInArr.cpp +++ b/sample/proto_v3/json/Private/ConfigRec/ArrInArr.cpp @@ -1,5 +1,5 @@ /** - * This file is generated by xresloader 2.17.1, please don't edit it. + * This file is generated by xresloader 2.18.0, please don't edit it. * You can find more information about this xresloader on https://xresloader.atframe.work/ . * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues . */ diff --git a/sample/proto_v3/json/Private/ConfigRec/ArrInArrCfg.cpp b/sample/proto_v3/json/Private/ConfigRec/ArrInArrCfg.cpp index a5051279..a4eae93e 100644 --- a/sample/proto_v3/json/Private/ConfigRec/ArrInArrCfg.cpp +++ b/sample/proto_v3/json/Private/ConfigRec/ArrInArrCfg.cpp @@ -1,5 +1,5 @@ /** - * This file is generated by xresloader 2.17.1, please don't edit it. + * This file is generated by xresloader 2.18.0, please don't edit it. * You can find more information about this xresloader on https://xresloader.atframe.work/ . * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues . */ diff --git a/sample/proto_v3/json/Private/ConfigRec/Dep2Cfg.cpp b/sample/proto_v3/json/Private/ConfigRec/Dep2Cfg.cpp index 6816a6e6..246108e2 100644 --- a/sample/proto_v3/json/Private/ConfigRec/Dep2Cfg.cpp +++ b/sample/proto_v3/json/Private/ConfigRec/Dep2Cfg.cpp @@ -1,5 +1,5 @@ /** - * This file is generated by xresloader 2.17.1, please don't edit it. + * This file is generated by xresloader 2.18.0, please don't edit it. * You can find more information about this xresloader on https://xresloader.atframe.work/ . * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues . */ diff --git a/sample/proto_v3/json/Private/ConfigRec/DepCfg.cpp b/sample/proto_v3/json/Private/ConfigRec/DepCfg.cpp index 3e38d2d2..0ba67fe5 100644 --- a/sample/proto_v3/json/Private/ConfigRec/DepCfg.cpp +++ b/sample/proto_v3/json/Private/ConfigRec/DepCfg.cpp @@ -1,5 +1,5 @@ /** - * This file is generated by xresloader 2.17.1, please don't edit it. + * This file is generated by xresloader 2.18.0, please don't edit it. * You can find more information about this xresloader on https://xresloader.atframe.work/ . * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues . */ diff --git a/sample/proto_v3/json/Private/ConfigRec/EventCfg.cpp b/sample/proto_v3/json/Private/ConfigRec/EventCfg.cpp index 7e27ea88..9739e60c 100644 --- a/sample/proto_v3/json/Private/ConfigRec/EventCfg.cpp +++ b/sample/proto_v3/json/Private/ConfigRec/EventCfg.cpp @@ -1,5 +1,5 @@ /** - * This file is generated by xresloader 2.17.1, please don't edit it. + * This file is generated by xresloader 2.18.0, please don't edit it. * You can find more information about this xresloader on https://xresloader.atframe.work/ . * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues . */ diff --git a/sample/proto_v3/json/Private/ConfigRec/EventRewardItem.cpp b/sample/proto_v3/json/Private/ConfigRec/EventRewardItem.cpp index c1afcfbd..8d9feac3 100644 --- a/sample/proto_v3/json/Private/ConfigRec/EventRewardItem.cpp +++ b/sample/proto_v3/json/Private/ConfigRec/EventRewardItem.cpp @@ -1,5 +1,5 @@ /** - * This file is generated by xresloader 2.17.1, please don't edit it. + * This file is generated by xresloader 2.18.0, please don't edit it. * You can find more information about this xresloader on https://xresloader.atframe.work/ . * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues . */ diff --git a/sample/proto_v3/json/Private/ConfigRec/EventRuleItem.cpp b/sample/proto_v3/json/Private/ConfigRec/EventRuleItem.cpp index 7f3562d2..9ea3ce4e 100644 --- a/sample/proto_v3/json/Private/ConfigRec/EventRuleItem.cpp +++ b/sample/proto_v3/json/Private/ConfigRec/EventRuleItem.cpp @@ -1,5 +1,5 @@ /** - * This file is generated by xresloader 2.17.1, please don't edit it. + * This file is generated by xresloader 2.18.0, please don't edit it. * You can find more information about this xresloader on https://xresloader.atframe.work/ . * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues . */ diff --git a/sample/proto_v3/json/Private/ConfigRec/GoogleProtobufDuration.cpp b/sample/proto_v3/json/Private/ConfigRec/GoogleProtobufDuration.cpp index 0ac87ec2..efbe7831 100644 --- a/sample/proto_v3/json/Private/ConfigRec/GoogleProtobufDuration.cpp +++ b/sample/proto_v3/json/Private/ConfigRec/GoogleProtobufDuration.cpp @@ -1,5 +1,5 @@ /** - * This file is generated by xresloader 2.17.1, please don't edit it. + * This file is generated by xresloader 2.18.0, please don't edit it. * You can find more information about this xresloader on https://xresloader.atframe.work/ . * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues . */ diff --git a/sample/proto_v3/json/Private/ConfigRec/GoogleProtobufTimestamp.cpp b/sample/proto_v3/json/Private/ConfigRec/GoogleProtobufTimestamp.cpp index b13d299b..6ee5b922 100644 --- a/sample/proto_v3/json/Private/ConfigRec/GoogleProtobufTimestamp.cpp +++ b/sample/proto_v3/json/Private/ConfigRec/GoogleProtobufTimestamp.cpp @@ -1,5 +1,5 @@ /** - * This file is generated by xresloader 2.17.1, please don't edit it. + * This file is generated by xresloader 2.18.0, please don't edit it. * You can find more information about this xresloader on https://xresloader.atframe.work/ . * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues . */ diff --git a/sample/proto_v3/json/Private/ConfigRec/KeepOrStripEmptyListCfg.cpp b/sample/proto_v3/json/Private/ConfigRec/KeepOrStripEmptyListCfg.cpp index 81c68853..ed2be73c 100644 --- a/sample/proto_v3/json/Private/ConfigRec/KeepOrStripEmptyListCfg.cpp +++ b/sample/proto_v3/json/Private/ConfigRec/KeepOrStripEmptyListCfg.cpp @@ -1,5 +1,5 @@ /** - * This file is generated by xresloader 2.17.1, please don't edit it. + * This file is generated by xresloader 2.18.0, please don't edit it. * You can find more information about this xresloader on https://xresloader.atframe.work/ . * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues . */ diff --git a/sample/proto_v3/json/Private/ConfigRec/RoleCfg.cpp b/sample/proto_v3/json/Private/ConfigRec/RoleCfg.cpp index ab7fa7f1..cdf0a5ef 100644 --- a/sample/proto_v3/json/Private/ConfigRec/RoleCfg.cpp +++ b/sample/proto_v3/json/Private/ConfigRec/RoleCfg.cpp @@ -1,5 +1,5 @@ /** - * This file is generated by xresloader 2.17.1, please don't edit it. + * This file is generated by xresloader 2.18.0, please don't edit it. * You can find more information about this xresloader on https://xresloader.atframe.work/ . * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues . */ diff --git a/sample/proto_v3/json/Private/ConfigRec/RoleUpgradeCfg.cpp b/sample/proto_v3/json/Private/ConfigRec/RoleUpgradeCfg.cpp index dc8db7d7..763e3d26 100644 --- a/sample/proto_v3/json/Private/ConfigRec/RoleUpgradeCfg.cpp +++ b/sample/proto_v3/json/Private/ConfigRec/RoleUpgradeCfg.cpp @@ -1,5 +1,5 @@ /** - * This file is generated by xresloader 2.17.1, please don't edit it. + * This file is generated by xresloader 2.18.0, please don't edit it. * You can find more information about this xresloader on https://xresloader.atframe.work/ . * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues . */ diff --git a/sample/proto_v3/json/Private/ConfigRec/TestMsgVerifier.cpp b/sample/proto_v3/json/Private/ConfigRec/TestMsgVerifier.cpp index 580dab33..83df1c1e 100644 --- a/sample/proto_v3/json/Private/ConfigRec/TestMsgVerifier.cpp +++ b/sample/proto_v3/json/Private/ConfigRec/TestMsgVerifier.cpp @@ -1,5 +1,5 @@ /** - * This file is generated by xresloader 2.17.1, please don't edit it. + * This file is generated by xresloader 2.18.0, please don't edit it. * You can find more information about this xresloader on https://xresloader.atframe.work/ . * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues . */ diff --git a/sample/proto_v3/json/Public/ConfigRec/ArrInArr.h b/sample/proto_v3/json/Public/ConfigRec/ArrInArr.h index bbaa4818..4ec492ca 100644 --- a/sample/proto_v3/json/Public/ConfigRec/ArrInArr.h +++ b/sample/proto_v3/json/Public/ConfigRec/ArrInArr.h @@ -1,5 +1,5 @@ /** - * This file is generated by xresloader 2.17.1, please don't edit it. + * This file is generated by xresloader 2.18.0, please don't edit it. * You can find more information about this xresloader on https://xresloader.atframe.work/ . * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues . */ diff --git a/sample/proto_v3/json/Public/ConfigRec/ArrInArrCfg.h b/sample/proto_v3/json/Public/ConfigRec/ArrInArrCfg.h index 3062e0fa..c5ff6f0e 100644 --- a/sample/proto_v3/json/Public/ConfigRec/ArrInArrCfg.h +++ b/sample/proto_v3/json/Public/ConfigRec/ArrInArrCfg.h @@ -1,5 +1,5 @@ /** - * This file is generated by xresloader 2.17.1, please don't edit it. + * This file is generated by xresloader 2.18.0, please don't edit it. * You can find more information about this xresloader on https://xresloader.atframe.work/ . * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues . */ diff --git a/sample/proto_v3/json/Public/ConfigRec/Dep2Cfg.h b/sample/proto_v3/json/Public/ConfigRec/Dep2Cfg.h index 852b0d8c..962ab40c 100644 --- a/sample/proto_v3/json/Public/ConfigRec/Dep2Cfg.h +++ b/sample/proto_v3/json/Public/ConfigRec/Dep2Cfg.h @@ -1,5 +1,5 @@ /** - * This file is generated by xresloader 2.17.1, please don't edit it. + * This file is generated by xresloader 2.18.0, please don't edit it. * You can find more information about this xresloader on https://xresloader.atframe.work/ . * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues . */ diff --git a/sample/proto_v3/json/Public/ConfigRec/DepCfg.h b/sample/proto_v3/json/Public/ConfigRec/DepCfg.h index c8625184..45106407 100644 --- a/sample/proto_v3/json/Public/ConfigRec/DepCfg.h +++ b/sample/proto_v3/json/Public/ConfigRec/DepCfg.h @@ -1,5 +1,5 @@ /** - * This file is generated by xresloader 2.17.1, please don't edit it. + * This file is generated by xresloader 2.18.0, please don't edit it. * You can find more information about this xresloader on https://xresloader.atframe.work/ . * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues . */ diff --git a/sample/proto_v3/json/Public/ConfigRec/EventCfg.h b/sample/proto_v3/json/Public/ConfigRec/EventCfg.h index 2eef977e..1f1c5fb3 100644 --- a/sample/proto_v3/json/Public/ConfigRec/EventCfg.h +++ b/sample/proto_v3/json/Public/ConfigRec/EventCfg.h @@ -1,5 +1,5 @@ /** - * This file is generated by xresloader 2.17.1, please don't edit it. + * This file is generated by xresloader 2.18.0, please don't edit it. * You can find more information about this xresloader on https://xresloader.atframe.work/ . * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues . */ diff --git a/sample/proto_v3/json/Public/ConfigRec/EventRewardItem.h b/sample/proto_v3/json/Public/ConfigRec/EventRewardItem.h index 6aa0b1ca..793e7108 100644 --- a/sample/proto_v3/json/Public/ConfigRec/EventRewardItem.h +++ b/sample/proto_v3/json/Public/ConfigRec/EventRewardItem.h @@ -1,5 +1,5 @@ /** - * This file is generated by xresloader 2.17.1, please don't edit it. + * This file is generated by xresloader 2.18.0, please don't edit it. * You can find more information about this xresloader on https://xresloader.atframe.work/ . * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues . */ diff --git a/sample/proto_v3/json/Public/ConfigRec/EventRuleItem.h b/sample/proto_v3/json/Public/ConfigRec/EventRuleItem.h index 70cf63b8..56e6bc87 100644 --- a/sample/proto_v3/json/Public/ConfigRec/EventRuleItem.h +++ b/sample/proto_v3/json/Public/ConfigRec/EventRuleItem.h @@ -1,5 +1,5 @@ /** - * This file is generated by xresloader 2.17.1, please don't edit it. + * This file is generated by xresloader 2.18.0, please don't edit it. * You can find more information about this xresloader on https://xresloader.atframe.work/ . * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues . */ diff --git a/sample/proto_v3/json/Public/ConfigRec/GoogleProtobufDuration.h b/sample/proto_v3/json/Public/ConfigRec/GoogleProtobufDuration.h index 60ecfe78..e6085c93 100644 --- a/sample/proto_v3/json/Public/ConfigRec/GoogleProtobufDuration.h +++ b/sample/proto_v3/json/Public/ConfigRec/GoogleProtobufDuration.h @@ -1,5 +1,5 @@ /** - * This file is generated by xresloader 2.17.1, please don't edit it. + * This file is generated by xresloader 2.18.0, please don't edit it. * You can find more information about this xresloader on https://xresloader.atframe.work/ . * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues . */ diff --git a/sample/proto_v3/json/Public/ConfigRec/GoogleProtobufTimestamp.h b/sample/proto_v3/json/Public/ConfigRec/GoogleProtobufTimestamp.h index 11e9feae..65a7fc57 100644 --- a/sample/proto_v3/json/Public/ConfigRec/GoogleProtobufTimestamp.h +++ b/sample/proto_v3/json/Public/ConfigRec/GoogleProtobufTimestamp.h @@ -1,5 +1,5 @@ /** - * This file is generated by xresloader 2.17.1, please don't edit it. + * This file is generated by xresloader 2.18.0, please don't edit it. * You can find more information about this xresloader on https://xresloader.atframe.work/ . * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues . */ diff --git a/sample/proto_v3/json/Public/ConfigRec/KeepOrStripEmptyListCfg.h b/sample/proto_v3/json/Public/ConfigRec/KeepOrStripEmptyListCfg.h index ad2e8da9..320c215f 100644 --- a/sample/proto_v3/json/Public/ConfigRec/KeepOrStripEmptyListCfg.h +++ b/sample/proto_v3/json/Public/ConfigRec/KeepOrStripEmptyListCfg.h @@ -1,5 +1,5 @@ /** - * This file is generated by xresloader 2.17.1, please don't edit it. + * This file is generated by xresloader 2.18.0, please don't edit it. * You can find more information about this xresloader on https://xresloader.atframe.work/ . * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues . */ diff --git a/sample/proto_v3/json/Public/ConfigRec/RoleCfg.h b/sample/proto_v3/json/Public/ConfigRec/RoleCfg.h index 09f5e3df..234357e6 100644 --- a/sample/proto_v3/json/Public/ConfigRec/RoleCfg.h +++ b/sample/proto_v3/json/Public/ConfigRec/RoleCfg.h @@ -1,5 +1,5 @@ /** - * This file is generated by xresloader 2.17.1, please don't edit it. + * This file is generated by xresloader 2.18.0, please don't edit it. * You can find more information about this xresloader on https://xresloader.atframe.work/ . * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues . */ diff --git a/sample/proto_v3/json/Public/ConfigRec/RoleUpgradeCfg.h b/sample/proto_v3/json/Public/ConfigRec/RoleUpgradeCfg.h index 79aa8f0a..354e91e2 100644 --- a/sample/proto_v3/json/Public/ConfigRec/RoleUpgradeCfg.h +++ b/sample/proto_v3/json/Public/ConfigRec/RoleUpgradeCfg.h @@ -1,5 +1,5 @@ /** - * This file is generated by xresloader 2.17.1, please don't edit it. + * This file is generated by xresloader 2.18.0, please don't edit it. * You can find more information about this xresloader on https://xresloader.atframe.work/ . * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues . */ diff --git a/sample/proto_v3/json/Public/ConfigRec/TestMsgVerifier.h b/sample/proto_v3/json/Public/ConfigRec/TestMsgVerifier.h index 4e8185ad..8520782d 100644 --- a/sample/proto_v3/json/Public/ConfigRec/TestMsgVerifier.h +++ b/sample/proto_v3/json/Public/ConfigRec/TestMsgVerifier.h @@ -1,5 +1,5 @@ /** - * This file is generated by xresloader 2.17.1, please don't edit it. + * This file is generated by xresloader 2.18.0, please don't edit it. * You can find more information about this xresloader on https://xresloader.atframe.work/ . * If there is any problem, please find or report issues on https://github.com/xresloader/xresloader/issues . */ diff --git a/sample/proto_v3/keep_empty_list_cfg.bin b/sample/proto_v3/keep_empty_list_cfg.bin index dbc7fa6024db83c718c4dfef493d90fe97f55b07..a574c32f4c780625853fb192711331bcf9c861c3 100644 GIT binary patch delta 20 bcmaFG{EC^IYceAjn~|QOg`UAi?)!`YI-Lbq delta 20 bcmaFG{EC^IYceAjn~|QOxt`%h?)!`YI-3Po diff --git a/sample/proto_v3/keep_empty_list_cfg.lua b/sample/proto_v3/keep_empty_list_cfg.lua index 0f13df0a..2ac8ada7 100644 --- a/sample/proto_v3/keep_empty_list_cfg.lua +++ b/sample/proto_v3/keep_empty_list_cfg.lua @@ -12,7 +12,7 @@ return { }, data_ver = "1.0.0.0", hash_code = "sha256:e192b1278aea13633eb67e367edc99aa2bb8b487e32f3e8a0f9c5b975230304e", - xres_ver = "2.17.1", + xres_ver = "2.18.0", }, [2] = "keep_or_strip_empty_list_cfg", keep_or_strip_empty_list_cfg = { diff --git a/sample/proto_v3/kind.desc.json b/sample/proto_v3/kind.desc.json index e35984dc..7c033fb5 100644 --- a/sample/proto_v3/kind.desc.json +++ b/sample/proto_v3/kind.desc.json @@ -151,6 +151,14 @@ "int_arr": { "name": "int_arr", "number": 2, + "options": { + "field_list_max_size": 3, + "field_list_min_size": 1, + "field_list_strip_option": { + "name": "LIST_STRIP_NOTHING", + "number": 1 + } + }, "type_name": "INT32" }, "name": { @@ -265,6 +273,10 @@ "test_plain_int_arr": { "name": "test_plain_int_arr", "number": 3, + "options": { + "field_list_max_size": 3, + "field_list_min_size": 1 + }, "type_name": "INT32" }, "test_plain_msg": { diff --git a/sample/proto_v3/kind.desc.lua b/sample/proto_v3/kind.desc.lua index 38205243..153e452b 100644 --- a/sample/proto_v3/kind.desc.lua +++ b/sample/proto_v3/kind.desc.lua @@ -42,6 +42,19 @@ local const_res = { message_type = { arr_in_arr = { field = { + int_arr = { + name = "int_arr", + number = 2, + options = { + field_list_max_size = 3, + field_list_min_size = 1, + field_list_strip_option = { + name = "LIST_STRIP_NOTHING", + number = 1, + }, + }, + type_name = "INT32", + }, name = { name = "name", number = 1, @@ -93,6 +106,15 @@ local const_res = { }, type_name = "MESSAGE", }, + test_plain_int_arr = { + name = "test_plain_int_arr", + number = 3, + options = { + field_list_max_size = 3, + field_list_min_size = 1, + }, + type_name = "INT32", + }, test_plain_msg = { name = "test_plain_msg", number = 5, diff --git a/sample/proto_v3/kind.pb b/sample/proto_v3/kind.pb index ab6f7113c5acbea10d5b37998c07f2232f8b18fd..eaf9e6ab5081f7eb227582a3d1b5f08496e86c37 100755 GIT binary patch delta 100 zcmeyM-K?{rgNgCy=1wM4R>pmk_p>`oD{--B=9R=J78OY_DKKlWI&ogGXS`w0_`sfd qvk=F7CdSW`nYhE0jk$zMQj1IC3vv=O^WtGTn87;OpvsH6YqsYf_p>_-h;y-L=9R=J78OY_DKKlWZkFYE&&2q8GB0obx>-;K4uF&gN+9pcmOON1)Kl? delta 14 VcmX>obx>-;K4x=0!;J?UcmOOL1)Kl? diff --git a/sample/proto_v3/role_cfg.n.js b/sample/proto_v3/role_cfg.n.js index 0cb3d1f1..7f15ff65 100755 --- a/sample/proto_v3/role_cfg.n.js +++ b/sample/proto_v3/role_cfg.n.js @@ -12,7 +12,7 @@ exports.role_cfg_header = { ], data_ver : "1.0.0.0", hash_code : "sha256:eeaf27d61a221566a4129cce5f868e1d929d571f6ad2859de106242f0acc820f", - xres_ver : "2.17.1" + xres_ver : "2.18.0" }; exports.role_cfg = [ { diff --git a/sample/proto_v3/role_cfg.xml b/sample/proto_v3/role_cfg.xml index 17015090..2a113743 100755 --- a/sample/proto_v3/role_cfg.xml +++ b/sample/proto_v3/role_cfg.xml @@ -1,2 +1,2 @@ -
77资源转换示例.xlsxkind1.0.0.0sha256:eeaf27d61a221566a4129cce5f868e1d929d571f6ad2859de106242f0acc820f2.17.1
04591504951504591501666627200016693056000166662720011012014/10/1351123100010欧若拉12:45:1513:45:1512:45:152022-10-252022-11-252022-10-25lalal欧若拉小魔女1000104591504951504591501666673115016693515150166667311522012014/10/1461654100021杰克4591549515459152022-10-25 12:45:152022-11-25 12:45:152022-10-25 12:45:15blebleble杰克海盗王子100011010139045915049515044555901666673115016693515150166667311543012014/10/1571sdadasd100032库拉4591513:45:15123:45:59166667311516693515151666673115hahaha库拉喵少年100011000110101850495150445520016666731150166935151501666701915840119:10:5081ffff100043莫瑞茨13:45:15123:45:20Z16666731152022-11-25 12:45:152022-10-25 12:45:15Zangel莫瑞茨1220445559123000000416720016693515151230000001666673115124123:45:59123:45:20.123+08:002022-11-25 12:45:152022-10-25 12:45:15.123+08:001230000004455201230000001666673115999995019:10:50 上午91gggg100055爱丽丝123:45:20.1232022-10-25 12:45:15.12318310001laopo爱丽丝1230000004591512300000016666731159996012014-10-20 19:50:50101hhhhh100066都玛西亚45915.1231666673115.12327410101keai都玛西亚role_cfg
\ No newline at end of file +
77资源转换示例.xlsxkind1.0.0.0sha256:eeaf27d61a221566a4129cce5f868e1d929d571f6ad2859de106242f0acc820f2.18.0
04591504951504591501666627200016693056000166662720011012014/10/1351123100010欧若拉12:45:1513:45:1512:45:152022-10-252022-11-252022-10-25lalal欧若拉小魔女1000104591504951504591501666673115016693515150166667311522012014/10/1461654100021杰克4591549515459152022-10-25 12:45:152022-11-25 12:45:152022-10-25 12:45:15blebleble杰克海盗王子100011010139045915049515044555901666673115016693515150166667311543012014/10/1571sdadasd100032库拉4591513:45:15123:45:59166667311516693515151666673115hahaha库拉喵少年100011000110101850495150445520016666731150166935151501666701915840119:10:5081ffff100043莫瑞茨13:45:15123:45:20Z16666731152022-11-25 12:45:152022-10-25 12:45:15Zangel莫瑞茨1220445559123000000416720016693515151230000001666673115124123:45:59123:45:20.123+08:002022-11-25 12:45:152022-10-25 12:45:15.123+08:001230000004455201230000001666673115999995019:10:50 上午91gggg100055爱丽丝123:45:20.1232022-10-25 12:45:15.12318310001laopo爱丽丝1230000004591512300000016666731159996012014-10-20 19:50:50101hhhhh100066都玛西亚45915.1231666673115.12327410101keai都玛西亚role_cfg
\ No newline at end of file diff --git a/sample/proto_v3/role_cfg_module.lua b/sample/proto_v3/role_cfg_module.lua index f4f1ff59..bdfca136 100755 --- a/sample/proto_v3/role_cfg_module.lua +++ b/sample/proto_v3/role_cfg_module.lua @@ -1,5 +1,5 @@ module("ProtoData.Kind.role_cfg", package.seeall) -- this file is generated by xresloader, please don't edit it. - header = { count = 7, data_source = { { count = 7, file = "资源转换示例.xlsx", sheet = "kind", }, }, data_ver = "1.0.0.0", hash_code = "sha256:f83885dbe713ab6b423cf917a202d67da647d58a4636dbad41575d5479a6e87a", xres_ver = "2.17.1", } + header = { count = 7, data_source = { { count = 7, file = "资源转换示例.xlsx", sheet = "kind", }, }, data_ver = "1.0.0.0", hash_code = "sha256:f83885dbe713ab6b423cf917a202d67da647d58a4636dbad41575d5479a6e87a", xres_ver = "2.18.0", } data_message_type = "role_cfg" role_cfg = { { convert_duration_arr = { { nanos = 0, seconds = 45915, }, { nanos = 0, seconds = 49515, }, }, convert_duration_one = { nanos = 0, seconds = 45915, }, convert_timepoint_arr = { { nanos = 0, seconds = 1666627200, }, { nanos = 0, seconds = 1669305600, }, }, convert_timepoint_one = { nanos = 0, seconds = 1666627200, }, cost_value = 1, dep_test = { dep2 = { id = 101, level = "2014/10/13", }, id = 51, name = "123", }, id = 10001, int_as_string = "0", name = "欧若拉", origin_duration_arr = { "12:45:15", "13:45:15", }, origin_duration_one = "12:45:15", origin_timepoint_arr = { "2022-10-25", "2022-11-25", }, origin_timepoint_one = "2022-10-25", test_array = { "lalal", "欧若拉", "小魔女", }, test_plain_enum_array = { 10001, }, }, { convert_duration_arr = { { nanos = 0, seconds = 45915, }, { nanos = 0, seconds = 49515, }, }, convert_duration_one = { nanos = 0, seconds = 45915, }, convert_timepoint_arr = { { nanos = 0, seconds = 1666673115, }, { nanos = 0, seconds = 1669351515, }, }, convert_timepoint_one = { nanos = 0, seconds = 1666673115, }, cost_value = 2, dep_test = { dep2 = { id = 201, level = "2014/10/14", }, id = 61, name = "654", }, id = 10002, int_as_string = "1", name = "杰克", origin_duration_arr = { "45915", "49515", }, origin_duration_one = "45915", origin_timepoint_arr = { "2022-10-25 12:45:15", "2022-11-25 12:45:15", }, origin_timepoint_one = "2022-10-25 12:45:15", test_array = { "blebleble", "杰克", "海盗王子", }, test_plain_enum_array = { 10001, 10101, }, unlock_level = 39, }, { convert_duration_arr = { { nanos = 0, seconds = 45915, }, { nanos = 0, seconds = 49515, }, }, convert_duration_one = { nanos = 0, seconds = 445559, }, convert_timepoint_arr = { { nanos = 0, seconds = 1666673115, }, { nanos = 0, seconds = 1669351515, }, }, convert_timepoint_one = { nanos = 0, seconds = 1666673115, }, cost_value = 4, dep_test = { dep2 = { id = 301, level = "2014/10/15", }, id = 71, name = "sdadasd", }, id = 10003, int_as_string = "2", name = "库拉", origin_duration_arr = { "45915", "13:45:15", }, origin_duration_one = "123:45:59", origin_timepoint_arr = { "1666673115", "1669351515", }, origin_timepoint_one = "1666673115", test_array = { "hahaha", "库拉", "喵少年", }, test_plain_enum_array = { 10001, 10001, 10101, }, unlock_level = 85, }, { convert_duration_arr = { { nanos = 0, seconds = 49515, }, }, convert_duration_one = { nanos = 0, seconds = 445520, }, convert_timepoint_arr = { { nanos = 0, seconds = 1666673115, }, { nanos = 0, seconds = 1669351515, }, }, convert_timepoint_one = { nanos = 0, seconds = 1666701915, }, cost_value = 8, dep_test = { dep2 = { id = 401, level = "19:10:50", }, id = 81, name = "ffff", }, id = 10004, int_as_string = "3", name = "莫瑞茨", origin_duration_arr = { "", "13:45:15", }, origin_duration_one = "123:45:20Z", origin_timepoint_arr = { "1666673115", "2022-11-25 12:45:15", }, origin_timepoint_one = "2022-10-25 12:45:15Z", test_array = { "angel", "莫瑞茨", }, unlock_level = 122, }, { convert_duration_arr = { { nanos = 0, seconds = 445559, }, }, convert_duration_one = { nanos = 123000000, seconds = 416720, }, convert_timepoint_arr = { { nanos = 0, seconds = 1669351515, }, }, convert_timepoint_one = { nanos = 123000000, seconds = 1666673115, }, dep_test = { id = 12, }, int_as_string = "4", origin_duration_arr = { "", "123:45:59", }, origin_duration_one = "123:45:20.123+08:00", origin_timepoint_arr = { "", "2022-11-25 12:45:15", }, origin_timepoint_one = "2022-10-25 12:45:15.123+08:00", }, { convert_duration_one = { nanos = 123000000, seconds = 445520, }, convert_timepoint_one = { nanos = 123000000, seconds = 1666673115, }, cost_type = 10001, cost_value = 99999, dep_test = { dep2 = { id = 501, level = "9:10:50 上午", }, id = 91, name = "gggg", }, id = 10005, int_as_string = "5", name = "爱丽丝", origin_duration_one = "123:45:20.123", origin_timepoint_one = "2022-10-25 12:45:15.123", test_array = { "laopo", "爱丽丝", }, unlock_level = 183, }, { convert_duration_one = { nanos = 123000000, seconds = 45915, }, convert_timepoint_one = { nanos = 123000000, seconds = 1666673115, }, cost_type = 10101, cost_value = 999, dep_test = { dep2 = { id = 601, level = "2014-10-20 19:50:50", }, id = 101, name = "hhhhh", }, id = 10006, int_as_string = "6", name = "都玛西亚", origin_duration_one = "45915.123", origin_timepoint_one = "1666673115.123", test_array = { "keai", "都玛西亚", }, unlock_level = 274, }, } \ No newline at end of file diff --git a/sample/proto_v3/role_upgrade_cfg.bin b/sample/proto_v3/role_upgrade_cfg.bin index 6a4a0ec3..ba5dd2a4 100644 --- a/sample/proto_v3/role_upgrade_cfg.bin +++ b/sample/proto_v3/role_upgrade_cfg.bin @@ -1,6 +1,6 @@  -2.17.11.0.0.0f"Gsha256:bbf8dcdce30a89f9c7fbb31163c4821ab84d36954758b06c2969dd0217db951c*LTest role_upgrade_cfg with multi keys +2.18.01.0.0.0f"Gsha256:bbf8dcdce30a89f9c7fbb31163c4821ab84d36954758b06c2969dd0217db951c*LTest role_upgrade_cfg with multi keys Test role_upgrade_cfg with multi keysZ* 资源转换示例.xlsx upgrade_10001*Z* 资源转换示例.xlsx upgrade_10002<N diff --git a/sample/proto_v3/role_upgrade_cfg.json b/sample/proto_v3/role_upgrade_cfg.json index db45e975..571d4a2e 100755 --- a/sample/proto_v3/role_upgrade_cfg.json +++ b/sample/proto_v3/role_upgrade_cfg.json @@ -16,7 +16,7 @@ "data_ver": "1.0.0.0", "description": "Test role_upgrade_cfg with multi keys\r\nTest role_upgrade_cfg with multi keys", "hash_code": "sha256:e356806bc55be9cc8a6c701d4295989e0fc3887b368681bb9457b0e51df8f445", - "xres_ver": "2.17.1" + "xres_ver": "2.18.0" }, {"role_upgrade_cfg": [ { diff --git a/sample/proto_v3/role_upgrade_cfg.lua b/sample/proto_v3/role_upgrade_cfg.lua index fd2e7564..12e026bb 100755 --- a/sample/proto_v3/role_upgrade_cfg.lua +++ b/sample/proto_v3/role_upgrade_cfg.lua @@ -18,7 +18,7 @@ return { data_ver = "1.0.0.0", description = "Test role_upgrade_cfg with multi keys\r\nTest role_upgrade_cfg with multi keys", hash_code = "sha256:e356806bc55be9cc8a6c701d4295989e0fc3887b368681bb9457b0e51df8f445", - xres_ver = "2.17.1", + xres_ver = "2.18.0", }, [2] = "role_upgrade_cfg", role_upgrade_cfg = { diff --git a/sample/proto_v3/strip_list_tail_cfg.bin b/sample/proto_v3/strip_list_tail_cfg.bin index 0473c4fde47f6f3542c86d264a30fe7eebd330e0..e4f21648b7127f6dc6a4164b597874f136b8e03e 100644 GIT binary patch delta 20 bcmaFD{DhgCYceAjn~|QOg`UAi?wgDNIjsdn delta 20 bcmaFD{DhgCYceAjn~|QOxt`%h?wgDNIjaRl diff --git a/sample/proto_v3/strip_list_tail_cfg.lua b/sample/proto_v3/strip_list_tail_cfg.lua index 4957f103..6dc247f3 100644 --- a/sample/proto_v3/strip_list_tail_cfg.lua +++ b/sample/proto_v3/strip_list_tail_cfg.lua @@ -12,7 +12,7 @@ return { }, data_ver = "1.0.0.0", hash_code = "sha256:bef5c76679b43b65aec7906f42010530fadae99f0e386d94e3a77e94a7d12e8e", - xres_ver = "2.17.1", + xres_ver = "2.18.0", }, [2] = "keep_or_strip_empty_list_cfg", keep_or_strip_empty_list_cfg = { diff --git a/src/org/xresloader/core/data/dst/DataDstJava.java b/src/org/xresloader/core/data/dst/DataDstJava.java index 3a50555c..ddffc6d8 100644 --- a/src/org/xresloader/core/data/dst/DataDstJava.java +++ b/src/org/xresloader/core/data/dst/DataDstJava.java @@ -11,6 +11,8 @@ import org.xresloader.core.engine.IdentifyDescriptor; import org.xresloader.core.scheme.SchemeConf; +import com.google.protobuf.Descriptors; + import java.nio.ByteBuffer; import java.nio.charset.Charset; import java.security.MessageDigest; @@ -528,6 +530,32 @@ protected boolean dumpMessage(HashMap builder, DataDstWriterNode subFieldPath)); } } + + // Check list size + if (c.getValue().isList() && c.getValue().innerFieldDesc != null) { + var listExt = c.getValue().innerFieldDesc.getListExtension(); + if (listExt != null && c.getValue().innerFieldDesc != null) { + var childList = builder.getOrDefault(c.getValue().innerFieldDesc.getName(), null); + int listSize = 0; + if (childList != null && childList instanceof List) { + listSize = ((List) childList).size(); + } + if (listExt.minSize > 0 && listExt.minSize > listSize) { + throw new ConvException( + String.format( + "Try to convert %s failed, require at least %d element(s), real got %d element(s).", + fieldPath, + listExt.minSize, listSize)); + } + if (listExt.maxSize > 0 && listExt.maxSize < listSize) { + throw new ConvException( + String.format( + "Try to convert %s failed, require at most %d element(s), real got %d element(s).", + fieldPath, + listExt.maxSize, listSize)); + } + } + } } return ret; @@ -539,7 +567,7 @@ private boolean dumpStandardField(HashMap builder, DataDstWriter throws ConvException { if (null == desc.identify && DataDstWriterNode.JAVA_TYPE.MESSAGE != desc.getType()) { if (as_child.isRequired() - || ProgramOptions.getInstance().stripListRule == ProgramOptions.ListStripRule.KEEP_ALL) { + || as_child.getFieldListStripRule() == DataDstWriterNode.ListStripRule.STRIP_NOTHING) { dumpDefault(builder, as_child); } @@ -550,7 +578,7 @@ private boolean dumpStandardField(HashMap builder, DataDstWriter if (null == val) { if (as_child.isRequired() - || ProgramOptions.getInstance().stripListRule == ProgramOptions.ListStripRule.KEEP_ALL) { + || as_child.getFieldListStripRule() == DataDstWriterNode.ListStripRule.STRIP_NOTHING) { dumpDefault(builder, as_child); } @@ -584,9 +612,9 @@ private boolean dumpStandardField(HashMap builder, DataDstWriter } int index = desc.getListIndex(); - ProgramOptions.ListStripRule stripListRule = ProgramOptions.getInstance().stripListRule; - if (stripListRule == ProgramOptions.ListStripRule.KEEP_ALL || - stripListRule == ProgramOptions.ListStripRule.STRIP_EMPTY_TAIL) { + DataDstWriterNode.ListStripRule stripListRule = as_child.getFieldListStripRule(); + if (stripListRule == DataDstWriterNode.ListStripRule.STRIP_NOTHING || + stripListRule == DataDstWriterNode.ListStripRule.STRIP_TAIL) { while (old.size() < index) { dumpDefault(builder, as_child); } @@ -693,7 +721,7 @@ private boolean dumpPlainField(HashMap builder, IdentifyDescript if (null == ident) { // Plain模式的repeated对于STRIP_EMPTY_TAIL也可以直接全部strip掉,下同 if (field.isRequired() - || ProgramOptions.getInstance().stripListRule == ProgramOptions.ListStripRule.KEEP_ALL) { + || field.getListStripRule() == DataDstWriterNode.ListStripRule.STRIP_NOTHING) { dumpDefault(builder, field); } return false; @@ -702,7 +730,7 @@ private boolean dumpPlainField(HashMap builder, IdentifyDescript DataContainer res = DataSrcImpl.getOurInstance().getValue(ident, ""); if (null == res || !res.valid) { if (field.isRequired() - || ProgramOptions.getInstance().stripListRule == ProgramOptions.ListStripRule.KEEP_ALL) { + || field.getListStripRule() == DataDstWriterNode.ListStripRule.STRIP_NOTHING) { dumpDefault(builder, field); } return false; @@ -728,6 +756,7 @@ private boolean dumpPlainField(HashMap builder, IdentifyDescript if (field.isList()) { Object val = builder.getOrDefault(field.getName(), null); + boolean ret = true; if (field.isMap()) { if (val == null || !(val instanceof SpecialInnerHashMap)) { val = new SpecialInnerHashMap(); @@ -961,9 +990,9 @@ private boolean dumpPlainField(HashMap builder, IdentifyDescript } int index = maybeFromNode.getListIndex(); - ProgramOptions.ListStripRule stripListRule = ProgramOptions.getInstance().stripListRule; - if (stripListRule == ProgramOptions.ListStripRule.KEEP_ALL - || stripListRule == ProgramOptions.ListStripRule.STRIP_EMPTY_TAIL) { + DataDstWriterNode.ListStripRule stripListRule = field.getListStripRule(); + if (stripListRule == DataDstWriterNode.ListStripRule.STRIP_NOTHING + || stripListRule == DataDstWriterNode.ListStripRule.STRIP_TAIL) { while (valArray.size() < index) { valArray.add(getDefault(field)); } @@ -983,14 +1012,39 @@ private boolean dumpPlainField(HashMap builder, IdentifyDescript rowContext.addUniqueCache(tagKey, fieldPath, valArray); } } - } else if (ProgramOptions.getInstance().stripListRule == ProgramOptions.ListStripRule.KEEP_ALL) { + } else if (field.getListStripRule() == DataDstWriterNode.ListStripRule.STRIP_NOTHING) { ArrayList valArray = (ArrayList) val; valArray.add(getDefault(field)); } else { - return false; + ret = false; } - return true; + // Check list size + { + var listExt = field.getListExtension(); + if (listExt != null) { + var childList = builder.getOrDefault(field.getName(), null); + int listSize = 0; + if (childList != null && childList instanceof List) { + listSize = ((List) childList).size(); + } + if (listExt.minSize > 0 && listExt.minSize > listSize) { + throw new ConvException( + String.format( + "Try to convert %s failed, require at least %d element(s), real got %d element(s).", + fieldPath, + listExt.minSize, listSize)); + } + if (listExt.maxSize > 0 && listExt.maxSize < listSize) { + throw new ConvException( + String.format( + "Try to convert %s failed, require at most %d element(s), real got %d element(s).", + fieldPath, + listExt.maxSize, listSize)); + } + } + } + return ret; } else { Object val = null; diff --git a/src/org/xresloader/core/data/dst/DataDstPb.java b/src/org/xresloader/core/data/dst/DataDstPb.java index 9315d274..8930454a 100644 --- a/src/org/xresloader/core/data/dst/DataDstPb.java +++ b/src/org/xresloader/core/data/dst/DataDstPb.java @@ -395,6 +395,7 @@ static private boolean setup_extension(DataDstTypeDescriptor parent_message, Dat if (verifierExpr != null && !verifierExpr.isEmpty()) { child_field.mutableExtension().validator = verifierExpr; } + boolean ret = true; var gen = setup_validator(null, verifierExpr, fd); if (gen != null && gen.validator != null && !gen.validator.isEmpty()) { for (DataVerifyImpl vfy : gen.validator) { @@ -553,8 +554,63 @@ static private boolean setup_extension(DataDstTypeDescriptor parent_message, Dat .getExtension(XresloaderUe.ueOriginTypeDefaultValue); } + // setup list extension + if (fd.isRepeated()) { + if (fd.getOptions().hasExtension(Xresloader.fieldListStripOption)) { + switch (fd.getOptions().getExtension(Xresloader.fieldListStripOption).getNumber()) { + case Xresloader.ListStripOption.LIST_STRIP_DEFAULT_VALUE: { + child_field.mutableExtension() + .mutableList().stripOption = DataDstWriterNode.ListStripRule.DEFAULT; + break; + } + case Xresloader.ListStripOption.LIST_STRIP_NOTHING_VALUE: { + child_field.mutableExtension() + .mutableList().stripOption = DataDstWriterNode.ListStripRule.STRIP_NOTHING; + break; + } + case Xresloader.ListStripOption.LIST_STRIP_TAIL_VALUE: { + child_field.mutableExtension() + .mutableList().stripOption = DataDstWriterNode.ListStripRule.STRIP_TAIL; + break; + } + case Xresloader.ListStripOption.LIST_STRIP_ALL_VALUE: { + child_field.mutableExtension() + .mutableList().stripOption = DataDstWriterNode.ListStripRule.STRIP_ALL; + break; + } + } + } + + if (fd.getOptions().hasExtension(Xresloader.fieldListMinSize)) { + child_field.mutableExtension() + .mutableList().minSize = fd.getOptions().getExtension(Xresloader.fieldListMinSize); + } + if (fd.getOptions().hasExtension(Xresloader.fieldListMaxSize)) { + child_field.mutableExtension() + .mutableList().maxSize = fd.getOptions().getExtension(Xresloader.fieldListMaxSize); + + if (child_field.mutableExtension() + .mutableList().maxSize != 0 + && child_field.mutableExtension() + .mutableList().maxSize < child_field.mutableExtension() + .mutableList().minSize) { + ProgramOptions.getLoger().error( + "\"%s\" has invalid extension settings(field_list_max_size (%d) is smaller than field_list_min_size (%d)", + fd.getFullName(), + child_field.mutableExtension() + .mutableList().maxSize, + child_field.mutableExtension() + .mutableList().minSize); + ret = false; + if (gen != null) { + gen.success = false; + } + } + } + } + if (gen == null) { - return true; + return ret; } return gen.success; } @@ -1444,6 +1500,24 @@ private boolean testMessage(DataDstWriterNode node, LinkedList name_list if (count > 0) { filterMissingFields(missingFields, oneofField, fd, false); + if (child != null && child.innerFieldDesc != null) { + int minSize = child.innerFieldDesc.mutableExtension().mutableList().minSize; + int maxSize = child.innerFieldDesc.mutableExtension().mutableList().maxSize; + if (minSize > 0 && child.nodes.size() < minSize) { + throw new ConvException( + String.format( + "\"%s.%s\" for %s.%s require at least %d element(s), real got %d element(s).", + desc.getFullName(), fd.getName(), + prefix, fd.getName(), minSize, child.nodes.size())); + } + if (maxSize > 0 && child.nodes.size() > maxSize) { + throw new ConvException( + String.format( + "\"%s.%s\" for %s.%s require at most %d element(s), real got %d element(s).", + desc.getFullName(), fd.getName(), + prefix, fd.getName(), maxSize, child.nodes.size())); + } + } } else { // try plain mode - the whole array String real_name = DataDstWriterNode.makeChildPath(prefix, fd.getName()); @@ -1581,6 +1655,24 @@ private boolean testMessage(DataDstWriterNode node, LinkedList name_list if (count > 0) { filterMissingFields(missingFields, oneofField, fd, false); + if (child != null && child.innerFieldDesc != null) { + int minSize = child.innerFieldDesc.mutableExtension().mutableList().minSize; + int maxSize = child.innerFieldDesc.mutableExtension().mutableList().maxSize; + if (minSize > 0 && child.nodes.size() < minSize) { + throw new ConvException( + String.format( + "\"%s.%s\" for %s.%s require at least %d element(s), real got %d element(s).", + desc.getFullName(), fd.getName(), + prefix, fd.getName(), minSize, child.nodes.size())); + } + if (maxSize > 0 && child.nodes.size() > maxSize) { + throw new ConvException( + String.format( + "\"%s.%s\" for %s.%s require at most %d element(s), real got %d element(s).", + desc.getFullName(), fd.getName(), + prefix, fd.getName(), maxSize, child.nodes.size())); + } + } } else { // try plain mode String real_name = DataDstWriterNode.makeChildPath(prefix, fd.getName()); @@ -1953,12 +2045,12 @@ private Object getValueFromDataSource(DataDstWriterNode desc, DataDstFieldDescri private void dumpValue(DynamicMessage.Builder builder, DataDstFieldDescriptor field, Object val, int index, DataRowContext rowContext, String fieldPath) { - ProgramOptions.ListStripRule stripListRule = ProgramOptions.getInstance().stripListRule; + DataDstWriterNode.ListStripRule stripListRule = field.getListStripRule(); Descriptors.FieldDescriptor fd = (Descriptors.FieldDescriptor) field.getRawDescriptor(); if (fd.isRepeated() - && (stripListRule == ProgramOptions.ListStripRule.KEEP_ALL - || stripListRule == ProgramOptions.ListStripRule.STRIP_EMPTY_TAIL)) { + && (stripListRule == DataDstWriterNode.ListStripRule.STRIP_NOTHING + || stripListRule == DataDstWriterNode.ListStripRule.STRIP_TAIL)) { int fill_default_size = builder.getRepeatedFieldCount(fd); for (int i = fill_default_size; i < index; ++i) { Object defaultVal = getDefault(builder, field); @@ -2111,10 +2203,33 @@ private boolean dumpMessage(DynamicMessage.Builder builder, DataDstWriterNode no if (null != rowContext && !fieldHasValue && c.getValue().isNotNull()) { rowContext.addIgnoreReason( - String.format("field %s is empty but set not null, we will ignore this row", + String.format("Field %s is empty but set not null, we will ignore this row", subFieldPath)); } } + + // Check list size + if (c.getValue().isList() && c.getValue().innerFieldDesc != null) { + var listExt = c.getValue().innerFieldDesc.getListExtension(); + if (listExt != null && c.getValue().innerFieldDesc != null) { + Descriptors.FieldDescriptor fd = (Descriptors.FieldDescriptor) c.getValue().innerFieldDesc + .getRawDescriptor(); + if (listExt.minSize > 0 && listExt.minSize > builder.getRepeatedFieldCount(fd)) { + throw new ConvException( + String.format( + "Try to convert %s failed, require at least %d element(s), real got %d element(s).", + fd.getFullName(), + listExt.minSize, builder.getRepeatedFieldCount(fd))); + } + if (listExt.maxSize > 0 && listExt.maxSize < builder.getRepeatedFieldCount(fd)) { + throw new ConvException( + String.format( + "Try to convert %s failed, require at most %d element(s), real got %d element(s).", + fd.getFullName(), + listExt.maxSize, builder.getRepeatedFieldCount(fd))); + } + } + } } return ret; @@ -2126,7 +2241,7 @@ private boolean dumpStandardField(DynamicMessage.Builder builder, DataDstWriterN if (null == desc.identify && DataDstWriterNode.JAVA_TYPE.MESSAGE != field.getType()) { // required 空字段填充默认值 if (field.isRequired() - || ProgramOptions.getInstance().stripListRule == ProgramOptions.ListStripRule.KEEP_ALL) { + || field.getListStripRule() == DataDstWriterNode.ListStripRule.STRIP_NOTHING) { dumpDefault(builder, field, desc.getListIndex()); } @@ -2137,7 +2252,7 @@ private boolean dumpStandardField(DynamicMessage.Builder builder, DataDstWriterN if (null == val) { if (field.isRequired() - || ProgramOptions.getInstance().stripListRule == ProgramOptions.ListStripRule.KEEP_ALL) { + || field.getListStripRule() == DataDstWriterNode.ListStripRule.STRIP_NOTHING) { dumpDefault(builder, field, desc.getListIndex()); } @@ -2157,7 +2272,7 @@ private boolean dumpPlainField(DynamicMessage.Builder builder, IdentifyDescripto } if (null == ident) { - if (ProgramOptions.getInstance().stripListRule == ProgramOptions.ListStripRule.KEEP_ALL) { + if (DataDstWriterNode.getDefaultListStripRule() == DataDstWriterNode.ListStripRule.STRIP_NOTHING) { dumpDefault(builder, field); } return false; @@ -2225,7 +2340,7 @@ private boolean dumpPlainField(DynamicMessage.Builder builder, IdentifyDescripto String fieldPath) throws ConvException { if (null == ident) { if (field.isRequired() - || ProgramOptions.getInstance().stripListRule == ProgramOptions.ListStripRule.KEEP_ALL) { + || field.getListStripRule() == DataDstWriterNode.ListStripRule.STRIP_NOTHING) { dumpDefault(builder, field, 0); } return false; @@ -2234,7 +2349,7 @@ private boolean dumpPlainField(DynamicMessage.Builder builder, IdentifyDescripto DataContainer res = DataSrcImpl.getOurInstance().getValue(ident, ""); if (null == res || !res.valid) { if (field.isRequired() - || ProgramOptions.getInstance().stripListRule == ProgramOptions.ListStripRule.KEEP_ALL) { + || field.getListStripRule() == DataDstWriterNode.ListStripRule.STRIP_NOTHING) { dumpDefault(builder, field, 0); } return false; @@ -2270,6 +2385,7 @@ private boolean dumpPlainField(DynamicMessage.Builder builder, IdentifyDescripto } Object parsedDatas = null; + boolean ret = true; switch (field.getType()) { case INT: { Long[] values = parsePlainDataLong(groups, ident, field); @@ -2441,15 +2557,15 @@ private boolean dumpPlainField(DynamicMessage.Builder builder, IdentifyDescripto if (null != maybeFromNode && maybeFromNode.getListIndex() >= 0) { if (values.size() != 1) { throw new ConvException( - String.format("Try to convert %s.%s.%d failed, too many elements(found %d).", + String.format("Try to convert %s.%s.%d failed, too many element(s)(found %d).", field.getTypeDescriptor().getFullName(), field.getName(), maybeFromNode.getListIndex(), values.size())); } int index = maybeFromNode.getListIndex(); - ProgramOptions.ListStripRule stripListRule = ProgramOptions.getInstance().stripListRule; - if (stripListRule == ProgramOptions.ListStripRule.KEEP_ALL - || stripListRule == ProgramOptions.ListStripRule.STRIP_EMPTY_TAIL) { + DataDstWriterNode.ListStripRule stripListRule = field.getListStripRule(); + if (stripListRule == DataDstWriterNode.ListStripRule.STRIP_NOTHING + || stripListRule == DataDstWriterNode.ListStripRule.STRIP_TAIL) { while (builder.getRepeatedFieldCount(fd) < index) { builder.addRepeatedField(fd, getDefault(builder, field)); } @@ -2485,13 +2601,34 @@ private boolean dumpPlainField(DynamicMessage.Builder builder, IdentifyDescripto } } } - } else if (ProgramOptions.getInstance().stripListRule == ProgramOptions.ListStripRule.KEEP_ALL) { + } else if (field.getListStripRule() == DataDstWriterNode.ListStripRule.STRIP_NOTHING) { builder.addRepeatedField(fd, getDefault(builder, field)); } else { - return false; + ret = false; } - return true; + // Check list size + { + var listExt = field.getListExtension(); + if (listExt != null) { + if (listExt.minSize > 0 && listExt.minSize > builder.getRepeatedFieldCount(fd)) { + throw new ConvException( + String.format( + "Try to convert %s failed, require at least %d element(s), real got %d element(s).", + fd.getFullName(), + listExt.minSize, builder.getRepeatedFieldCount(fd))); + } + if (listExt.maxSize > 0 && listExt.maxSize < builder.getRepeatedFieldCount(fd)) { + throw new ConvException( + String.format( + "Try to convert %s failed, require at most %d element(s), real got %d element(s).", + fd.getFullName(), + listExt.maxSize, builder.getRepeatedFieldCount(fd))); + } + } + } + + return ret; } else { Object val = null; diff --git a/src/org/xresloader/core/data/dst/DataDstUEBase.java b/src/org/xresloader/core/data/dst/DataDstUEBase.java index a091956a..537d3339 100644 --- a/src/org/xresloader/core/data/dst/DataDstUEBase.java +++ b/src/org/xresloader/core/data/dst/DataDstUEBase.java @@ -1114,7 +1114,7 @@ protected Object pickValueFieldBaseStandardImpl(DataDstWriterNode desc) throws C throw new ConvException(validateErrorMessage); } return ret.value.intValue(); - } else if (ProgramOptions.getInstance().stripListRule == ProgramOptions.ListStripRule.KEEP_ALL) { + } else if (desc.getFieldListStripRule() == DataDstWriterNode.ListStripRule.STRIP_NOTHING) { return Integer.valueOf(0); } break; @@ -1129,7 +1129,7 @@ protected Object pickValueFieldBaseStandardImpl(DataDstWriterNode desc) throws C } return ret.value.longValue(); - } else if (ProgramOptions.getInstance().stripListRule == ProgramOptions.ListStripRule.KEEP_ALL) { + } else if (desc.getFieldListStripRule() == DataDstWriterNode.ListStripRule.STRIP_NOTHING) { return Long.valueOf(0); } break; @@ -1144,7 +1144,7 @@ protected Object pickValueFieldBaseStandardImpl(DataDstWriterNode desc) throws C } return ret.value.floatValue(); - } else if (ProgramOptions.getInstance().stripListRule == ProgramOptions.ListStripRule.KEEP_ALL) { + } else if (desc.getFieldListStripRule() == DataDstWriterNode.ListStripRule.STRIP_NOTHING) { return Float.valueOf(0); } break; @@ -1159,7 +1159,7 @@ protected Object pickValueFieldBaseStandardImpl(DataDstWriterNode desc) throws C } return ret.value.doubleValue(); - } else if (ProgramOptions.getInstance().stripListRule == ProgramOptions.ListStripRule.KEEP_ALL) { + } else if (desc.getFieldListStripRule() == DataDstWriterNode.ListStripRule.STRIP_NOTHING) { return Double.valueOf(0); } break; @@ -1174,7 +1174,7 @@ protected Object pickValueFieldBaseStandardImpl(DataDstWriterNode desc) throws C } return ret.value.booleanValue(); - } else if (ProgramOptions.getInstance().stripListRule == ProgramOptions.ListStripRule.KEEP_ALL) { + } else if (desc.getFieldListStripRule() == DataDstWriterNode.ListStripRule.STRIP_NOTHING) { return Boolean.valueOf(false); } break; @@ -1189,7 +1189,7 @@ protected Object pickValueFieldBaseStandardImpl(DataDstWriterNode desc) throws C } return ret.value; - } else if (ProgramOptions.getInstance().stripListRule == ProgramOptions.ListStripRule.KEEP_ALL) { + } else if (desc.getFieldListStripRule() == DataDstWriterNode.ListStripRule.STRIP_NOTHING) { return ""; } break; @@ -1209,7 +1209,7 @@ protected Object pickValueFieldBaseStandardImpl(DataDstWriterNode desc) throws C } else { return Base64.getEncoder().encodeToString(res.value.getBytes(Charset.forName(encoding))); } - } else if (ProgramOptions.getInstance().stripListRule == ProgramOptions.ListStripRule.KEEP_ALL) { + } else if (desc.getFieldListStripRule() == DataDstWriterNode.ListStripRule.STRIP_NOTHING) { return ""; } break; diff --git a/src/org/xresloader/core/data/dst/DataDstUEJson.java b/src/org/xresloader/core/data/dst/DataDstUEJson.java index 87970a9d..ace971ab 100644 --- a/src/org/xresloader/core/data/dst/DataDstUEJson.java +++ b/src/org/xresloader/core/data/dst/DataDstUEJson.java @@ -374,7 +374,7 @@ protected Object dumpDefault(JSONObject builder, DataDstFieldDescriptor fd) { old = new JSONArray(); builder.put(varName, old); } - if (ProgramOptions.getInstance().stripListRule == ProgramOptions.ListStripRule.KEEP_ALL) { + if (fd.getListStripRule() == DataDstWriterNode.ListStripRule.STRIP_NOTHING) { Object val = getDefault(fd); if (val == null) { return old; diff --git a/src/org/xresloader/core/data/dst/DataDstWriterNode.java b/src/org/xresloader/core/data/dst/DataDstWriterNode.java index dc209706..653986f8 100644 --- a/src/org/xresloader/core/data/dst/DataDstWriterNode.java +++ b/src/org/xresloader/core/data/dst/DataDstWriterNode.java @@ -42,6 +42,16 @@ static public class DataDstFieldExtUE { public String ueOriginTypeDefaultValue = null; } + public enum ListStripRule { + DEFAULT, STRIP_TAIL, STRIP_NOTHING, STRIP_ALL + } + + static public class DataDstFieldExtList { + public ListStripRule stripOption = ListStripRule.DEFAULT; + public int minSize = 0; + public int maxSize = 0; + } + static public class DataDstFieldExt { public String description = null; public String validator = null; @@ -51,6 +61,7 @@ static public class DataDstFieldExt { public boolean allowMissingInPlainMode = false; public ArrayList uniqueTags = null; private DataDstFieldExtUE ue = null; + private DataDstFieldExtList list = null; public DataDstFieldExtUE mutableUE() { if (null != ue) { @@ -60,6 +71,19 @@ public DataDstFieldExtUE mutableUE() { ue = new DataDstFieldExtUE(); return ue; } + + public DataDstFieldExtList mutableList() { + if (null != list) { + return list; + } + + list = new DataDstFieldExtList(); + return list; + } + + public DataDstFieldExtList getList() { + return list; + } } static public class DataDstOneofExt { @@ -94,6 +118,18 @@ public DataDstMessageExtUE mutableUE() { } } + static public ListStripRule getDefaultListStripRule() { + if (ProgramOptions.getInstance().stripListRule == ProgramOptions.ListStripRule.KEEP_ALL) { + return ListStripRule.STRIP_NOTHING; + } + + if (ProgramOptions.getInstance().stripListRule == ProgramOptions.ListStripRule.STRIP_EMPTY_TAIL) { + return ListStripRule.STRIP_TAIL; + } + + return ListStripRule.STRIP_ALL; + } + static public class DataDstFieldDescriptor { private int index = 0; private String name = null; @@ -231,6 +267,30 @@ public DataDstFieldExt mutableExtension() { return extension; } + public DataDstFieldExtList getListExtension() { + if (this.extension == null) { + return null; + } + + return this.extension.getList(); + } + + public ListStripRule getListStripRule() { + if (this.extension == null) { + return getDefaultListStripRule(); + } + + if (this.extension.list == null) { + return getDefaultListStripRule(); + } + + if (this.extension.list.stripOption == ListStripRule.DEFAULT) { + return getDefaultListStripRule(); + } + + return this.extension.list.stripOption; + } + public void setReferOneof(DataDstOneofDescriptor fd) { this.referOneofDescriptor = fd; } @@ -619,6 +679,14 @@ public int getFieldIndex() { return this.innerFieldDesc.getIndex(); } + public ListStripRule getFieldListStripRule() { + if (this.innerFieldDesc == null) { + return getDefaultListStripRule(); + } + + return this.innerFieldDesc.getListStripRule(); + } + public boolean isOneof() { return this.innerOneofDesc != null; } @@ -798,6 +866,14 @@ public DataDstFieldExt getFieldExtension() { return this.fieldDescriptor.mutableExtension(); } + public ListStripRule getFieldListStripRule() { + if (this.fieldDescriptor == null) { + return getDefaultListStripRule(); + } + + return this.fieldDescriptor.getListStripRule(); + } + public DataDstOneofDescriptor getOneofDescriptor() { return this.oneofDescriptor; } diff --git a/tools/extensions.pb b/tools/extensions.pb index bf6cbcf5ac8ca7c797d56842a47cf1761dbd53f2..47383f08ca691c3d331a6f8f122ff21db9861721 100644 GIT binary patch delta 344 zcmX>odRT&)>yh9@W|w-cEG~YZ%;J*ZlA_E4|ALat{5&BsE+HS!;E?#>kRZ>1co$bU z$55XT0R}X2KmQO9Pd|47Mj>IK5eW4mj-EaOOhQ6jd`NRvugeX_+~x@hPdr z$w2FXmTio>&mvXEC7za;CjUWVCYG#0P5Ln&f3Ka0D1**<^TWy delta 20 ccmX>saZr?*>jB?HW|xhdKe24y&DOyR08x1d-~a#s diff --git a/tools/gen_header_v2.py b/tools/gen_header_v2.py index a43ee5d9..d91e15ac 100644 --- a/tools/gen_header_v2.py +++ b/tools/gen_header_v2.py @@ -38,7 +38,7 @@ # java 文件为非LITE版本 proto_file_data = open(proto_file).read() proto_file_no_lite_data = re.sub( - '\s*option\s*optimize_for\s*=\s*LITE_RUNTIME\s*;', + '\\s*option\\s*optimize_for\\s*=\\s*LITE_RUNTIME\\s*;', '// option optimize_for = LITE_RUNTIME;', proto_file_data) open(proto_file, 'wb').write(proto_file_no_lite_data.encode('utf-8')) From 88e5b54d7150a3364a69fb6de795f04b6f717f72 Mon Sep 17 00:00:00 2001 From: owent <> Date: Wed, 24 Jul 2024 22:36:28 +0800 Subject: [PATCH 02/10] Update protocols --- third_party/xresloader-protocol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/xresloader-protocol b/third_party/xresloader-protocol index 9c4da69f..50f43e8e 160000 --- a/third_party/xresloader-protocol +++ b/third_party/xresloader-protocol @@ -1 +1 @@ -Subproject commit 9c4da69fa213bb953f08309f8f6136e237a000cf +Subproject commit 50f43e8e82a167f00bbd10d0cb8ea79196cc1a5b From 0adec8df75f3101df0a5dd7e7eb115da795949f0 Mon Sep 17 00:00:00 2001 From: owent <> Date: Wed, 24 Jul 2024 22:46:11 +0800 Subject: [PATCH 03/10] =?UTF-8?q?=E4=BF=AE=E8=AE=A2README?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bda2a550..cbfd4138 100644 --- a/README.md +++ b/README.md @@ -341,7 +341,7 @@ validator: | org.xresloader.field_required | 设置字段为 **required** ,用于向proto3提供,proto2的 **required** 约束 | | org.xresloader.field_origin_value | 写出原始数据到指定字段( `Timestamp` 和 `Duration` 类型) | | org.xresloader.field_allow_missing_in_plain_mode | Plain模式下设置此字段可选,如果未设置则使用默认值(版本 2.16.0 版本开始支持) | -| org.xresloader.field_list_strip_option | 给单个字段设置数组裁剪,可选值( `LIST_STRIP_DEFAULT\|LIST_STRIP_NOTHING\|LIST_STRIP_TAIL\|LIST_STRIP_ALL` )(版本 2.16.0 版本开始支持) | +| org.xresloader.field_list_strip_option | 给单个字段设置数组裁剪,可选值( `LIST_STRIP_DEFAULT\|LIST_STRIP_NOTHING\|LIST_STRIP_TAIL\|LIST_STRIP_ALL` )(版本 2.18.0 版本开始支持) | | org.xresloader.field_list_min_size | 给单个字段设置数组最小长度,可选值(版本 2.18.0 版本开始支持) | | org.xresloader.field_list_max_size | 给单个字段设置数组最大长度,可选值(版本 2.18.0 版本开始支持) | | org.xresloader.ue.key_tag | 生成UE代码时,如果需要支持多个Key组合成一个Name,用这个字段指定系数(必须大于0) | From a6d2ea549bc1b004f6673dba7c80d170b9bcd0ac Mon Sep 17 00:00:00 2001 From: owent <> Date: Wed, 24 Jul 2024 22:51:39 +0800 Subject: [PATCH 04/10] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index cbfd4138..1c41c688 100644 --- a/README.md +++ b/README.md @@ -316,10 +316,10 @@ validator: #### Protobuf插件 - Message插件 | 插件名称 | 插件功能 | -| :------------------------------------: | :------------------------------------------------------------------------------------------------: | +| :------------------------------------ | :------------------------------------------------------------------------------------------------ | | org.xresloader.msg_description | 消息体描述信息,会写入输出的header中和代码中 | | org.xresloader.msg_require_mapping_all | 设置message的所有字段必须被全部映射 | -| org.xresloader.msg_separator | Plain模式字段分隔符,可指定多个,用于在一个单元格内配置复杂格式时的分隔符列表,默认值: `,;|` | +| org.xresloader.msg_separator | Plain模式字段分隔符,可指定多个,用于在一个单元格内配置复杂格式时的分隔符列表,默认值: `,;、|` | | org.xresloader.ue.helper | 生成UE Utility代码的类名后缀 | | org.xresloader.ue.not_data_table | 不是DataTable,helper类里不生成加载代码 | | org.xresloader.ue.default_loader | Message是否开启默认Loader(`EN_LOADER_MODE_DEFAULT,EN_LOADER_MODE_ENABLE,EN_LOADER_MODE_DISABLE`) | @@ -328,7 +328,7 @@ validator: #### Protobuf插件 - Field插件 | 插件名称 | 插件功能 | -| :----------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------: | +| :---------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------ | | org.xresloader.validator | 验证器,可填范围(log-high),message名,enum名。多个由 `\|` 分隔。任意验证器通过检查则认为数据有效 | | org.xresloader.field_unique_tag | 设置唯一性检测Tag,多个相同tag的字段将合并并在转出数据时检测唯一性(可多个) | | org.xresloader.field_not_null | 如果配置了字段映射且某个数据行对应的oneof数据为空,则忽略此行 | @@ -342,6 +342,10 @@ validator: | org.xresloader.field_origin_value | 写出原始数据到指定字段( `Timestamp` 和 `Duration` 类型) | | org.xresloader.field_allow_missing_in_plain_mode | Plain模式下设置此字段可选,如果未设置则使用默认值(版本 2.16.0 版本开始支持) | | org.xresloader.field_list_strip_option | 给单个字段设置数组裁剪,可选值( `LIST_STRIP_DEFAULT\|LIST_STRIP_NOTHING\|LIST_STRIP_TAIL\|LIST_STRIP_ALL` )(版本 2.18.0 版本开始支持) | +| | + `LIST_STRIP_DEFAULT`: 默认值,使用 `--list-strip-all-empty/--list-keep-empty/--list-strip-empty-tail` 控制,未设置则是裁剪全部空值 ) | +| | + `LIST_STRIP_NOTHING`: 不裁剪数据,相当于 `--list-keep-empty` | +| | + `LIST_STRIP_TAIL`: 裁剪尾部空值,相当于 `--list-strip-empty-tail` | +| | + `LIST_STRIP_ALL`: 裁剪全部空值,相当于 `--list-strip-all-empty` | | org.xresloader.field_list_min_size | 给单个字段设置数组最小长度,可选值(版本 2.18.0 版本开始支持) | | org.xresloader.field_list_max_size | 给单个字段设置数组最大长度,可选值(版本 2.18.0 版本开始支持) | | org.xresloader.ue.key_tag | 生成UE代码时,如果需要支持多个Key组合成一个Name,用这个字段指定系数(必须大于0) | @@ -353,14 +357,14 @@ validator: #### Protobuf插件 - EnumValue插件 | 插件名称 | 插件功能 | -| :------------------------------: | :--------------------------------------------------------------------: | +| :------------------------------ | :-------------------------------------------------------------------- | | org.xresloader.enumv_description | 枚举值描述信息,可能会写入输出的header中和代码中 | | org.xresloader.enum_alias | 枚举值别名,配合 **验证器** 功能,允许在数据源中直接填写别名来配置数据 | #### Protobuf插件 - Oneof插件(2.8.0版本及以上) | 插件名称 | 插件功能 | -| :----------------------------------------------: | :--------------------------------------------------------------------------------------------------: | +| :---------------------------------------------- | :-------------------------------------------------------------------------------------------------- | | org.xresloader.oneof_description | oneof描述信息,可能会写入输出的header中和代码中 | | org.xresloader.oneof_separator | Plain模式类型和值字段的分隔符,可指定多个,用于在一个单元格内配置复杂格式时的分隔符列表,默认值: `,;\| ` | | org.xresloader.oneof_not_null | 如果配置了字段映射且某个数据行对应的oneof数据为空,则忽略此行 | From 769a74e7db94ab0d6688cf338c694c720a3ddfc7 Mon Sep 17 00:00:00 2001 From: owent <> Date: Wed, 24 Jul 2024 23:56:17 +0800 Subject: [PATCH 05/10] =?UTF-8?q?=E4=BF=AE=E8=AE=A2=E6=95=B0=E7=BB=84?= =?UTF-8?q?=E9=99=90=E5=AE=9A=E4=B8=BA=E5=AD=97=E7=AC=A6=E4=B8=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HISTORY.md | 4 +- README.md | 4 +- header/org/xresloader/Xresloader.java | 12 +- sample/cxx/v2/dependency.pb.cc | 28 +-- sample/cxx/v2/dependency.pb.h | 3 +- sample/cxx/v2/kind.pb.cc | 133 +++++++------- sample/cxx/v2/kind.pb.h | 8 +- sample/cxx/v3/kind.pb.cc | 167 +++++++++--------- sample/cxx/v3/kind.pb.h | 8 +- sample/proto_v2/dependency.proto | 35 ++-- sample/proto_v2/json/KindConst.json | 4 + sample/proto_v2/kind.desc.json | 12 +- sample/proto_v2/kind.desc.lua | 13 +- sample/proto_v2/kind.pb | Bin 4927 -> 4990 bytes sample/proto_v2/kind.proto | 4 +- sample/proto_v2/kind_const.lua | 1 + sample/proto_v2/kind_const_module.lua | 1 + sample/proto_v2/kind_option.js | 13 +- sample/proto_v2/kind_option.lua | 13 +- sample/proto_v2/kind_option.mod.lua | 13 +- sample/proto_v3/kind.desc.json | 8 +- sample/proto_v3/kind.desc.lua | 8 +- sample/proto_v3/kind.pb | Bin 5635 -> 5670 bytes sample/proto_v3/kind.proto | 4 +- sample/proto_v3/kind_option.js | 8 +- sample/proto_v3/kind_option.lua | 8 +- sample/proto_v3/kind_option.mod.lua | 8 +- .../xresloader/core/data/dst/DataDstPb.java | 104 ++++++++++- .../core/data/dst/DataDstWriterNode.java | 2 +- third_party/xresloader-protocol | 2 +- tools/extensions.pb | Bin 3139 -> 3139 bytes 31 files changed, 386 insertions(+), 242 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 18479e77..0486b607 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -5,8 +5,8 @@ ## 2.18.0 1. 增加插件 `org.xresloader.field_list_strip_option=LIST_STRIP_DEFAULT|LIST_STRIP_NOTHING|LIST_STRIP_TAIL|LIST_STRIP_ALL` 用于给单个字段设置数组裁剪。 -2. 增加插件 `org.xresloader.field_list_min_size=` 用于给单个字段数组最小长度要求。 -3. 增加插件 `org.xresloader.field_list_max_size=` 用于给单个字段数组最大长度要求。 +2. 增加插件 `org.xresloader.field_list_min_size="|枚举名"` 用于给单个字段数组最小长度要求。 +3. 增加插件 `org.xresloader.field_list_max_size="|枚举名"` 用于给单个字段数组最大长度要求。 ## 2.17.1 diff --git a/README.md b/README.md index 1c41c688..9ae90248 100644 --- a/README.md +++ b/README.md @@ -346,8 +346,8 @@ validator: | | + `LIST_STRIP_NOTHING`: 不裁剪数据,相当于 `--list-keep-empty` | | | + `LIST_STRIP_TAIL`: 裁剪尾部空值,相当于 `--list-strip-empty-tail` | | | + `LIST_STRIP_ALL`: 裁剪全部空值,相当于 `--list-strip-all-empty` | -| org.xresloader.field_list_min_size | 给单个字段设置数组最小长度,可选值(版本 2.18.0 版本开始支持) | -| org.xresloader.field_list_max_size | 给单个字段设置数组最大长度,可选值(版本 2.18.0 版本开始支持) | +| org.xresloader.field_list_min_size | 给单个字段设置数组最小长度,输入字符串:`"\|枚举名"`(版本 2.18.0 版本开始支持) | +| org.xresloader.field_list_max_size | 给单个字段设置数组最大长度,输入字符串:`"\|枚举名"`(版本 2.18.0 版本开始支持) | | org.xresloader.ue.key_tag | 生成UE代码时,如果需要支持多个Key组合成一个Name,用这个字段指定系数(必须大于0) | | org.xresloader.ue.ue_type_name | 生成UE代码时,如果指定了这个字段,那么生成的字段类型将是 `TSoftObjectPtr` , 并且支持蓝图中直接引用 | | org.xresloader.ue.ue_type_is_class | 生成UE代码时,如果指定了这个字段,那么生成的字段类型将是 `TSoftClassPtr` , 并且支持蓝图中直接引用 | diff --git a/header/org/xresloader/Xresloader.java b/header/org/xresloader/Xresloader.java index c32c3abe..e6097c49 100644 --- a/header/org/xresloader/Xresloader.java +++ b/header/org/xresloader/Xresloader.java @@ -501,9 +501,9 @@ private ListStripOption(int value) { public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< com.google.protobuf.DescriptorProtos.FieldOptions, - java.lang.Integer> fieldListMinSize = com.google.protobuf.GeneratedMessage + java.lang.String> fieldListMinSize = com.google.protobuf.GeneratedMessage .newFileScopedGeneratedExtension( - java.lang.Integer.class, + java.lang.String.class, null); public static final int FIELD_LIST_MAX_SIZE_FIELD_NUMBER = 1020; /** @@ -516,9 +516,9 @@ private ListStripOption(int value) { public static final com.google.protobuf.GeneratedMessage.GeneratedExtension< com.google.protobuf.DescriptorProtos.FieldOptions, - java.lang.Integer> fieldListMaxSize = com.google.protobuf.GeneratedMessage + java.lang.String> fieldListMaxSize = com.google.protobuf.GeneratedMessage .newFileScopedGeneratedExtension( - java.lang.Integer.class, + java.lang.String.class, null); public static final int ONEOF_DESCRIPTION_FIELD_NUMBER = 1001; /** @@ -667,8 +667,8 @@ private ListStripOption(int value) { ".protobuf.FieldOptions\030\372\007 \001(\0162\037.org.xres" + "loader.ListStripOption:;\n\023field_list_min" + "_size\022\035.google.protobuf.FieldOptions\030\373\007 " + - "\001(\005:;\n\023field_list_max_size\022\035.google.prot" + - "obuf.FieldOptions\030\374\007 \001(\005:9\n\021oneof_descri" + + "\001(\t:;\n\023field_list_max_size\022\035.google.prot" + + "obuf.FieldOptions\030\374\007 \001(\t:9\n\021oneof_descri" + "ption\022\035.google.protobuf.OneofOptions\030\351\007 " + "\001(\t:7\n\017oneof_separator\022\035.google.protobuf" + ".OneofOptions\030\352\007 \001(\t:6\n\016oneof_not_null\022\035" + diff --git a/sample/cxx/v2/dependency.pb.cc b/sample/cxx/v2/dependency.pb.cc index 940b3e00..7ddc51dd 100755 --- a/sample/cxx/v2/dependency.pb.cc +++ b/sample/cxx/v2/dependency.pb.cc @@ -79,18 +79,18 @@ const char descriptor_table_protodef_dependency_2eproto[] ABSL_ATTRIBUTE_SECTION protodesc_cold) = { "\n\020dependency.proto\032\020xresloader.proto\032\020de" "p_level2.proto\"<\n\007dep_cfg\022\n\n\002id\030\001 \001(\r\022\014\n" - "\004name\030\002 \001(\t\022\027\n\004dep2\030\003 \001(\0132\t.dep2_cfg*\267\002\n" - "\021game_const_config\022\030\n\023EN_GCC_PERCENT_BAS" - "E\020\220N\022\034\n\030EN_GCC_RANDOM_RANGE_UNIT\020\n\022 \n\031EN" - "_GCC_RESOURCE_MAX_LIMIT\020\377\254\342\004\022\027\n\022EN_GCC_L" - "EVEL_LIMIT\020\347\007\022\034\n\030EN_GCC_SOLDIER_TYPE_MAS" - "K\020d\022\036\n\031EN_GCC_ACTIVITY_TYPE_MASK\020\350\007\022\035\n\031E" - "N_GCC_FORMULAR_TYPE_MASK\020\n\022\030\n\023EN_GCC_SCR" - "EEN_WIDTH\020\360\010\022\031\n\024EN_GCC_SCREEN_HEIGHT\020\200\005\022" - "\031\n\024EN_GCC_CAMERA_OFFSET\020\214\002\032\002\020\001*Z\n\tcost_t" - "ype\022\021\n\rEN_CT_UNKNOWN\020\000\022\033\n\013EN_CT_MONEY\020\221N" - "\032\t\322>\006\351\207\221\345\270\201\022\035\n\rEN_CT_DIAMOND\020\365N\032\t\322>\006\351\222\273\347" - "\237\263" + "\004name\030\002 \001(\t\022\027\n\004dep2\030\003 \001(\0132\t.dep2_cfg*\313\002\n" + "\021game_const_config\022\022\n\016EN_GCC_UNKNOWN\020\000\022\030" + "\n\023EN_GCC_PERCENT_BASE\020\220N\022\034\n\030EN_GCC_RANDO" + "M_RANGE_UNIT\020\n\022 \n\031EN_GCC_RESOURCE_MAX_LI" + "MIT\020\377\254\342\004\022\027\n\022EN_GCC_LEVEL_LIMIT\020\347\007\022\034\n\030EN_" + "GCC_SOLDIER_TYPE_MASK\020d\022\036\n\031EN_GCC_ACTIVI" + "TY_TYPE_MASK\020\350\007\022\035\n\031EN_GCC_FORMULAR_TYPE_" + "MASK\020\n\022\030\n\023EN_GCC_SCREEN_WIDTH\020\360\010\022\031\n\024EN_G" + "CC_SCREEN_HEIGHT\020\200\005\022\031\n\024EN_GCC_CAMERA_OFF" + "SET\020\214\002\032\002\020\001*Z\n\tcost_type\022\021\n\rEN_CT_UNKNOWN" + "\020\000\022\033\n\013EN_CT_MONEY\020\221N\032\t\322>\006\351\207\221\345\270\201\022\035\n\rEN_CT" + "_DIAMOND\020\365N\032\t\322>\006\351\222\273\347\237\263" }; static const ::_pbi::DescriptorTable* const descriptor_table_dependency_2eproto_deps[2] = { @@ -101,7 +101,7 @@ static ::absl::once_flag descriptor_table_dependency_2eproto_once; PROTOBUF_CONSTINIT const ::_pbi::DescriptorTable descriptor_table_dependency_2eproto = { false, false, - 522, + 542, descriptor_table_protodef_dependency_2eproto, "dependency.proto", &descriptor_table_dependency_2eproto_once, @@ -119,7 +119,7 @@ const ::google::protobuf::EnumDescriptor* game_const_config_descriptor() { return file_level_enum_descriptors_dependency_2eproto[0]; } PROTOBUF_CONSTINIT const uint32_t game_const_config_internal_data_[] = { - 65546u, 524288u, 1000u, 640u, 10000u, 268u, 999u, 1136u, 9999999u, 100u, }; + 65536u, 524320u, 512u, 1000u, 640u, 10000u, 268u, 999u, 1136u, 9999999u, 100u, }; bool game_const_config_IsValid(int value) { return ::_pbi::ValidateEnum(value, game_const_config_internal_data_); } diff --git a/sample/cxx/v2/dependency.pb.h b/sample/cxx/v2/dependency.pb.h index 0b32511e..4d97b5cf 100755 --- a/sample/cxx/v2/dependency.pb.h +++ b/sample/cxx/v2/dependency.pb.h @@ -61,6 +61,7 @@ namespace protobuf { } // namespace google enum game_const_config : int { + EN_GCC_UNKNOWN = 0, EN_GCC_PERCENT_BASE = 10000, EN_GCC_RANDOM_RANGE_UNIT = 10, EN_GCC_RESOURCE_MAX_LIMIT = 9999999, @@ -75,7 +76,7 @@ enum game_const_config : int { bool game_const_config_IsValid(int value); extern const uint32_t game_const_config_internal_data_[]; -constexpr game_const_config game_const_config_MIN = static_cast(10); +constexpr game_const_config game_const_config_MIN = static_cast(0); constexpr game_const_config game_const_config_MAX = static_cast(9999999); constexpr int game_const_config_ARRAYSIZE = 9999999 + 1; const ::google::protobuf::EnumDescriptor* diff --git a/sample/cxx/v2/kind.pb.cc b/sample/cxx/v2/kind.pb.cc index e2cd3c65..4bfda2fe 100755 --- a/sample/cxx/v2/kind.pb.cc +++ b/sample/cxx/v2/kind.pb.cc @@ -770,65 +770,66 @@ const char descriptor_table_protodef_kind_2eproto[] ABSL_ATTRIBUTE_SECTION_VARIA "ade_cfg with multi keys\352D\006helper\"o\n\021test" "_msg_verifier\022\022\n\ttest_id_1\030\221N \001(\r\022&\n\ttes" "t_id_2\030\222N \001(\rB\022\242\?\017\346\265\213\350\257\225ID\345\210\253\345\220\2152\022\027\n\ttes" - "t_id_3\030\223N \001(\rB\003\310\?\001:\005\242\?\002-^\"x\n\narr_in_arr\022" - "-\n\004name\030\001 \001(\tB\037\232\?\034This is a test name in" - " array\022\034\n\007int_arr\030\002 \003(\005B\013\020\001\320\?\001\330\?\001\340\?\003\022\017\n\007" - "str_arr\030\003 \003(\t:\014\352D\006helper\360D\001\"\362\003\n\016arr_in_a" - "rr_cfg\022\037\n\002id\030\001 \001(\rB\023\232\?\rThis is a Key\350D\001\022" - "\030\n\003arr\030\002 \003(\0132\013.arr_in_arr\022\032\n\022test_plain_" - "int_arr\030\003 \003(\005\022\'\n\023test_plain_enum_arr\030\004 \003" - "(\0162\n.cost_type\0220\n\016test_plain_msg\030\005 \001(\0132\022" - ".test_msg_verifierB\004\262\?\001&\022.\n\022test_plain_m" - "sg_arr\030\006 \003(\0132\022.test_msg_verifier\0223\n\013test" - "_map_is\030\007 \003(\0132\036.arr_in_arr_cfg.TestMapIs" - "Entry\0229\n\013test_map_sm\030\010 \003(\0132\036.arr_in_arr_" - "cfg.TestMapSmEntryB\004\262\?\001|\0320\n\016TestMapIsEnt" - "ry\022\013\n\003key\030\001 \001(\005\022\r\n\005value\030\002 \001(\t:\0028\001\032;\n\016Te" - "stMapSmEntry\022\013\n\003key\030\001 \001(\t\022\030\n\005value\030\002 \001(\013" - "2\t.dep2_cfg:\0028\001:\037\312>\023Test arr_in_arr_cfg\352" - "D\006helper\"\243\001\n\021event_reward_item\022\017\n\007item_i" - "d\030\001 \001(\r\022\022\n\nitem_count\030\002 \001(\r\022&\n\013nested_no" - "te\030\013 \001(\tB\017\242\?\014\346\217\217\350\277\260\346\226\207\346\234\254H\000\0227\n\020nested_en" - "um_type\030\014 \001(\0162\n.cost_typeB\017\242\?\014\350\264\247\345\270\201\347\261\273\345" - "\236\213H\000B\010\n\006nested\"\241\001\n\017event_rule_item\022\017\n\007ru" - "le_id\030\001 \001(\r\022\022\n\nrule_param\030\002 \001(\r\022&\n\013neste" + "t_id_3\030\223N \001(\rB\003\310\?\001:\005\242\?\002-^\"\231\001\n\narr_in_arr" + "\022-\n\004name\030\001 \001(\tB\037\232\?\034This is a test name i" + "n array\022=\n\007int_arr\030\002 \003(\005B,\020\001\320\?\001\332\? game_c" + "onst_config.EN_GCC_UNKNOWN\342\?\0013\022\017\n\007str_ar" + "r\030\003 \003(\t:\014\352D\006helper\360D\001\"\374\003\n\016arr_in_arr_cfg" + "\022\037\n\002id\030\001 \001(\rB\023\232\?\rThis is a Key\350D\001\022\030\n\003arr" + "\030\002 \003(\0132\013.arr_in_arr\022$\n\022test_plain_int_ar" + "r\030\003 \003(\005B\010\332\?\0011\342\?\0013\022\'\n\023test_plain_enum_arr" + "\030\004 \003(\0162\n.cost_type\0220\n\016test_plain_msg\030\005 \001" + "(\0132\022.test_msg_verifierB\004\262\?\001&\022.\n\022test_pla" + "in_msg_arr\030\006 \003(\0132\022.test_msg_verifier\0223\n\013" + "test_map_is\030\007 \003(\0132\036.arr_in_arr_cfg.TestM" + "apIsEntry\0229\n\013test_map_sm\030\010 \003(\0132\036.arr_in_" + "arr_cfg.TestMapSmEntryB\004\262\?\001|\0320\n\016TestMapI" + "sEntry\022\013\n\003key\030\001 \001(\005\022\r\n\005value\030\002 \001(\t:\0028\001\032;" + "\n\016TestMapSmEntry\022\013\n\003key\030\001 \001(\t\022\030\n\005value\030\002" + " \001(\0132\t.dep2_cfg:\0028\001:\037\312>\023Test arr_in_arr_" + "cfg\352D\006helper\"\243\001\n\021event_reward_item\022\017\n\007it" + "em_id\030\001 \001(\r\022\022\n\nitem_count\030\002 \001(\r\022&\n\013neste" "d_note\030\013 \001(\tB\017\242\?\014\346\217\217\350\277\260\346\226\207\346\234\254H\000\0227\n\020neste" "d_enum_type\030\014 \001(\0162\n.cost_typeB\017\242\?\014\350\264\247\345\270\201" - "\347\261\273\345\236\213H\000B\010\n\006nested\"\244\004\n\tevent_cfg\022.\n\002id\030\001" - " \001(\rB\"\312>\014custom_rule4\322>\nunique_tag\330>\001\350Dd" - "\022$\n\007process\030\002 \001(\rB\023\322>\nunique_tag\330>\001\350D\001\022\036" - "\n\004rule\030\006 \001(\0132\020.event_rule_item\022\'\n\rspecif" - "y_field\030\007 \001(\0132\020.event_rule_item\0223\n\004item\030" - "\013 \001(\0132\022.event_reward_itemB\017\242\?\014\345\245\226\345\212\261\351\201\223\345" - "\205\267H\000\022#\n\010user_exp\030\014 \001(\003B\017\242\?\014\345\245\226\345\212\261\347\273\217\351\252\214H" - "\000\022\037\n\004note\030\r \001(\tB\017\242\?\014\346\217\217\350\277\260\346\226\207\346\234\254H\000\0220\n\ten" - "um_type\030\016 \001(\0162\n.cost_typeB\017\242\?\014\350\264\247\345\270\201\347\261\273\345" - "\236\213H\000\022%\n\nuser_level\0303 \001(\rB\017\242\?\014\347\216\251\345\256\266\347\255\211\347\272" - "\247H\001\022(\n\010test_arr\030[ \003(\0132\020.event_rule_itemB" - "\004\262\?\001;\022.\n\016test_empty_arr\030\\ \003(\0132\020.event_ru" - "le_itemB\004\262\?\001;:,\312> Test event_cfg with on" - "eof fields\352D\006helperB\r\n\006reward\022\003\330>\001B\r\n\013un" - "lock_type\"\266\001\n\034keep_or_strip_empty_list_c" - "fg\022\037\n\002id\030\001 \001(\rB\023\232\?\rThis is a Key\350D\001\022\034\n\ta" - "rray_msg\030\002 \003(\0132\t.dep2_cfg\022\"\n\017array_plain" - "_msg\030\003 \003(\0132\t.dep2_cfg\022\023\n\013array_int32\030\004 \003" - "(\005\022\023\n\013array_int64\030\005 \003(\003:\t\352D\006helper\"4\n\nco" - "mbine_id\022\016\n\006prefix\030\001 \001(\r\022\026\n\002id\030\002 \001(\rB\n\312>" - "\0070-99999\"\224\003\n\021process_by_script\022\n\n\002id\030\001 \001" - "(\r\022<\n\016map_u32_string\030\002 \003(\0132$.process_by_" - "script.MapU32StringEntry\0226\n\013test_map_is\030" - "\007 \003(\0132!.process_by_script.TestMapIsEntry" - "\022<\n\013test_map_sm\030\010 \003(\0132!.process_by_scrip" - "t.TestMapSmEntryB\004\262\?\001|\022\033\n\005id_id\030\351\007 \001(\0132\013" - ".combine_id\0323\n\021MapU32StringEntry\022\013\n\003key\030" - "\001 \001(\r\022\r\n\005value\030\002 \001(\t:\0028\001\0320\n\016TestMapIsEnt" - "ry\022\013\n\003key\030\001 \001(\005\022\r\n\005value\030\002 \001(\t:\0028\001\032;\n\016Te" - "stMapSmEntry\022\013\n\003key\030\001 \001(\t\022\030\n\005value\030\002 \001(\013" - "2\t.dep2_cfg:\0028\001\"\222\001\n\017large_file_test\022\n\n\002i" - "d\030\001 \001(\r\022\020\n\010i32value\030\002 \001(\005\022\020\n\010u64value\030\003 " - "\001(\004\022\020\n\010f64value\030\004 \001(\001\022\020\n\010f32value\030\005 \001(\002\022" - "\017\n\007szvalue\030\006 \001(\t\022\032\n\005id_id\030\007 \001(\0132\013.combin" - "e_id" + "\347\261\273\345\236\213H\000B\010\n\006nested\"\241\001\n\017event_rule_item\022\017" + "\n\007rule_id\030\001 \001(\r\022\022\n\nrule_param\030\002 \001(\r\022&\n\013n" + "ested_note\030\013 \001(\tB\017\242\?\014\346\217\217\350\277\260\346\226\207\346\234\254H\000\0227\n\020n" + "ested_enum_type\030\014 \001(\0162\n.cost_typeB\017\242\?\014\350\264" + "\247\345\270\201\347\261\273\345\236\213H\000B\010\n\006nested\"\244\004\n\tevent_cfg\022.\n\002" + "id\030\001 \001(\rB\"\312>\014custom_rule4\322>\nunique_tag\330>" + "\001\350Dd\022$\n\007process\030\002 \001(\rB\023\322>\nunique_tag\330>\001\350" + "D\001\022\036\n\004rule\030\006 \001(\0132\020.event_rule_item\022\'\n\rsp" + "ecify_field\030\007 \001(\0132\020.event_rule_item\0223\n\004i" + "tem\030\013 \001(\0132\022.event_reward_itemB\017\242\?\014\345\245\226\345\212\261" + "\351\201\223\345\205\267H\000\022#\n\010user_exp\030\014 \001(\003B\017\242\?\014\345\245\226\345\212\261\347\273\217" + "\351\252\214H\000\022\037\n\004note\030\r \001(\tB\017\242\?\014\346\217\217\350\277\260\346\226\207\346\234\254H\000\0220" + "\n\tenum_type\030\016 \001(\0162\n.cost_typeB\017\242\?\014\350\264\247\345\270\201" + "\347\261\273\345\236\213H\000\022%\n\nuser_level\0303 \001(\rB\017\242\?\014\347\216\251\345\256\266\347" + "\255\211\347\272\247H\001\022(\n\010test_arr\030[ \003(\0132\020.event_rule_i" + "temB\004\262\?\001;\022.\n\016test_empty_arr\030\\ \003(\0132\020.even" + "t_rule_itemB\004\262\?\001;:,\312> Test event_cfg wit" + "h oneof fields\352D\006helperB\r\n\006reward\022\003\330>\001B\r" + "\n\013unlock_type\"\266\001\n\034keep_or_strip_empty_li" + "st_cfg\022\037\n\002id\030\001 \001(\rB\023\232\?\rThis is a Key\350D\001\022" + "\034\n\tarray_msg\030\002 \003(\0132\t.dep2_cfg\022\"\n\017array_p" + "lain_msg\030\003 \003(\0132\t.dep2_cfg\022\023\n\013array_int32" + "\030\004 \003(\005\022\023\n\013array_int64\030\005 \003(\003:\t\352D\006helper\"4" + "\n\ncombine_id\022\016\n\006prefix\030\001 \001(\r\022\026\n\002id\030\002 \001(\r" + "B\n\312>\0070-99999\"\224\003\n\021process_by_script\022\n\n\002id" + "\030\001 \001(\r\022<\n\016map_u32_string\030\002 \003(\0132$.process" + "_by_script.MapU32StringEntry\0226\n\013test_map" + "_is\030\007 \003(\0132!.process_by_script.TestMapIsE" + "ntry\022<\n\013test_map_sm\030\010 \003(\0132!.process_by_s" + "cript.TestMapSmEntryB\004\262\?\001|\022\033\n\005id_id\030\351\007 \001" + "(\0132\013.combine_id\0323\n\021MapU32StringEntry\022\013\n\003" + "key\030\001 \001(\r\022\r\n\005value\030\002 \001(\t:\0028\001\0320\n\016TestMapI" + "sEntry\022\013\n\003key\030\001 \001(\005\022\r\n\005value\030\002 \001(\t:\0028\001\032;" + "\n\016TestMapSmEntry\022\013\n\003key\030\001 \001(\t\022\030\n\005value\030\002" + " \001(\0132\t.dep2_cfg:\0028\001\"\222\001\n\017large_file_test\022" + "\n\n\002id\030\001 \001(\r\022\020\n\010i32value\030\002 \001(\005\022\020\n\010u64valu" + "e\030\003 \001(\004\022\020\n\010f64value\030\004 \001(\001\022\020\n\010f32value\030\005 " + "\001(\002\022\017\n\007szvalue\030\006 \001(\t\022\032\n\005id_id\030\007 \001(\0132\013.co" + "mbine_id" }; static const ::_pbi::DescriptorTable* const descriptor_table_kind_2eproto_deps[6] = { @@ -843,7 +844,7 @@ static ::absl::once_flag descriptor_table_kind_2eproto_once; PROTOBUF_CONSTINIT const ::_pbi::DescriptorTable descriptor_table_kind_2eproto = { false, false, - 3444, + 3488, descriptor_table_protodef_kind_2eproto, "kind.proto", &descriptor_table_kind_2eproto_once, @@ -2230,7 +2231,7 @@ const ::_pbi::TcParseTable<2, 3, 0, 30, 2> arr_in_arr::_table_ = { // optional string name = 1 [(.org.xresloader.field_description) = "This is a test name in array"]; {::_pbi::TcParser::FastSS1, {10, 0, 0, PROTOBUF_FIELD_OFFSET(arr_in_arr, _impl_.name_)}}, - // repeated int32 int_arr = 2 [packed = true, (.org.xresloader.field_list_strip_option) = LIST_STRIP_NOTHING, (.org.xresloader.field_list_min_size) = 1, (.org.xresloader.field_list_max_size) = 3]; + // repeated int32 int_arr = 2 [packed = true, (.org.xresloader.field_list_strip_option) = LIST_STRIP_NOTHING, (.org.xresloader.field_list_min_size) = "game_const_config.EN_GCC_UNKNOWN", (.org.xresloader.field_list_max_size) = "3"]; {::_pbi::TcParser::FastV32P1, {18, 63, 0, PROTOBUF_FIELD_OFFSET(arr_in_arr, _impl_.int_arr_)}}, // repeated string str_arr = 3; @@ -2242,7 +2243,7 @@ const ::_pbi::TcParseTable<2, 3, 0, 30, 2> arr_in_arr::_table_ = { // optional string name = 1 [(.org.xresloader.field_description) = "This is a test name in array"]; {PROTOBUF_FIELD_OFFSET(arr_in_arr, _impl_.name_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kRawString | ::_fl::kRepAString)}, - // repeated int32 int_arr = 2 [packed = true, (.org.xresloader.field_list_strip_option) = LIST_STRIP_NOTHING, (.org.xresloader.field_list_min_size) = 1, (.org.xresloader.field_list_max_size) = 3]; + // repeated int32 int_arr = 2 [packed = true, (.org.xresloader.field_list_strip_option) = LIST_STRIP_NOTHING, (.org.xresloader.field_list_min_size) = "game_const_config.EN_GCC_UNKNOWN", (.org.xresloader.field_list_max_size) = "3"]; {PROTOBUF_FIELD_OFFSET(arr_in_arr, _impl_.int_arr_), -1, 0, (0 | ::_fl::kFcRepeated | ::_fl::kPackedInt32)}, // repeated string str_arr = 3; @@ -2291,7 +2292,7 @@ ::uint8_t* arr_in_arr::_InternalSerialize( target = stream->WriteStringMaybeAliased(1, _s, target); } - // repeated int32 int_arr = 2 [packed = true, (.org.xresloader.field_list_strip_option) = LIST_STRIP_NOTHING, (.org.xresloader.field_list_min_size) = 1, (.org.xresloader.field_list_max_size) = 3]; + // repeated int32 int_arr = 2 [packed = true, (.org.xresloader.field_list_strip_option) = LIST_STRIP_NOTHING, (.org.xresloader.field_list_min_size) = "game_const_config.EN_GCC_UNKNOWN", (.org.xresloader.field_list_max_size) = "3"]; { int byte_size = _impl_._int_arr_cached_byte_size_.Get(); if (byte_size > 0) { @@ -2326,7 +2327,7 @@ ::size_t arr_in_arr::ByteSizeLong() const { (void) cached_has_bits; ::_pbi::Prefetch5LinesFrom7Lines(reinterpret_cast(this)); - // repeated int32 int_arr = 2 [packed = true, (.org.xresloader.field_list_strip_option) = LIST_STRIP_NOTHING, (.org.xresloader.field_list_min_size) = 1, (.org.xresloader.field_list_max_size) = 3]; + // repeated int32 int_arr = 2 [packed = true, (.org.xresloader.field_list_strip_option) = LIST_STRIP_NOTHING, (.org.xresloader.field_list_min_size) = "game_const_config.EN_GCC_UNKNOWN", (.org.xresloader.field_list_max_size) = "3"]; { std::size_t data_size = ::_pbi::WireFormatLite::Int32Size( this->_internal_int_arr()) @@ -2569,7 +2570,7 @@ const ::_pbi::TcParseTable<3, 8, 7, 53, 2> arr_in_arr_cfg::_table_ = { // repeated .arr_in_arr arr = 2; {::_pbi::TcParser::FastMtR1, {18, 63, 0, PROTOBUF_FIELD_OFFSET(arr_in_arr_cfg, _impl_.arr_)}}, - // repeated int32 test_plain_int_arr = 3; + // repeated int32 test_plain_int_arr = 3 [(.org.xresloader.field_list_min_size) = "1", (.org.xresloader.field_list_max_size) = "3"]; {::_pbi::TcParser::FastV32R1, {24, 63, 0, PROTOBUF_FIELD_OFFSET(arr_in_arr_cfg, _impl_.test_plain_int_arr_)}}, // repeated .cost_type test_plain_enum_arr = 4; @@ -2591,7 +2592,7 @@ const ::_pbi::TcParseTable<3, 8, 7, 53, 2> arr_in_arr_cfg::_table_ = { // repeated .arr_in_arr arr = 2; {PROTOBUF_FIELD_OFFSET(arr_in_arr_cfg, _impl_.arr_), -1, 0, (0 | ::_fl::kFcRepeated | ::_fl::kMessage | ::_fl::kTvTable)}, - // repeated int32 test_plain_int_arr = 3; + // repeated int32 test_plain_int_arr = 3 [(.org.xresloader.field_list_min_size) = "1", (.org.xresloader.field_list_max_size) = "3"]; {PROTOBUF_FIELD_OFFSET(arr_in_arr_cfg, _impl_.test_plain_int_arr_), -1, 0, (0 | ::_fl::kFcRepeated | ::_fl::kInt32)}, // repeated .cost_type test_plain_enum_arr = 4; @@ -2680,7 +2681,7 @@ ::uint8_t* arr_in_arr_cfg::_InternalSerialize( target, stream); } - // repeated int32 test_plain_int_arr = 3; + // repeated int32 test_plain_int_arr = 3 [(.org.xresloader.field_list_min_size) = "1", (.org.xresloader.field_list_max_size) = "3"]; for (int i = 0, n = this->_internal_test_plain_int_arr_size(); i < n; ++i) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteInt32ToArray( @@ -2789,7 +2790,7 @@ ::size_t arr_in_arr_cfg::ByteSizeLong() const { for (const auto& msg : this->_internal_arr()) { total_size += ::google::protobuf::internal::WireFormatLite::MessageSize(msg); } - // repeated int32 test_plain_int_arr = 3; + // repeated int32 test_plain_int_arr = 3 [(.org.xresloader.field_list_min_size) = "1", (.org.xresloader.field_list_max_size) = "3"]; { std::size_t data_size = ::_pbi::WireFormatLite::Int32Size( this->_internal_test_plain_int_arr()) diff --git a/sample/cxx/v2/kind.pb.h b/sample/cxx/v2/kind.pb.h index cbef9f50..e49c30fe 100755 --- a/sample/cxx/v2/kind.pb.h +++ b/sample/cxx/v2/kind.pb.h @@ -1398,7 +1398,7 @@ class arr_in_arr final : public ::google::protobuf::Message kStrArrFieldNumber = 3, kNameFieldNumber = 1, }; - // repeated int32 int_arr = 2 [packed = true, (.org.xresloader.field_list_strip_option) = LIST_STRIP_NOTHING, (.org.xresloader.field_list_min_size) = 1, (.org.xresloader.field_list_max_size) = 3]; + // repeated int32 int_arr = 2 [packed = true, (.org.xresloader.field_list_strip_option) = LIST_STRIP_NOTHING, (.org.xresloader.field_list_min_size) = "game_const_config.EN_GCC_UNKNOWN", (.org.xresloader.field_list_max_size) = "3"]; int int_arr_size() const; private: int _internal_int_arr_size() const; @@ -3318,7 +3318,7 @@ class arr_in_arr_cfg final : public ::google::protobuf::Message const ::arr_in_arr& arr(int index) const; ::arr_in_arr* add_arr(); const ::google::protobuf::RepeatedPtrField<::arr_in_arr>& arr() const; - // repeated int32 test_plain_int_arr = 3; + // repeated int32 test_plain_int_arr = 3 [(.org.xresloader.field_list_min_size) = "1", (.org.xresloader.field_list_max_size) = "3"]; int test_plain_int_arr_size() const; private: int _internal_test_plain_int_arr_size() const; @@ -4911,7 +4911,7 @@ inline void arr_in_arr::set_allocated_name(std::string* value) { // @@protoc_insertion_point(field_set_allocated:arr_in_arr.name) } -// repeated int32 int_arr = 2 [packed = true, (.org.xresloader.field_list_strip_option) = LIST_STRIP_NOTHING, (.org.xresloader.field_list_min_size) = 1, (.org.xresloader.field_list_max_size) = 3]; +// repeated int32 int_arr = 2 [packed = true, (.org.xresloader.field_list_strip_option) = LIST_STRIP_NOTHING, (.org.xresloader.field_list_min_size) = "game_const_config.EN_GCC_UNKNOWN", (.org.xresloader.field_list_max_size) = "3"]; inline int arr_in_arr::_internal_int_arr_size() const { return _internal_int_arr().size(); } @@ -5143,7 +5143,7 @@ arr_in_arr_cfg::_internal_mutable_arr() { return &_impl_.arr_; } -// repeated int32 test_plain_int_arr = 3; +// repeated int32 test_plain_int_arr = 3 [(.org.xresloader.field_list_min_size) = "1", (.org.xresloader.field_list_max_size) = "3"]; inline int arr_in_arr_cfg::_internal_test_plain_int_arr_size() const { return _internal_test_plain_int_arr().size(); } diff --git a/sample/cxx/v3/kind.pb.cc b/sample/cxx/v3/kind.pb.cc index 010bd094..1d3f013c 100755 --- a/sample/cxx/v3/kind.pb.cc +++ b/sample/cxx/v3/kind.pb.cc @@ -791,81 +791,82 @@ const char descriptor_table_protodef_kind_2eproto[] ABSL_ATTRIBUTE_SECTION_VARIA "\001(\rB\003\350D\001\0226\n\010CostType\030\003 \001(\005B$\312>\014custom_ru" "le1\232\?\022Refer to cost_type\022\021\n\tCostValue\030\004 " "\001(\003\022\020\n\010ScoreAdd\030\005 \001(\005:1\312>%Test role_upgr" - "ade_cfg with multi keys\352D\006helper\"\312\004\n\narr" + "ade_cfg with multi keys\352D\006helper\"\353\004\n\narr" "_in_arr\022-\n\004name\030\001 \001(\tB\037\232\?\034This is a test" - " name in array\022\032\n\007int_arr\030\002 \003(\005B\t\320\?\001\330\?\001\340" - "\?\003\022\017\n\007str_arr\030\003 \003(\t\022#\n\016test_info_role\030\013 " - "\001(\0132\t.role_cfgH\000\0222\n\025test_role_upgrade_cf" - "g\030\014 \001(\0132\021.role_upgrade_cfgH\000\032\373\001\n\023test_ne" - "sted_message\0222\n\035test_nested_message_info" - "_role\030\013 \001(\0132\t.role_cfgH\000\022A\n$test_nested_" - "message_role_upgrade_cfg\030\014 \001(\0132\021.role_up" - "grade_cfgH\000\"`\n\020test_nested_enum\022%\n!EN_TE" - "ST_NESTED_MESSAGE_ENUM_VAL_1\020\000\022%\n!EN_TES" - "T_NESTED_MESSAGE_ENUM_VAL_2\020{B\013\n\ttest_on" - "of\"P\n\020test_nested_enum\022\035\n\031EN_TEST_NESTED" - "_ENUM_VAL_1\020\000\022\035\n\031EN_TEST_NESTED_ENUM_VAL" - "_2\020{:*\352D\006helper\360D\001\202E\033Engine/CompositeDat" - "aTable.hB\013\n\ttest_onof\"o\n\021test_msg_verifi" - "er\022\022\n\ttest_id_1\030\221N \001(\r\022&\n\ttest_id_2\030\222N \001" - "(\rB\022\242\?\017\346\265\213\350\257\225ID\345\210\253\345\220\2152\022\027\n\ttest_id_3\030\223N \001" - "(\rB\003\310\?\001:\005\242\?\002-^\"\372\003\n\016arr_in_arr_cfg\022\037\n\002id\030" - "\001 \001(\rB\023\232\?\rThis is a Key\350D\001\022\030\n\003arr\030\002 \003(\0132" - "\013.arr_in_arr\022\"\n\022test_plain_int_arr\030\003 \003(\005" - "B\006\330\?\001\340\?\003\022\'\n\023test_plain_enum_arr\030\004 \003(\0162\n." - "cost_type\0220\n\016test_plain_msg\030\005 \001(\0132\022.test" - "_msg_verifierB\004\262\?\001&\022.\n\022test_plain_msg_ar" - "r\030\006 \003(\0132\022.test_msg_verifier\0223\n\013test_map_" - "is\030\007 \003(\0132\036.arr_in_arr_cfg.TestMapIsEntry" - "\0229\n\013test_map_sm\030\010 \003(\0132\036.arr_in_arr_cfg.T" - "estMapSmEntryB\004\262\?\001|\0320\n\016TestMapIsEntry\022\013\n" - "\003key\030\001 \001(\005\022\r\n\005value\030\002 \001(\t:\0028\001\032;\n\016TestMap" - "SmEntry\022\013\n\003key\030\001 \001(\t\022\030\n\005value\030\002 \001(\0132\t.de" - "p2_cfg:\0028\001:\037\312>\023Test arr_in_arr_cfg\352D\006hel" - "per\"\243\001\n\021event_reward_item\022\017\n\007item_id\030\001 \001" - "(\r\022\022\n\nitem_count\030\002 \001(\r\022&\n\013nested_note\030\013 " - "\001(\tB\017\242\?\014\346\217\217\350\277\260\346\226\207\346\234\254H\000\0227\n\020nested_enum_ty" - "pe\030\014 \001(\0162\n.cost_typeB\017\242\?\014\350\264\247\345\270\201\347\261\273\345\236\213H\000B" - "\010\n\006nested\"\241\001\n\017event_rule_item\022\017\n\007rule_id" - "\030\001 \001(\r\022\022\n\nrule_param\030\002 \001(\r\022&\n\013nested_not" - "e\030\013 \001(\tB\017\242\?\014\346\217\217\350\277\260\346\226\207\346\234\254H\000\0227\n\020nested_enu" - "m_type\030\014 \001(\0162\n.cost_typeB\017\242\?\014\350\264\247\345\270\201\347\261\273\345\236" - "\213H\000B\010\n\006nested\"\244\004\n\tevent_cfg\022.\n\002id\030\001 \001(\rB" - "\"\312>\014custom_rule4\322>\nunique_tag\330>\001\350Dd\022$\n\007p" - "rocess\030\002 \001(\rB\023\322>\nunique_tag\330>\001\350D\001\022\036\n\004rul" - "e\030\006 \001(\0132\020.event_rule_item\022\'\n\rspecify_fie" - "ld\030\007 \001(\0132\020.event_rule_item\0223\n\004item\030\013 \001(\013" - "2\022.event_reward_itemB\017\242\?\014\345\245\226\345\212\261\351\201\223\345\205\267H\000\022" - "#\n\010user_exp\030\014 \001(\003B\017\242\?\014\345\245\226\345\212\261\347\273\217\351\252\214H\000\022\037\n\004" - "note\030\r \001(\tB\017\242\?\014\346\217\217\350\277\260\346\226\207\346\234\254H\000\0220\n\tenum_ty" - "pe\030\016 \001(\0162\n.cost_typeB\017\242\?\014\350\264\247\345\270\201\347\261\273\345\236\213H\000\022" - "%\n\nuser_level\0303 \001(\rB\017\242\?\014\347\216\251\345\256\266\347\255\211\347\272\247H\001\022(" - "\n\010test_arr\030[ \003(\0132\020.event_rule_itemB\004\262\?\001;" - "\022.\n\016test_empty_arr\030\\ \003(\0132\020.event_rule_it" - "emB\004\262\?\001;:,\312> Test event_cfg with oneof f" - "ields\352D\006helperB\r\n\006reward\022\003\330>\001B\r\n\013unlock_" - "type\"\266\001\n\034keep_or_strip_empty_list_cfg\022\037\n" - "\002id\030\001 \001(\rB\023\232\?\rThis is a Key\350D\001\022\034\n\tarray_" - "msg\030\002 \003(\0132\t.dep2_cfg\022\"\n\017array_plain_msg\030" - "\003 \003(\0132\t.dep2_cfg\022\023\n\013array_int32\030\004 \003(\005\022\023\n" - "\013array_int64\030\005 \003(\003:\t\352D\006helper\"4\n\ncombine" - "_id\022\016\n\006prefix\030\001 \001(\r\022\026\n\002id\030\002 \001(\rB\n\312>\0070-99" - "999\"\333\003\n\021process_by_script\022\n\n\002id\030\001 \001(\r\022<\n" - "\016map_u32_string\030\002 \003(\0132$.process_by_scrip" - "t.MapU32StringEntry\022\033\n\023human_readable_da" - "te\030\003 \001(\t\022(\n\004date\030\004 \001(\0132\032.google.protobuf" - ".Timestamp\0226\n\013test_map_is\030\007 \003(\0132!.proces" - "s_by_script.TestMapIsEntry\022<\n\013test_map_s" - "m\030\010 \003(\0132!.process_by_script.TestMapSmEnt" - "ryB\004\262\?\001|\022\033\n\005id_id\030\351\007 \001(\0132\013.combine_id\0323\n" - "\021MapU32StringEntry\022\013\n\003key\030\001 \001(\r\022\r\n\005value" - "\030\002 \001(\t:\0028\001\0320\n\016TestMapIsEntry\022\013\n\003key\030\001 \001(" - "\005\022\r\n\005value\030\002 \001(\t:\0028\001\032;\n\016TestMapSmEntry\022\013" - "\n\003key\030\001 \001(\t\022\030\n\005value\030\002 \001(\0132\t.dep2_cfg:\0028" - "\001\"\222\001\n\017large_file_test\022\n\n\002id\030\001 \001(\r\022\020\n\010i32" - "value\030\002 \001(\005\022\020\n\010u64value\030\003 \001(\004\022\020\n\010f64valu" - "e\030\004 \001(\001\022\020\n\010f32value\030\005 \001(\002\022\017\n\007szvalue\030\006 \001" - "(\t\022\032\n\005id_id\030\007 \001(\0132\013.combine_idb\006proto3" + " name in array\022;\n\007int_arr\030\002 \003(\005B*\320\?\001\332\? g" + "ame_const_config.EN_GCC_UNKNOWN\342\?\0013\022\017\n\007s" + "tr_arr\030\003 \003(\t\022#\n\016test_info_role\030\013 \001(\0132\t.r" + "ole_cfgH\000\0222\n\025test_role_upgrade_cfg\030\014 \001(\013" + "2\021.role_upgrade_cfgH\000\032\373\001\n\023test_nested_me" + "ssage\0222\n\035test_nested_message_info_role\030\013" + " \001(\0132\t.role_cfgH\000\022A\n$test_nested_message" + "_role_upgrade_cfg\030\014 \001(\0132\021.role_upgrade_c" + "fgH\000\"`\n\020test_nested_enum\022%\n!EN_TEST_NEST" + "ED_MESSAGE_ENUM_VAL_1\020\000\022%\n!EN_TEST_NESTE" + "D_MESSAGE_ENUM_VAL_2\020{B\013\n\ttest_onof\"P\n\020t" + "est_nested_enum\022\035\n\031EN_TEST_NESTED_ENUM_V" + "AL_1\020\000\022\035\n\031EN_TEST_NESTED_ENUM_VAL_2\020{:*\352" + "D\006helper\360D\001\202E\033Engine/CompositeDataTable." + "hB\013\n\ttest_onof\"o\n\021test_msg_verifier\022\022\n\tt" + "est_id_1\030\221N \001(\r\022&\n\ttest_id_2\030\222N \001(\rB\022\242\?\017" + "\346\265\213\350\257\225ID\345\210\253\345\220\2152\022\027\n\ttest_id_3\030\223N \001(\rB\003\310\?\001" + ":\005\242\?\002-^\"\374\003\n\016arr_in_arr_cfg\022\037\n\002id\030\001 \001(\rB\023" + "\232\?\rThis is a Key\350D\001\022\030\n\003arr\030\002 \003(\0132\013.arr_i" + "n_arr\022$\n\022test_plain_int_arr\030\003 \003(\005B\010\332\?\0011\342" + "\?\0013\022\'\n\023test_plain_enum_arr\030\004 \003(\0162\n.cost_" + "type\0220\n\016test_plain_msg\030\005 \001(\0132\022.test_msg_" + "verifierB\004\262\?\001&\022.\n\022test_plain_msg_arr\030\006 \003" + "(\0132\022.test_msg_verifier\0223\n\013test_map_is\030\007 " + "\003(\0132\036.arr_in_arr_cfg.TestMapIsEntry\0229\n\013t" + "est_map_sm\030\010 \003(\0132\036.arr_in_arr_cfg.TestMa" + "pSmEntryB\004\262\?\001|\0320\n\016TestMapIsEntry\022\013\n\003key\030" + "\001 \001(\005\022\r\n\005value\030\002 \001(\t:\0028\001\032;\n\016TestMapSmEnt" + "ry\022\013\n\003key\030\001 \001(\t\022\030\n\005value\030\002 \001(\0132\t.dep2_cf" + "g:\0028\001:\037\312>\023Test arr_in_arr_cfg\352D\006helper\"\243" + "\001\n\021event_reward_item\022\017\n\007item_id\030\001 \001(\r\022\022\n" + "\nitem_count\030\002 \001(\r\022&\n\013nested_note\030\013 \001(\tB\017" + "\242\?\014\346\217\217\350\277\260\346\226\207\346\234\254H\000\0227\n\020nested_enum_type\030\014 " + "\001(\0162\n.cost_typeB\017\242\?\014\350\264\247\345\270\201\347\261\273\345\236\213H\000B\010\n\006ne" + "sted\"\241\001\n\017event_rule_item\022\017\n\007rule_id\030\001 \001(" + "\r\022\022\n\nrule_param\030\002 \001(\r\022&\n\013nested_note\030\013 \001" + "(\tB\017\242\?\014\346\217\217\350\277\260\346\226\207\346\234\254H\000\0227\n\020nested_enum_typ" + "e\030\014 \001(\0162\n.cost_typeB\017\242\?\014\350\264\247\345\270\201\347\261\273\345\236\213H\000B\010" + "\n\006nested\"\244\004\n\tevent_cfg\022.\n\002id\030\001 \001(\rB\"\312>\014c" + "ustom_rule4\322>\nunique_tag\330>\001\350Dd\022$\n\007proces" + "s\030\002 \001(\rB\023\322>\nunique_tag\330>\001\350D\001\022\036\n\004rule\030\006 \001" + "(\0132\020.event_rule_item\022\'\n\rspecify_field\030\007 " + "\001(\0132\020.event_rule_item\0223\n\004item\030\013 \001(\0132\022.ev" + "ent_reward_itemB\017\242\?\014\345\245\226\345\212\261\351\201\223\345\205\267H\000\022#\n\010us" + "er_exp\030\014 \001(\003B\017\242\?\014\345\245\226\345\212\261\347\273\217\351\252\214H\000\022\037\n\004note\030" + "\r \001(\tB\017\242\?\014\346\217\217\350\277\260\346\226\207\346\234\254H\000\0220\n\tenum_type\030\016 " + "\001(\0162\n.cost_typeB\017\242\?\014\350\264\247\345\270\201\347\261\273\345\236\213H\000\022%\n\nus" + "er_level\0303 \001(\rB\017\242\?\014\347\216\251\345\256\266\347\255\211\347\272\247H\001\022(\n\010tes" + "t_arr\030[ \003(\0132\020.event_rule_itemB\004\262\?\001;\022.\n\016t" + "est_empty_arr\030\\ \003(\0132\020.event_rule_itemB\004\262" + "\?\001;:,\312> Test event_cfg with oneof fields" + "\352D\006helperB\r\n\006reward\022\003\330>\001B\r\n\013unlock_type\"" + "\266\001\n\034keep_or_strip_empty_list_cfg\022\037\n\002id\030\001" + " \001(\rB\023\232\?\rThis is a Key\350D\001\022\034\n\tarray_msg\030\002" + " \003(\0132\t.dep2_cfg\022\"\n\017array_plain_msg\030\003 \003(\013" + "2\t.dep2_cfg\022\023\n\013array_int32\030\004 \003(\005\022\023\n\013arra" + "y_int64\030\005 \003(\003:\t\352D\006helper\"4\n\ncombine_id\022\016" + "\n\006prefix\030\001 \001(\r\022\026\n\002id\030\002 \001(\rB\n\312>\0070-99999\"\333" + "\003\n\021process_by_script\022\n\n\002id\030\001 \001(\r\022<\n\016map_" + "u32_string\030\002 \003(\0132$.process_by_script.Map" + "U32StringEntry\022\033\n\023human_readable_date\030\003 " + "\001(\t\022(\n\004date\030\004 \001(\0132\032.google.protobuf.Time" + "stamp\0226\n\013test_map_is\030\007 \003(\0132!.process_by_" + "script.TestMapIsEntry\022<\n\013test_map_sm\030\010 \003" + "(\0132!.process_by_script.TestMapSmEntryB\004\262" + "\?\001|\022\033\n\005id_id\030\351\007 \001(\0132\013.combine_id\0323\n\021MapU" + "32StringEntry\022\013\n\003key\030\001 \001(\r\022\r\n\005value\030\002 \001(" + "\t:\0028\001\0320\n\016TestMapIsEntry\022\013\n\003key\030\001 \001(\005\022\r\n\005" + "value\030\002 \001(\t:\0028\001\032;\n\016TestMapSmEntry\022\013\n\003key" + "\030\001 \001(\t\022\030\n\005value\030\002 \001(\0132\t.dep2_cfg:\0028\001\"\222\001\n" + "\017large_file_test\022\n\n\002id\030\001 \001(\r\022\020\n\010i32value" + "\030\002 \001(\005\022\020\n\010u64value\030\003 \001(\004\022\020\n\010f64value\030\004 \001" + "(\001\022\020\n\010f32value\030\005 \001(\002\022\017\n\007szvalue\030\006 \001(\t\022\032\n" + "\005id_id\030\007 \001(\0132\013.combine_idb\006proto3" }; static const ::_pbi::DescriptorTable* const descriptor_table_kind_2eproto_deps[6] = { @@ -880,7 +881,7 @@ static ::absl::once_flag descriptor_table_kind_2eproto_once; PROTOBUF_CONSTINIT const ::_pbi::DescriptorTable descriptor_table_kind_2eproto = { false, false, - 3998, + 4033, descriptor_table_protodef_kind_2eproto, "kind.proto", &descriptor_table_kind_2eproto_once, @@ -2418,7 +2419,7 @@ const ::_pbi::TcParseTable<2, 5, 2, 30, 2> arr_in_arr::_table_ = { // string name = 1 [(.org.xresloader.field_description) = "This is a test name in array"]; {::_pbi::TcParser::FastUS1, {10, 63, 0, PROTOBUF_FIELD_OFFSET(arr_in_arr, _impl_.name_)}}, - // repeated int32 int_arr = 2 [(.org.xresloader.field_list_strip_option) = LIST_STRIP_NOTHING, (.org.xresloader.field_list_min_size) = 1, (.org.xresloader.field_list_max_size) = 3]; + // repeated int32 int_arr = 2 [(.org.xresloader.field_list_strip_option) = LIST_STRIP_NOTHING, (.org.xresloader.field_list_min_size) = "game_const_config.EN_GCC_UNKNOWN", (.org.xresloader.field_list_max_size) = "3"]; {::_pbi::TcParser::FastV32P1, {18, 63, 0, PROTOBUF_FIELD_OFFSET(arr_in_arr, _impl_.int_arr_)}}, // repeated string str_arr = 3; @@ -2430,7 +2431,7 @@ const ::_pbi::TcParseTable<2, 5, 2, 30, 2> arr_in_arr::_table_ = { // string name = 1 [(.org.xresloader.field_description) = "This is a test name in array"]; {PROTOBUF_FIELD_OFFSET(arr_in_arr, _impl_.name_), 0, 0, (0 | ::_fl::kFcSingular | ::_fl::kUtf8String | ::_fl::kRepAString)}, - // repeated int32 int_arr = 2 [(.org.xresloader.field_list_strip_option) = LIST_STRIP_NOTHING, (.org.xresloader.field_list_min_size) = 1, (.org.xresloader.field_list_max_size) = 3]; + // repeated int32 int_arr = 2 [(.org.xresloader.field_list_strip_option) = LIST_STRIP_NOTHING, (.org.xresloader.field_list_min_size) = "game_const_config.EN_GCC_UNKNOWN", (.org.xresloader.field_list_max_size) = "3"]; {PROTOBUF_FIELD_OFFSET(arr_in_arr, _impl_.int_arr_), 0, 0, (0 | ::_fl::kFcRepeated | ::_fl::kPackedInt32)}, // repeated string str_arr = 3; @@ -2482,7 +2483,7 @@ ::uint8_t* arr_in_arr::_InternalSerialize( target = stream->WriteStringMaybeAliased(1, _s, target); } - // repeated int32 int_arr = 2 [(.org.xresloader.field_list_strip_option) = LIST_STRIP_NOTHING, (.org.xresloader.field_list_min_size) = 1, (.org.xresloader.field_list_max_size) = 3]; + // repeated int32 int_arr = 2 [(.org.xresloader.field_list_strip_option) = LIST_STRIP_NOTHING, (.org.xresloader.field_list_min_size) = "game_const_config.EN_GCC_UNKNOWN", (.org.xresloader.field_list_max_size) = "3"]; { int byte_size = _impl_._int_arr_cached_byte_size_.Get(); if (byte_size > 0) { @@ -2531,7 +2532,7 @@ ::size_t arr_in_arr::ByteSizeLong() const { (void) cached_has_bits; ::_pbi::Prefetch5LinesFrom7Lines(reinterpret_cast(this)); - // repeated int32 int_arr = 2 [(.org.xresloader.field_list_strip_option) = LIST_STRIP_NOTHING, (.org.xresloader.field_list_min_size) = 1, (.org.xresloader.field_list_max_size) = 3]; + // repeated int32 int_arr = 2 [(.org.xresloader.field_list_strip_option) = LIST_STRIP_NOTHING, (.org.xresloader.field_list_min_size) = "game_const_config.EN_GCC_UNKNOWN", (.org.xresloader.field_list_max_size) = "3"]; { std::size_t data_size = ::_pbi::WireFormatLite::Int32Size( this->_internal_int_arr()) @@ -3050,7 +3051,7 @@ const ::_pbi::TcParseTable<3, 8, 6, 53, 2> arr_in_arr_cfg::_table_ = { // repeated .arr_in_arr arr = 2; {::_pbi::TcParser::FastMtR1, {18, 63, 0, PROTOBUF_FIELD_OFFSET(arr_in_arr_cfg, _impl_.arr_)}}, - // repeated int32 test_plain_int_arr = 3 [(.org.xresloader.field_list_min_size) = 1, (.org.xresloader.field_list_max_size) = 3]; + // repeated int32 test_plain_int_arr = 3 [(.org.xresloader.field_list_min_size) = "1", (.org.xresloader.field_list_max_size) = "3"]; {::_pbi::TcParser::FastV32P1, {26, 63, 0, PROTOBUF_FIELD_OFFSET(arr_in_arr_cfg, _impl_.test_plain_int_arr_)}}, // repeated .cost_type test_plain_enum_arr = 4; @@ -3072,7 +3073,7 @@ const ::_pbi::TcParseTable<3, 8, 6, 53, 2> arr_in_arr_cfg::_table_ = { // repeated .arr_in_arr arr = 2; {PROTOBUF_FIELD_OFFSET(arr_in_arr_cfg, _impl_.arr_), -1, 0, (0 | ::_fl::kFcRepeated | ::_fl::kMessage | ::_fl::kTvTable)}, - // repeated int32 test_plain_int_arr = 3 [(.org.xresloader.field_list_min_size) = 1, (.org.xresloader.field_list_max_size) = 3]; + // repeated int32 test_plain_int_arr = 3 [(.org.xresloader.field_list_min_size) = "1", (.org.xresloader.field_list_max_size) = "3"]; {PROTOBUF_FIELD_OFFSET(arr_in_arr_cfg, _impl_.test_plain_int_arr_), -1, 0, (0 | ::_fl::kFcRepeated | ::_fl::kPackedInt32)}, // repeated .cost_type test_plain_enum_arr = 4; @@ -3159,7 +3160,7 @@ ::uint8_t* arr_in_arr_cfg::_InternalSerialize( target, stream); } - // repeated int32 test_plain_int_arr = 3 [(.org.xresloader.field_list_min_size) = 1, (.org.xresloader.field_list_max_size) = 3]; + // repeated int32 test_plain_int_arr = 3 [(.org.xresloader.field_list_min_size) = "1", (.org.xresloader.field_list_max_size) = "3"]; { int byte_size = _impl_._test_plain_int_arr_cached_byte_size_.Get(); if (byte_size > 0) { @@ -3272,7 +3273,7 @@ ::size_t arr_in_arr_cfg::ByteSizeLong() const { for (const auto& msg : this->_internal_arr()) { total_size += ::google::protobuf::internal::WireFormatLite::MessageSize(msg); } - // repeated int32 test_plain_int_arr = 3 [(.org.xresloader.field_list_min_size) = 1, (.org.xresloader.field_list_max_size) = 3]; + // repeated int32 test_plain_int_arr = 3 [(.org.xresloader.field_list_min_size) = "1", (.org.xresloader.field_list_max_size) = "3"]; { std::size_t data_size = ::_pbi::WireFormatLite::Int32Size( this->_internal_test_plain_int_arr()) diff --git a/sample/cxx/v3/kind.pb.h b/sample/cxx/v3/kind.pb.h index 0b623878..690ad7de 100755 --- a/sample/cxx/v3/kind.pb.h +++ b/sample/cxx/v3/kind.pb.h @@ -3387,7 +3387,7 @@ class arr_in_arr final : public ::google::protobuf::Message kTestInfoRoleFieldNumber = 11, kTestRoleUpgradeCfgFieldNumber = 12, }; - // repeated int32 int_arr = 2 [(.org.xresloader.field_list_strip_option) = LIST_STRIP_NOTHING, (.org.xresloader.field_list_min_size) = 1, (.org.xresloader.field_list_max_size) = 3]; + // repeated int32 int_arr = 2 [(.org.xresloader.field_list_strip_option) = LIST_STRIP_NOTHING, (.org.xresloader.field_list_min_size) = "game_const_config.EN_GCC_UNKNOWN", (.org.xresloader.field_list_max_size) = "3"]; int int_arr_size() const; private: int _internal_int_arr_size() const; @@ -3688,7 +3688,7 @@ class arr_in_arr_cfg final : public ::google::protobuf::Message const ::arr_in_arr& arr(int index) const; ::arr_in_arr* add_arr(); const ::google::protobuf::RepeatedPtrField<::arr_in_arr>& arr() const; - // repeated int32 test_plain_int_arr = 3 [(.org.xresloader.field_list_min_size) = 1, (.org.xresloader.field_list_max_size) = 3]; + // repeated int32 test_plain_int_arr = 3 [(.org.xresloader.field_list_min_size) = "1", (.org.xresloader.field_list_max_size) = "3"]; int test_plain_int_arr_size() const; private: int _internal_test_plain_int_arr_size() const; @@ -5204,7 +5204,7 @@ inline void arr_in_arr::set_allocated_name(std::string* value) { // @@protoc_insertion_point(field_set_allocated:arr_in_arr.name) } -// repeated int32 int_arr = 2 [(.org.xresloader.field_list_strip_option) = LIST_STRIP_NOTHING, (.org.xresloader.field_list_min_size) = 1, (.org.xresloader.field_list_max_size) = 3]; +// repeated int32 int_arr = 2 [(.org.xresloader.field_list_strip_option) = LIST_STRIP_NOTHING, (.org.xresloader.field_list_min_size) = "game_const_config.EN_GCC_UNKNOWN", (.org.xresloader.field_list_max_size) = "3"]; inline int arr_in_arr::_internal_int_arr_size() const { return _internal_int_arr().size(); } @@ -5667,7 +5667,7 @@ arr_in_arr_cfg::_internal_mutable_arr() { return &_impl_.arr_; } -// repeated int32 test_plain_int_arr = 3 [(.org.xresloader.field_list_min_size) = 1, (.org.xresloader.field_list_max_size) = 3]; +// repeated int32 test_plain_int_arr = 3 [(.org.xresloader.field_list_min_size) = "1", (.org.xresloader.field_list_max_size) = "3"]; inline int arr_in_arr_cfg::_internal_test_plain_int_arr_size() const { return _internal_test_plain_int_arr().size(); } diff --git a/sample/proto_v2/dependency.proto b/sample/proto_v2/dependency.proto index 6bee1640..6e472199 100755 --- a/sample/proto_v2/dependency.proto +++ b/sample/proto_v2/dependency.proto @@ -5,31 +5,32 @@ import "xresloader.proto"; import "dep_level2.proto"; message dep_cfg { - optional uint32 id = 1; - optional string name = 2; - optional dep2_cfg dep2 = 3; + optional uint32 id = 1; + optional string name = 2; + optional dep2_cfg dep2 = 3; } // 常量类型 enum game_const_config { - option allow_alias = true; + option allow_alias = true; - EN_GCC_PERCENT_BASE = 10000; - EN_GCC_RANDOM_RANGE_UNIT = 10; - EN_GCC_RESOURCE_MAX_LIMIT = 9999999; - EN_GCC_LEVEL_LIMIT = 999; - EN_GCC_SOLDIER_TYPE_MASK = 100; - EN_GCC_ACTIVITY_TYPE_MASK = 1000; - EN_GCC_FORMULAR_TYPE_MASK = 10; + EN_GCC_UNKNOWN = 0; + EN_GCC_PERCENT_BASE = 10000; + EN_GCC_RANDOM_RANGE_UNIT = 10; + EN_GCC_RESOURCE_MAX_LIMIT = 9999999; + EN_GCC_LEVEL_LIMIT = 999; + EN_GCC_SOLDIER_TYPE_MASK = 100; + EN_GCC_ACTIVITY_TYPE_MASK = 1000; + EN_GCC_FORMULAR_TYPE_MASK = 10; - EN_GCC_SCREEN_WIDTH = 1136; - EN_GCC_SCREEN_HEIGHT = 640; - EN_GCC_CAMERA_OFFSET = 268; + EN_GCC_SCREEN_WIDTH = 1136; + EN_GCC_SCREEN_HEIGHT = 640; + EN_GCC_CAMERA_OFFSET = 268; } // 常量类型 enum cost_type { - EN_CT_UNKNOWN = 0; - EN_CT_MONEY = 10001 [(org.xresloader.enum_alias) = "金币"]; - EN_CT_DIAMOND = 10101 [(org.xresloader.enum_alias) = "钻石"]; + EN_CT_UNKNOWN = 0; + EN_CT_MONEY = 10001 [ (org.xresloader.enum_alias) = "金币" ]; + EN_CT_DIAMOND = 10101 [ (org.xresloader.enum_alias) = "钻石" ]; } diff --git a/sample/proto_v2/json/KindConst.json b/sample/proto_v2/json/KindConst.json index 0c62f3e5..32c7039e 100644 --- a/sample/proto_v2/json/KindConst.json +++ b/sample/proto_v2/json/KindConst.json @@ -86,5 +86,9 @@ { "Name": "game_const_config.EN_GCC_SOLDIER_TYPE_MASK", "Value": 100 + }, + { + "Name": "game_const_config.EN_GCC_UNKNOWN", + "Value": 0 } ] \ No newline at end of file diff --git a/sample/proto_v2/kind.desc.json b/sample/proto_v2/kind.desc.json index c167933f..0e430d32 100644 --- a/sample/proto_v2/kind.desc.json +++ b/sample/proto_v2/kind.desc.json @@ -83,6 +83,10 @@ "EN_GCC_SOLDIER_TYPE_MASK": { "name": "EN_GCC_SOLDIER_TYPE_MASK", "number": 100 + }, + "EN_GCC_UNKNOWN": { + "name": "EN_GCC_UNKNOWN", + "number": 0 } } } @@ -119,8 +123,8 @@ "name": "int_arr", "number": 2, "options": { - "field_list_max_size": 3, - "field_list_min_size": 1, + "field_list_max_size": "3", + "field_list_min_size": "game_const_config.EN_GCC_UNKNOWN", "field_list_strip_option": { "name": "LIST_STRIP_NOTHING", "number": 1 @@ -216,6 +220,10 @@ "test_plain_int_arr": { "name": "test_plain_int_arr", "number": 3, + "options": { + "field_list_max_size": "3", + "field_list_min_size": "1" + }, "type_name": "INT32" }, "test_plain_msg": { diff --git a/sample/proto_v2/kind.desc.lua b/sample/proto_v2/kind.desc.lua index 7386a116..6ac72510 100644 --- a/sample/proto_v2/kind.desc.lua +++ b/sample/proto_v2/kind.desc.lua @@ -46,8 +46,8 @@ local const_res = { name = "int_arr", number = 2, options = { - field_list_max_size = 3, - field_list_min_size = 1, + field_list_max_size = "3", + field_list_min_size = "game_const_config.EN_GCC_UNKNOWN", field_list_strip_option = { name = "LIST_STRIP_NOTHING", number = 1, @@ -104,6 +104,15 @@ local const_res = { }, type_name = "MESSAGE", }, + test_plain_int_arr = { + name = "test_plain_int_arr", + number = 3, + options = { + field_list_max_size = "3", + field_list_min_size = "1", + }, + type_name = "INT32", + }, test_plain_msg = { name = "test_plain_msg", number = 5, diff --git a/sample/proto_v2/kind.pb b/sample/proto_v2/kind.pb index 2dfc0209f1315c640d067b61914bacc3771cdd92..b9cb8549dafcdd63cda0854021d614ac3a130291 100755 GIT binary patch delta 149 zcmdn5_D^ksJL9^E9&L=LC!QA-7UJS_^^13Rc8(AA^Y-%(_Y+{)__&dgsYPjX8q+~m z#`TjmIGpWVx!5!FO5ziXiX@m6m^E0PbOabL*fZX;S4dCHO^r{^&nqqgk!hLfdZ@-d mvS&1&+`(bM_;vD5jxa{k$pV~GTuvOf>=_L~Qk%6nMY#Yh%r1if delta 107 zcmeyTwqI?6JL9a09&L=89f5DyD<1jD3@BIGklwxY#rEO5ziXiX@m6 zm^E0PxCIz5*fZX+XMAAKJb5pN0psh*?>NGwwYh{!Qj1IC3vv=O^WtGzm_b@LXL5>i F0RZwlBLn~d diff --git a/sample/proto_v2/kind.proto b/sample/proto_v2/kind.proto index e86dd918..93155bb9 100755 --- a/sample/proto_v2/kind.proto +++ b/sample/proto_v2/kind.proto @@ -55,7 +55,7 @@ message arr_in_arr { option (org.xresloader.ue.not_data_table) = true; optional string name = 1 [ (org.xresloader.field_description) = "This is a test name in array" ]; - repeated int32 int_arr = 2 [ packed = true, (org.xresloader.field_list_min_size) = 1, (org.xresloader.field_list_max_size) = 3, (org.xresloader.field_list_strip_option) = LIST_STRIP_NOTHING ]; + repeated int32 int_arr = 2 [ packed = true, (org.xresloader.field_list_min_size) = "game_const_config.EN_GCC_UNKNOWN", (org.xresloader.field_list_max_size) = "3", (org.xresloader.field_list_strip_option) = LIST_STRIP_NOTHING ]; repeated string str_arr = 3; } @@ -66,7 +66,7 @@ message arr_in_arr_cfg { optional uint32 id = 1 [ (org.xresloader.ue.key_tag) = 1, (org.xresloader.field_description) = "This is a Key" ]; repeated arr_in_arr arr = 2; - repeated int32 test_plain_int_arr = 3; + repeated int32 test_plain_int_arr = 3 [ (org.xresloader.field_list_min_size) = "1", (org.xresloader.field_list_max_size) = "3" ]; repeated cost_type test_plain_enum_arr = 4; optional test_msg_verifier test_plain_msg = 5 [ (org.xresloader.field_separator) = "&" ]; repeated test_msg_verifier test_plain_msg_arr = 6; diff --git a/sample/proto_v2/kind_const.lua b/sample/proto_v2/kind_const.lua index 21d709d1..1bb06a98 100755 --- a/sample/proto_v2/kind_const.lua +++ b/sample/proto_v2/kind_const.lua @@ -42,6 +42,7 @@ local const_res = { EN_GCC_SCREEN_HEIGHT = 640, EN_GCC_SCREEN_WIDTH = 1136, EN_GCC_SOLDIER_TYPE_MASK = 100, + EN_GCC_UNKNOWN = 0, }, process_by_script = { }, diff --git a/sample/proto_v2/kind_const_module.lua b/sample/proto_v2/kind_const_module.lua index 84af59ef..a8f813fa 100755 --- a/sample/proto_v2/kind_const_module.lua +++ b/sample/proto_v2/kind_const_module.lua @@ -43,6 +43,7 @@ local const_res = { EN_GCC_SCREEN_HEIGHT = 640, EN_GCC_SCREEN_WIDTH = 1136, EN_GCC_SOLDIER_TYPE_MASK = 100, + EN_GCC_UNKNOWN = 0, }, process_by_script = { }, diff --git a/sample/proto_v2/kind_option.js b/sample/proto_v2/kind_option.js index 3c1aaf1c..cfc0ca20 100644 --- a/sample/proto_v2/kind_option.js +++ b/sample/proto_v2/kind_option.js @@ -45,8 +45,8 @@ exports.files = [ name : "int_arr", number : 2, options : { - field_list_max_size : 3, - field_list_min_size : 1, + field_list_max_size : "3", + field_list_min_size : "game_const_config.EN_GCC_UNKNOWN", field_list_strip_option : { name : "LIST_STRIP_NOTHING", number : 1 @@ -103,6 +103,15 @@ exports.files = [ }, type_name : "MESSAGE" }, + test_plain_int_arr : { + name : "test_plain_int_arr", + number : 3, + options : { + field_list_max_size : "3", + field_list_min_size : "1" + }, + type_name : "INT32" + }, test_plain_msg : { name : "test_plain_msg", number : 5, diff --git a/sample/proto_v2/kind_option.lua b/sample/proto_v2/kind_option.lua index b32eb832..eb737f4d 100644 --- a/sample/proto_v2/kind_option.lua +++ b/sample/proto_v2/kind_option.lua @@ -46,8 +46,8 @@ local const_res = { name = "int_arr", number = 2, options = { - field_list_max_size = 3, - field_list_min_size = 1, + field_list_max_size = "3", + field_list_min_size = "game_const_config.EN_GCC_UNKNOWN", field_list_strip_option = { name = "LIST_STRIP_NOTHING", number = 1, @@ -104,6 +104,15 @@ local const_res = { }, type_name = "MESSAGE", }, + test_plain_int_arr = { + name = "test_plain_int_arr", + number = 3, + options = { + field_list_max_size = "3", + field_list_min_size = "1", + }, + type_name = "INT32", + }, test_plain_msg = { name = "test_plain_msg", number = 5, diff --git a/sample/proto_v2/kind_option.mod.lua b/sample/proto_v2/kind_option.mod.lua index 1e41a6eb..e384a8e1 100644 --- a/sample/proto_v2/kind_option.mod.lua +++ b/sample/proto_v2/kind_option.mod.lua @@ -47,8 +47,8 @@ local const_res = { name = "int_arr", number = 2, options = { - field_list_max_size = 3, - field_list_min_size = 1, + field_list_max_size = "3", + field_list_min_size = "game_const_config.EN_GCC_UNKNOWN", field_list_strip_option = { name = "LIST_STRIP_NOTHING", number = 1, @@ -105,6 +105,15 @@ local const_res = { }, type_name = "MESSAGE", }, + test_plain_int_arr = { + name = "test_plain_int_arr", + number = 3, + options = { + field_list_max_size = "3", + field_list_min_size = "1", + }, + type_name = "INT32", + }, test_plain_msg = { name = "test_plain_msg", number = 5, diff --git a/sample/proto_v3/kind.desc.json b/sample/proto_v3/kind.desc.json index 7c033fb5..77a01f72 100644 --- a/sample/proto_v3/kind.desc.json +++ b/sample/proto_v3/kind.desc.json @@ -152,8 +152,8 @@ "name": "int_arr", "number": 2, "options": { - "field_list_max_size": 3, - "field_list_min_size": 1, + "field_list_max_size": "3", + "field_list_min_size": "game_const_config.EN_GCC_UNKNOWN", "field_list_strip_option": { "name": "LIST_STRIP_NOTHING", "number": 1 @@ -274,8 +274,8 @@ "name": "test_plain_int_arr", "number": 3, "options": { - "field_list_max_size": 3, - "field_list_min_size": 1 + "field_list_max_size": "3", + "field_list_min_size": "1" }, "type_name": "INT32" }, diff --git a/sample/proto_v3/kind.desc.lua b/sample/proto_v3/kind.desc.lua index 153e452b..72dd4fc7 100644 --- a/sample/proto_v3/kind.desc.lua +++ b/sample/proto_v3/kind.desc.lua @@ -46,8 +46,8 @@ local const_res = { name = "int_arr", number = 2, options = { - field_list_max_size = 3, - field_list_min_size = 1, + field_list_max_size = "3", + field_list_min_size = "game_const_config.EN_GCC_UNKNOWN", field_list_strip_option = { name = "LIST_STRIP_NOTHING", number = 1, @@ -110,8 +110,8 @@ local const_res = { name = "test_plain_int_arr", number = 3, options = { - field_list_max_size = 3, - field_list_min_size = 1, + field_list_max_size = "3", + field_list_min_size = "1", }, type_name = "INT32", }, diff --git a/sample/proto_v3/kind.pb b/sample/proto_v3/kind.pb index eaf9e6ab5081f7eb227582a3d1b5f08496e86c37..3ff477073682ae097cbc0b0f0bc49d14e8018dcb 100755 GIT binary patch delta 136 zcmZqHS*Ek0gNbR5`sOYs6IRCillQYb+c=_Ng8rryPxd7smE3g0n delta 101 zcmZ3c)2y?hgNf;<+U71M6IRB3llQYbODl1)XXcf}Cl(b+Fexx=usU&GuxGqs&-lQe sd9xkIdnU%ull8d6l#RKBN>YnU;tO&TGxOqMI+(#a*r3W+a@TSJ0A> message_descs = new HashMap>(); public HashMap> enum_values_descs = new HashMap>(); + /*** 类型信息-快速整数别名集合 ***/ + public HashMap quick_integer_values_alias = new HashMap(); + public HashSet quick_integer_values_container = new HashSet(); // ========================== 验证器 ========================== HashMap validator = new HashMap(); @@ -98,7 +101,7 @@ static void append_alias_list(String short_name, String full_name, HashMap ls = hashmap.getOrDefault(short_name, null); if (null == ls) { ls = new PbAliasNode(); @@ -184,6 +187,67 @@ static private com.google.protobuf.ExtensionRegistryLite get_extension_registry( return pb_extensions; } + static private Integer get_quick_integer_value(PbInfoSet pbs, String name) { + while (name.length() > 0 && name.charAt(0) == '.') { + name = name.substring(1); + } + + int dotPos = name.lastIndexOf('.'); + if (dotPos < 0) { + return null; + } + + var ret = pbs.quick_integer_values_alias.getOrDefault(name, null); + if (ret != null) { + return ret; + } + + String container = name.substring(0, dotPos); + if (pbs.quick_integer_values_container.contains(container)) { + return null; + } + pbs.quick_integer_values_container.add(container); + + // Try enum + var enumDesc = get_alias_list_element(container, pbs.enums, "enum type"); + if (enumDesc != null) { + for (var enumValue : enumDesc.getValueList()) { + pbs.quick_integer_values_alias.put(String.format("%s.%s", container, enumValue.getName()), + Integer.valueOf(enumValue.getNumber())); + } + return pbs.quick_integer_values_alias.getOrDefault(name, null); + } + + // Try message + var msgDesc = get_alias_list_element(container, pbs.messages, "message type"); + if (msgDesc != null) { + for (var fieldDesc : msgDesc.getFieldList()) { + pbs.quick_integer_values_alias.put(String.format("%s.%s", container, fieldDesc.getName()), + Integer.valueOf(fieldDesc.getNumber())); + } + return pbs.quick_integer_values_alias.getOrDefault(name, null); + } + + return null; + } + + static private Integer try_parse_quick_integer_value(PbInfoSet pbs, String name) { + name = name.trim(); + if (name.isEmpty()) { + return null; + } + + if (name.charAt(0) >= '0' && name.charAt(0) <= '9') { + try { + return Integer.valueOf(name); + } catch (NumberFormatException e) { + return null; + } + } + + return get_quick_integer_value(pbs, name); + } + static void load_pb_message(PbInfoSet pbs, DescriptorProtos.DescriptorProto mdp, String package_name, HashMap> hashmap) { String full_name = String.format("%s.%s", package_name, mdp.getName()); @@ -582,12 +646,38 @@ static private boolean setup_extension(DataDstTypeDescriptor parent_message, Dat } if (fd.getOptions().hasExtension(Xresloader.fieldListMinSize)) { - child_field.mutableExtension() - .mutableList().minSize = fd.getOptions().getExtension(Xresloader.fieldListMinSize); + var intValue = try_parse_quick_integer_value(cachePbs, + fd.getOptions().getExtension(Xresloader.fieldListMinSize)); + if (null == intValue) { + ProgramOptions.getLoger().error( + "\"%s\" has invalid extension settings field_list_min_size (%s)", + fd.getFullName(), + fd.getOptions().getExtension(Xresloader.fieldListMinSize)); + ret = false; + if (gen != null) { + gen.success = false; + } + } else { + child_field.mutableExtension() + .mutableList().minSize = intValue.intValue(); + } } if (fd.getOptions().hasExtension(Xresloader.fieldListMaxSize)) { - child_field.mutableExtension() - .mutableList().maxSize = fd.getOptions().getExtension(Xresloader.fieldListMaxSize); + var intValue = try_parse_quick_integer_value(cachePbs, + fd.getOptions().getExtension(Xresloader.fieldListMaxSize)); + if (null == intValue) { + ProgramOptions.getLoger().error( + "\"%s\" has invalid extension settings field_list_max_size (%s)", + fd.getFullName(), + fd.getOptions().getExtension(Xresloader.fieldListMaxSize)); + ret = false; + if (gen != null) { + gen.success = false; + } + } else { + child_field.mutableExtension() + .mutableList().maxSize = intValue.intValue(); + } if (child_field.mutableExtension() .mutableList().maxSize != 0 @@ -1091,7 +1181,7 @@ static private void buildDataDstDescriptorMessage(PbInfoSet pbs, Descriptors.Des if (null != innerField) { if (!setup_extension(innerDesc, innerField, field)) { throw new ConvException( - String.format("setup extension failed, field name: %s", field.getFullName())); + String.format("Setup extension failed, field name: %s", field.getFullName())); } } } @@ -1101,7 +1191,7 @@ static private void buildDataDstDescriptorMessage(PbInfoSet pbs, Descriptors.Des if (null != innerField) { if (!setup_extension(innerDesc, innerField, pbDesc, oneof)) { throw new ConvException( - String.format("setup extension failed, field name: %s", oneof.getFullName())); + String.format("Setup extension failed, field name: %s", oneof.getFullName())); } } } diff --git a/src/org/xresloader/core/data/dst/DataDstWriterNode.java b/src/org/xresloader/core/data/dst/DataDstWriterNode.java index 653986f8..73e2f8e4 100644 --- a/src/org/xresloader/core/data/dst/DataDstWriterNode.java +++ b/src/org/xresloader/core/data/dst/DataDstWriterNode.java @@ -944,7 +944,7 @@ public DataDstChildrenNode addChild(String child_name, DataDstWriterNode node, O if (null == child_field_desc && null == child_oneof_desc) { throw new ConvException( - String.format("can not find any child with name \"%s\" for %s.", child_name, getFullName())); + String.format("Can not find any child with name \"%s\" for %s.", child_name, getFullName())); } DataDstChildrenNode res = getChildren().getOrDefault(child_name, null); diff --git a/third_party/xresloader-protocol b/third_party/xresloader-protocol index 50f43e8e..e43f077e 160000 --- a/third_party/xresloader-protocol +++ b/third_party/xresloader-protocol @@ -1 +1 @@ -Subproject commit 50f43e8e82a167f00bbd10d0cb8ea79196cc1a5b +Subproject commit e43f077ef0bf6535add33a3a4ca5d2c46ec041ce diff --git a/tools/extensions.pb b/tools/extensions.pb index 47383f08ca691c3d331a6f8f122ff21db9861721..6f50adcea1db0d95bf8bc17c7308bc541e40e44d 100644 GIT binary patch delta 20 ccmX>saadwQ1REpgsaadwQ1REpk Date: Thu, 25 Jul 2024 22:15:40 +0800 Subject: [PATCH 06/10] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E6=96=B0=E7=9A=84=E5=88=AB=E5=90=8D=E6=98=A0=E5=B0=84case?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E5=A4=8D=E5=88=AB=E5=90=8D=E6=98=A0=E5=B0=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HISTORY.md | 6 + README.md | 3 +- sample/cxx/v2/kind.pb.cc | 528 ++++++++++++++++- sample/cxx/v2/kind.pb.h | 549 ++++++++++++++++++ sample/cxx/v3/kind.pb.cc | 511 +++++++++++++++- sample/cxx/v3/kind.pb.h | 534 +++++++++++++++++ sample/gen_sample_output.ps1 | 2 + sample/gen_sample_output.sh | 8 +- sample/proto_v2/kind.desc.json | 34 ++ sample/proto_v2/kind.desc.lua | 50 ++ sample/proto_v2/kind.pb | Bin 4990 -> 5192 bytes sample/proto_v2/kind.proto | 10 + sample/proto_v2/kind_option.js | 50 ++ sample/proto_v2/kind_option.lua | 50 ++ sample/proto_v2/kind_option.mod.lua | 50 ++ sample/proto_v2/next_alias.bin | Bin 0 -> 210 bytes sample/proto_v2/next_alias.lua | 66 +++ sample/proto_v3/kind.desc.json | 34 ++ sample/proto_v3/kind.desc.lua | 50 ++ sample/proto_v3/kind.pb | Bin 5670 -> 5872 bytes sample/proto_v3/kind.proto | 12 +- sample/proto_v3/kind_option.js | 50 ++ sample/proto_v3/kind_option.lua | 50 ++ sample/proto_v3/kind_option.mod.lua | 50 ++ sample/proto_v3/next_alias.bin | Bin 0 -> 211 bytes sample/proto_v3/next_alias.lua | 66 +++ ...\346\215\242\347\244\272\344\276\213.xlsx" | 4 +- src/org/xresloader/core/ProgramOptions.java | 11 +- .../xresloader/core/data/dst/DataDstPb.java | 84 +-- .../core/data/src/DataSrcExcel.java | 31 +- .../xresloader/core/data/src/DataSrcImpl.java | 4 + 31 files changed, 2843 insertions(+), 54 deletions(-) create mode 100644 sample/proto_v2/next_alias.bin create mode 100644 sample/proto_v2/next_alias.lua create mode 100644 sample/proto_v3/next_alias.bin create mode 100644 sample/proto_v3/next_alias.lua diff --git a/HISTORY.md b/HISTORY.md index 0486b607..1992f76c 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -7,6 +7,12 @@ 1. 增加插件 `org.xresloader.field_list_strip_option=LIST_STRIP_DEFAULT|LIST_STRIP_NOTHING|LIST_STRIP_TAIL|LIST_STRIP_ALL` 用于给单个字段设置数组裁剪。 2. 增加插件 `org.xresloader.field_list_min_size="|枚举名"` 用于给单个字段数组最小长度要求。 3. 增加插件 `org.xresloader.field_list_max_size="|枚举名"` 用于给单个字段数组最大长度要求。 +4. 增加选项 `--disable-alias-mapping` 用于关闭字段映射时使用别名。 +5. 修复使用别名时,message结构未被正确映射的问题。 + +### BREAKCHANGES + ++ 在此版本后,默认启用 `--enable-alias-mapping` 开启字段别名映射。如果出现别名重名出现冲突,请使用 `--disable-alias-mapping` 还原之前的默认行为。 ## 2.17.1 diff --git a/README.md b/README.md index 9ae90248..8a77ff8c 100644 --- a/README.md +++ b/README.md @@ -99,7 +99,8 @@ echo " | -v --version | 打印版本号 | | | -n --rename | 重命名输出文件名 | 正则表达式 (如:/(?i)\\.bin$/\\.lua/) | | --require-mapping-all | 开启所有字段映射检查 | 开启所有字段映射检查后,转出结构中所有的字段都必须配置映射关系,数组字段至少要有一个元素 | -| --enable-alias-mapping | 开启别名匹配 | 映射Excel列到目标数据结构,允许使用别名 | +| --enable-alias-mapping | 开启别名匹配 | 映射Excel列到目标数据结构,允许使用别名(<2.18.0版本时默认值) | +| --disable-alias-mapping | 关闭别名匹配 | 映射Excel列到目标数据结构,不允许使用别名(>=2.18.0版本) | | -c --const-print | 输出协议描述中的常量 | 参数为字符串,表示输出的文件名 | | -i --option-print | 输出协议描述中的选项 | 参数为字符串,表示输出的文件名 | | -r --descriptor-print | 输出完整协议描述信息 | 参数为字符串,表示输出的文件名 | diff --git a/sample/cxx/v2/kind.pb.cc b/sample/cxx/v2/kind.pb.cc index 4bfda2fe..681e732e 100755 --- a/sample/cxx/v2/kind.pb.cc +++ b/sample/cxx/v2/kind.pb.cc @@ -92,6 +92,26 @@ struct process_by_script_MapU32StringEntry_DoNotUseDefaultTypeInternal { PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 process_by_script_MapU32StringEntry_DoNotUseDefaultTypeInternal _process_by_script_MapU32StringEntry_DoNotUse_default_instance_; +inline constexpr inner_alias_message::Impl_::Impl_( + ::_pbi::ConstantInitialized) noexcept + : _cached_size_{0}, + paramlist_{}, + itype_{0} {} + +template +PROTOBUF_CONSTEXPR inner_alias_message::inner_alias_message(::_pbi::ConstantInitialized) + : _impl_(::_pbi::ConstantInitialized()) {} +struct inner_alias_messageDefaultTypeInternal { + PROTOBUF_CONSTEXPR inner_alias_messageDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~inner_alias_messageDefaultTypeInternal() {} + union { + inner_alias_message _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 inner_alias_messageDefaultTypeInternal _inner_alias_message_default_instance_; + inline constexpr event_rule_item::Impl_::Impl_( ::_pbi::ConstantInitialized) noexcept : _cached_size_{0}, @@ -204,6 +224,26 @@ struct process_by_script_TestMapSmEntry_DoNotUseDefaultTypeInternal { PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 process_by_script_TestMapSmEntry_DoNotUseDefaultTypeInternal _process_by_script_TestMapSmEntry_DoNotUse_default_instance_; +inline constexpr outer_alias_message::Impl_::Impl_( + ::_pbi::ConstantInitialized) noexcept + : _cached_size_{0}, + inners_{}, + iid_{0} {} + +template +PROTOBUF_CONSTEXPR outer_alias_message::outer_alias_message(::_pbi::ConstantInitialized) + : _impl_(::_pbi::ConstantInitialized()) {} +struct outer_alias_messageDefaultTypeInternal { + PROTOBUF_CONSTEXPR outer_alias_messageDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~outer_alias_messageDefaultTypeInternal() {} + union { + outer_alias_message _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 outer_alias_messageDefaultTypeInternal _outer_alias_message_default_instance_; + inline constexpr large_file_test::Impl_::Impl_( ::_pbi::ConstantInitialized) noexcept : _cached_size_{0}, @@ -699,6 +739,30 @@ const ::uint32_t 6, 0, 1, + PROTOBUF_FIELD_OFFSET(::inner_alias_message, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::inner_alias_message, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + ~0u, // no _split_ + ~0u, // no sizeof(Split) + PROTOBUF_FIELD_OFFSET(::inner_alias_message, _impl_.itype_), + PROTOBUF_FIELD_OFFSET(::inner_alias_message, _impl_.paramlist_), + 0, + ~0u, + PROTOBUF_FIELD_OFFSET(::outer_alias_message, _impl_._has_bits_), + PROTOBUF_FIELD_OFFSET(::outer_alias_message, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + ~0u, // no _split_ + ~0u, // no sizeof(Split) + PROTOBUF_FIELD_OFFSET(::outer_alias_message, _impl_.iid_), + PROTOBUF_FIELD_OFFSET(::outer_alias_message, _impl_.inners_), + 0, + ~0u, }; static const ::_pbi::MigrationSchema @@ -720,6 +784,8 @@ static const ::_pbi::MigrationSchema {256, 266, -1, sizeof(::process_by_script_TestMapSmEntry_DoNotUse)}, {268, 281, -1, sizeof(::process_by_script)}, {286, 301, -1, sizeof(::large_file_test)}, + {308, 318, -1, sizeof(::inner_alias_message)}, + {320, 330, -1, sizeof(::outer_alias_message)}, }; static const ::_pb::Message* const file_default_instances[] = { &::_role_cfg_default_instance_._instance, @@ -739,6 +805,8 @@ static const ::_pb::Message* const file_default_instances[] = { &::_process_by_script_TestMapSmEntry_DoNotUse_default_instance_._instance, &::_process_by_script_default_instance_._instance, &::_large_file_test_default_instance_._instance, + &::_inner_alias_message_default_instance_._instance, + &::_outer_alias_message_default_instance_._instance, }; const char descriptor_table_protodef_kind_2eproto[] ABSL_ATTRIBUTE_SECTION_VARIABLE( protodesc_cold) = { @@ -829,7 +897,11 @@ const char descriptor_table_protodef_kind_2eproto[] ABSL_ATTRIBUTE_SECTION_VARIA "\n\n\002id\030\001 \001(\r\022\020\n\010i32value\030\002 \001(\005\022\020\n\010u64valu" "e\030\003 \001(\004\022\020\n\010f64value\030\004 \001(\001\022\020\n\010f32value\030\005 " "\001(\002\022\017\n\007szvalue\030\006 \001(\t\022\032\n\005id_id\030\007 \001(\0132\013.co" - "mbine_id" + "mbine_id\"J\n\023inner_alias_message\022\026\n\005iType" + "\030\001 \001(\005B\007\242\?\004Type\022\033\n\tparamList\030\002 \003(\003B\010\242\?\005P" + "aram\"]\n\023outer_alias_message\022\022\n\003iId\030\001 \001(\005" + "B\005\242\?\002ID\0222\n\006inners\030\002 \003(\0132\024.inner_alias_me" + "ssageB\014\242\?\tCondition" }; static const ::_pbi::DescriptorTable* const descriptor_table_kind_2eproto_deps[6] = { @@ -844,13 +916,13 @@ static ::absl::once_flag descriptor_table_kind_2eproto_once; PROTOBUF_CONSTINIT const ::_pbi::DescriptorTable descriptor_table_kind_2eproto = { false, false, - 3488, + 3659, descriptor_table_protodef_kind_2eproto, "kind.proto", &descriptor_table_kind_2eproto_once, descriptor_table_kind_2eproto_deps, 6, - 17, + 19, schemas, file_default_instances, TableStruct_kind_2eproto::offsets, @@ -5660,6 +5732,456 @@ void large_file_test::InternalSwap(large_file_test* PROTOBUF_RESTRICT other) { ::google::protobuf::Metadata large_file_test::GetMetadata() const { return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); } +// =================================================================== + +class inner_alias_message::_Internal { + public: + using HasBits = + decltype(std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(inner_alias_message, _impl_._has_bits_); +}; + +inner_alias_message::inner_alias_message(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(arena) { + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:inner_alias_message) +} +inline PROTOBUF_NDEBUG_INLINE inner_alias_message::Impl_::Impl_( + ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* arena, + const Impl_& from, const ::inner_alias_message& from_msg) + : _has_bits_{from._has_bits_}, + _cached_size_{0}, + paramlist_{visibility, arena, from.paramlist_} {} + +inner_alias_message::inner_alias_message( + ::google::protobuf::Arena* arena, + const inner_alias_message& from) + : ::google::protobuf::Message(arena) { + inner_alias_message* const _this = this; + (void)_this; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + new (&_impl_) Impl_(internal_visibility(), arena, from._impl_, from); + _impl_.itype_ = from._impl_.itype_; + + // @@protoc_insertion_point(copy_constructor:inner_alias_message) +} +inline PROTOBUF_NDEBUG_INLINE inner_alias_message::Impl_::Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* arena) + : _cached_size_{0}, + paramlist_{visibility, arena} {} + +inline void inner_alias_message::SharedCtor(::_pb::Arena* arena) { + new (&_impl_) Impl_(internal_visibility(), arena); + _impl_.itype_ = {}; +} +inner_alias_message::~inner_alias_message() { + // @@protoc_insertion_point(destructor:inner_alias_message) + _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + SharedDtor(); +} +inline void inner_alias_message::SharedDtor() { + ABSL_DCHECK(GetArena() == nullptr); + _impl_.~Impl_(); +} + +const ::google::protobuf::MessageLite::ClassData* +inner_alias_message::GetClassData() const { + PROTOBUF_CONSTINIT static const ::google::protobuf::MessageLite:: + ClassDataFull _data_ = { + { + &_table_.header, + nullptr, // OnDemandRegisterArenaDtor + nullptr, // IsInitialized + PROTOBUF_FIELD_OFFSET(inner_alias_message, _impl_._cached_size_), + false, + }, + &inner_alias_message::MergeImpl, + &inner_alias_message::kDescriptorMethods, + &descriptor_table_kind_2eproto, + nullptr, // tracker + }; + ::google::protobuf::internal::PrefetchToLocalCache(&_data_); + ::google::protobuf::internal::PrefetchToLocalCache(_data_.tc_table); + return _data_.base(); +} +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 +const ::_pbi::TcParseTable<1, 2, 0, 0, 2> inner_alias_message::_table_ = { + { + PROTOBUF_FIELD_OFFSET(inner_alias_message, _impl_._has_bits_), + 0, // no _extensions_ + 2, 8, // max_field_number, fast_idx_mask + offsetof(decltype(_table_), field_lookup_table), + 4294967292, // skipmap + offsetof(decltype(_table_), field_entries), + 2, // num_field_entries + 0, // num_aux_entries + offsetof(decltype(_table_), field_names), // no aux_entries + &_inner_alias_message_default_instance_._instance, + nullptr, // post_loop_handler + ::_pbi::TcParser::GenericFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::inner_alias_message>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + // repeated int64 paramList = 2 [(.org.xresloader.field_alias) = "Param"]; + {::_pbi::TcParser::FastV64R1, + {16, 63, 0, PROTOBUF_FIELD_OFFSET(inner_alias_message, _impl_.paramlist_)}}, + // optional int32 iType = 1 [(.org.xresloader.field_alias) = "Type"]; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(inner_alias_message, _impl_.itype_), 0>(), + {8, 0, 0, PROTOBUF_FIELD_OFFSET(inner_alias_message, _impl_.itype_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // optional int32 iType = 1 [(.org.xresloader.field_alias) = "Type"]; + {PROTOBUF_FIELD_OFFSET(inner_alias_message, _impl_.itype_), _Internal::kHasBitsOffset + 0, 0, + (0 | ::_fl::kFcOptional | ::_fl::kInt32)}, + // repeated int64 paramList = 2 [(.org.xresloader.field_alias) = "Param"]; + {PROTOBUF_FIELD_OFFSET(inner_alias_message, _impl_.paramlist_), -1, 0, + (0 | ::_fl::kFcRepeated | ::_fl::kInt64)}, + }}, + // no aux_entries + {{ + }}, +}; + +PROTOBUF_NOINLINE void inner_alias_message::Clear() { +// @@protoc_insertion_point(message_clear_start:inner_alias_message) + ::google::protobuf::internal::TSanWrite(&_impl_); + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.paramlist_.Clear(); + _impl_.itype_ = 0; + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +::uint8_t* inner_alias_message::_InternalSerialize( + ::uint8_t* target, + ::google::protobuf::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:inner_alias_message) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + // optional int32 iType = 1 [(.org.xresloader.field_alias) = "Type"]; + if (cached_has_bits & 0x00000001u) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt32ToArrayWithField<1>( + stream, this->_internal_itype(), target); + } + + // repeated int64 paramList = 2 [(.org.xresloader.field_alias) = "Param"]; + for (int i = 0, n = this->_internal_paramlist_size(); i < n; ++i) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteInt64ToArray( + 2, this->_internal_paramlist().Get(i), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = + ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:inner_alias_message) + return target; +} + +::size_t inner_alias_message::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:inner_alias_message) + ::size_t total_size = 0; + + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::_pbi::Prefetch5LinesFrom7Lines(reinterpret_cast(this)); + // repeated int64 paramList = 2 [(.org.xresloader.field_alias) = "Param"]; + { + std::size_t data_size = ::_pbi::WireFormatLite::Int64Size( + this->_internal_paramlist()) + ; + std::size_t tag_size = std::size_t{1} * + ::_pbi::FromIntSize(this->_internal_paramlist_size()); + ; + total_size += tag_size + data_size; + } + // optional int32 iType = 1 [(.org.xresloader.field_alias) = "Type"]; + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000001u) { + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne( + this->_internal_itype()); + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + + +void inner_alias_message::MergeImpl(::google::protobuf::MessageLite& to_msg, const ::google::protobuf::MessageLite& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:inner_alias_message) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + _this->_internal_mutable_paramlist()->MergeFrom(from._internal_paramlist()); + cached_has_bits = from._impl_._has_bits_[0]; + if (cached_has_bits & 0x00000001u) { + _this->_impl_.itype_ = from._impl_.itype_; + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); +} + +void inner_alias_message::CopyFrom(const inner_alias_message& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:inner_alias_message) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + + +void inner_alias_message::InternalSwap(inner_alias_message* PROTOBUF_RESTRICT other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + _impl_.paramlist_.InternalSwap(&other->_impl_.paramlist_); + swap(_impl_.itype_, other->_impl_.itype_); +} + +::google::protobuf::Metadata inner_alias_message::GetMetadata() const { + return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); +} +// =================================================================== + +class outer_alias_message::_Internal { + public: + using HasBits = + decltype(std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(outer_alias_message, _impl_._has_bits_); +}; + +outer_alias_message::outer_alias_message(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(arena) { + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:outer_alias_message) +} +inline PROTOBUF_NDEBUG_INLINE outer_alias_message::Impl_::Impl_( + ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* arena, + const Impl_& from, const ::outer_alias_message& from_msg) + : _has_bits_{from._has_bits_}, + _cached_size_{0}, + inners_{visibility, arena, from.inners_} {} + +outer_alias_message::outer_alias_message( + ::google::protobuf::Arena* arena, + const outer_alias_message& from) + : ::google::protobuf::Message(arena) { + outer_alias_message* const _this = this; + (void)_this; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + new (&_impl_) Impl_(internal_visibility(), arena, from._impl_, from); + _impl_.iid_ = from._impl_.iid_; + + // @@protoc_insertion_point(copy_constructor:outer_alias_message) +} +inline PROTOBUF_NDEBUG_INLINE outer_alias_message::Impl_::Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* arena) + : _cached_size_{0}, + inners_{visibility, arena} {} + +inline void outer_alias_message::SharedCtor(::_pb::Arena* arena) { + new (&_impl_) Impl_(internal_visibility(), arena); + _impl_.iid_ = {}; +} +outer_alias_message::~outer_alias_message() { + // @@protoc_insertion_point(destructor:outer_alias_message) + _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + SharedDtor(); +} +inline void outer_alias_message::SharedDtor() { + ABSL_DCHECK(GetArena() == nullptr); + _impl_.~Impl_(); +} + +const ::google::protobuf::MessageLite::ClassData* +outer_alias_message::GetClassData() const { + PROTOBUF_CONSTINIT static const ::google::protobuf::MessageLite:: + ClassDataFull _data_ = { + { + &_table_.header, + nullptr, // OnDemandRegisterArenaDtor + nullptr, // IsInitialized + PROTOBUF_FIELD_OFFSET(outer_alias_message, _impl_._cached_size_), + false, + }, + &outer_alias_message::MergeImpl, + &outer_alias_message::kDescriptorMethods, + &descriptor_table_kind_2eproto, + nullptr, // tracker + }; + ::google::protobuf::internal::PrefetchToLocalCache(&_data_); + ::google::protobuf::internal::PrefetchToLocalCache(_data_.tc_table); + return _data_.base(); +} +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 +const ::_pbi::TcParseTable<1, 2, 1, 0, 2> outer_alias_message::_table_ = { + { + PROTOBUF_FIELD_OFFSET(outer_alias_message, _impl_._has_bits_), + 0, // no _extensions_ + 2, 8, // max_field_number, fast_idx_mask + offsetof(decltype(_table_), field_lookup_table), + 4294967292, // skipmap + offsetof(decltype(_table_), field_entries), + 2, // num_field_entries + 1, // num_aux_entries + offsetof(decltype(_table_), aux_entries), + &_outer_alias_message_default_instance_._instance, + nullptr, // post_loop_handler + ::_pbi::TcParser::GenericFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::outer_alias_message>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + // repeated .inner_alias_message inners = 2 [(.org.xresloader.field_alias) = "Condition"]; + {::_pbi::TcParser::FastMtR1, + {18, 63, 0, PROTOBUF_FIELD_OFFSET(outer_alias_message, _impl_.inners_)}}, + // optional int32 iId = 1 [(.org.xresloader.field_alias) = "ID"]; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(outer_alias_message, _impl_.iid_), 0>(), + {8, 0, 0, PROTOBUF_FIELD_OFFSET(outer_alias_message, _impl_.iid_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // optional int32 iId = 1 [(.org.xresloader.field_alias) = "ID"]; + {PROTOBUF_FIELD_OFFSET(outer_alias_message, _impl_.iid_), _Internal::kHasBitsOffset + 0, 0, + (0 | ::_fl::kFcOptional | ::_fl::kInt32)}, + // repeated .inner_alias_message inners = 2 [(.org.xresloader.field_alias) = "Condition"]; + {PROTOBUF_FIELD_OFFSET(outer_alias_message, _impl_.inners_), -1, 0, + (0 | ::_fl::kFcRepeated | ::_fl::kMessage | ::_fl::kTvTable)}, + }}, {{ + {::_pbi::TcParser::GetTable<::inner_alias_message>()}, + }}, {{ + }}, +}; + +PROTOBUF_NOINLINE void outer_alias_message::Clear() { +// @@protoc_insertion_point(message_clear_start:outer_alias_message) + ::google::protobuf::internal::TSanWrite(&_impl_); + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.inners_.Clear(); + _impl_.iid_ = 0; + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +::uint8_t* outer_alias_message::_InternalSerialize( + ::uint8_t* target, + ::google::protobuf::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:outer_alias_message) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + // optional int32 iId = 1 [(.org.xresloader.field_alias) = "ID"]; + if (cached_has_bits & 0x00000001u) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt32ToArrayWithField<1>( + stream, this->_internal_iid(), target); + } + + // repeated .inner_alias_message inners = 2 [(.org.xresloader.field_alias) = "Condition"]; + for (unsigned i = 0, n = static_cast( + this->_internal_inners_size()); + i < n; i++) { + const auto& repfield = this->_internal_inners().Get(i); + target = + ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( + 2, repfield, repfield.GetCachedSize(), + target, stream); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = + ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:outer_alias_message) + return target; +} + +::size_t outer_alias_message::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:outer_alias_message) + ::size_t total_size = 0; + + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::_pbi::Prefetch5LinesFrom7Lines(reinterpret_cast(this)); + // repeated .inner_alias_message inners = 2 [(.org.xresloader.field_alias) = "Condition"]; + total_size += 1UL * this->_internal_inners_size(); + for (const auto& msg : this->_internal_inners()) { + total_size += ::google::protobuf::internal::WireFormatLite::MessageSize(msg); + } + // optional int32 iId = 1 [(.org.xresloader.field_alias) = "ID"]; + cached_has_bits = _impl_._has_bits_[0]; + if (cached_has_bits & 0x00000001u) { + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne( + this->_internal_iid()); + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + + +void outer_alias_message::MergeImpl(::google::protobuf::MessageLite& to_msg, const ::google::protobuf::MessageLite& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:outer_alias_message) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + _this->_internal_mutable_inners()->MergeFrom( + from._internal_inners()); + cached_has_bits = from._impl_._has_bits_[0]; + if (cached_has_bits & 0x00000001u) { + _this->_impl_.iid_ = from._impl_.iid_; + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); +} + +void outer_alias_message::CopyFrom(const outer_alias_message& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:outer_alias_message) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + + +void outer_alias_message::InternalSwap(outer_alias_message* PROTOBUF_RESTRICT other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + _impl_.inners_.InternalSwap(&other->_impl_.inners_); + swap(_impl_.iid_, other->_impl_.iid_); +} + +::google::protobuf::Metadata outer_alias_message::GetMetadata() const { + return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); +} // @@protoc_insertion_point(namespace_scope) namespace google { namespace protobuf { diff --git a/sample/cxx/v2/kind.pb.h b/sample/cxx/v2/kind.pb.h index e49c30fe..ee0e093b 100755 --- a/sample/cxx/v2/kind.pb.h +++ b/sample/cxx/v2/kind.pb.h @@ -82,12 +82,18 @@ extern event_reward_itemDefaultTypeInternal _event_reward_item_default_instance_ class event_rule_item; struct event_rule_itemDefaultTypeInternal; extern event_rule_itemDefaultTypeInternal _event_rule_item_default_instance_; +class inner_alias_message; +struct inner_alias_messageDefaultTypeInternal; +extern inner_alias_messageDefaultTypeInternal _inner_alias_message_default_instance_; class keep_or_strip_empty_list_cfg; struct keep_or_strip_empty_list_cfgDefaultTypeInternal; extern keep_or_strip_empty_list_cfgDefaultTypeInternal _keep_or_strip_empty_list_cfg_default_instance_; class large_file_test; struct large_file_testDefaultTypeInternal; extern large_file_testDefaultTypeInternal _large_file_test_default_instance_; +class outer_alias_message; +struct outer_alias_messageDefaultTypeInternal; +extern outer_alias_messageDefaultTypeInternal _outer_alias_message_default_instance_; class process_by_script; struct process_by_scriptDefaultTypeInternal; extern process_by_scriptDefaultTypeInternal _process_by_script_default_instance_; @@ -592,6 +598,199 @@ const ::google::protobuf::Message::ClassData* GetClassData() const final; }; // ------------------------------------------------------------------- +class inner_alias_message final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:inner_alias_message) */ { + public: + inline inner_alias_message() : inner_alias_message(nullptr) {} + ~inner_alias_message() override; + template + explicit PROTOBUF_CONSTEXPR inner_alias_message( + ::google::protobuf::internal::ConstantInitialized); + + inline inner_alias_message(const inner_alias_message& from) : inner_alias_message(nullptr, from) {} + inline inner_alias_message(inner_alias_message&& from) noexcept + : inner_alias_message(nullptr, std::move(from)) {} + inline inner_alias_message& operator=(const inner_alias_message& from) { + CopyFrom(from); + return *this; + } + inline inner_alias_message& operator=(inner_alias_message&& from) noexcept { + if (this == &from) return *this; + if (GetArena() == from.GetArena() +#ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetArena() != nullptr +#endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); + } + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); + } + + static const ::google::protobuf::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::google::protobuf::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::google::protobuf::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const inner_alias_message& default_instance() { + return *internal_default_instance(); + } + static inline const inner_alias_message* internal_default_instance() { + return reinterpret_cast( + &_inner_alias_message_default_instance_); + } + static constexpr int kIndexInFileMessages = 17; + friend void swap(inner_alias_message& a, inner_alias_message& b) { a.Swap(&b); } + inline void Swap(inner_alias_message* other) { + if (other == this) return; +#ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetArena() != nullptr && GetArena() == other->GetArena()) { +#else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetArena() == other->GetArena()) { +#endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::google::protobuf::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(inner_alias_message* other) { + if (other == this) return; + ABSL_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + inner_alias_message* New(::google::protobuf::Arena* arena = nullptr) const final { + return ::google::protobuf::Message::DefaultConstruct(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const inner_alias_message& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom(const inner_alias_message& from) { inner_alias_message::MergeImpl(*this, from); } + + private: + static void MergeImpl( + ::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg); + + public: + bool IsInitialized() const { + return true; + } + ABSL_ATTRIBUTE_REINITIALIZES void Clear() final; + ::size_t ByteSizeLong() const final; + ::uint8_t* _InternalSerialize( + ::uint8_t* target, + ::google::protobuf::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::google::protobuf::Arena* arena); + void SharedDtor(); + void InternalSwap(inner_alias_message* other); + private: + friend class ::google::protobuf::internal::AnyMetadata; + static ::absl::string_view FullMessageName() { return "inner_alias_message"; } + + protected: + explicit inner_alias_message(::google::protobuf::Arena* arena); + inner_alias_message(::google::protobuf::Arena* arena, const inner_alias_message& from); + inner_alias_message(::google::protobuf::Arena* arena, inner_alias_message&& from) noexcept + : inner_alias_message(arena) { + *this = ::std::move(from); + } + const ::google::protobuf::Message::ClassData* GetClassData() const final; + + public: + ::google::protobuf::Metadata GetMetadata() const; + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + enum : int { + kParamListFieldNumber = 2, + kITypeFieldNumber = 1, + }; + // repeated int64 paramList = 2 [(.org.xresloader.field_alias) = "Param"]; + int paramlist_size() const; + private: + int _internal_paramlist_size() const; + + public: + void clear_paramlist() ; + ::int64_t paramlist(int index) const; + void set_paramlist(int index, ::int64_t value); + void add_paramlist(::int64_t value); + const ::google::protobuf::RepeatedField<::int64_t>& paramlist() const; + ::google::protobuf::RepeatedField<::int64_t>* mutable_paramlist(); + + private: + const ::google::protobuf::RepeatedField<::int64_t>& _internal_paramlist() const; + ::google::protobuf::RepeatedField<::int64_t>* _internal_mutable_paramlist(); + + public: + // optional int32 iType = 1 [(.org.xresloader.field_alias) = "Type"]; + bool has_itype() const; + void clear_itype() ; + ::int32_t itype() const; + void set_itype(::int32_t value); + + private: + ::int32_t _internal_itype() const; + void _internal_set_itype(::int32_t value); + + public: + // @@protoc_insertion_point(class_scope:inner_alias_message) + private: + class _Internal; + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable< + 1, 2, 0, + 0, 2> + _table_; + + static constexpr const void* _raw_default_instance_ = + &_inner_alias_message_default_instance_; + + friend class ::google::protobuf::MessageLite; + friend class ::google::protobuf::Arena; + template + friend class ::google::protobuf::Arena::InternalHelper; + using InternalArenaConstructable_ = void; + using DestructorSkippable_ = void; + struct Impl_ { + inline explicit constexpr Impl_( + ::google::protobuf::internal::ConstantInitialized) noexcept; + inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* arena); + inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* arena, const Impl_& from, + const inner_alias_message& from_msg); + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::RepeatedField<::int64_t> paramlist_; + ::int32_t itype_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_kind_2eproto; +}; +// ------------------------------------------------------------------- + class event_rule_item final : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:event_rule_item) */ { public: @@ -1524,6 +1723,198 @@ const ::google::protobuf::Message::ClassData* GetClassData() const final; }; // ------------------------------------------------------------------- +class outer_alias_message final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:outer_alias_message) */ { + public: + inline outer_alias_message() : outer_alias_message(nullptr) {} + ~outer_alias_message() override; + template + explicit PROTOBUF_CONSTEXPR outer_alias_message( + ::google::protobuf::internal::ConstantInitialized); + + inline outer_alias_message(const outer_alias_message& from) : outer_alias_message(nullptr, from) {} + inline outer_alias_message(outer_alias_message&& from) noexcept + : outer_alias_message(nullptr, std::move(from)) {} + inline outer_alias_message& operator=(const outer_alias_message& from) { + CopyFrom(from); + return *this; + } + inline outer_alias_message& operator=(outer_alias_message&& from) noexcept { + if (this == &from) return *this; + if (GetArena() == from.GetArena() +#ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetArena() != nullptr +#endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); + } + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); + } + + static const ::google::protobuf::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::google::protobuf::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::google::protobuf::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const outer_alias_message& default_instance() { + return *internal_default_instance(); + } + static inline const outer_alias_message* internal_default_instance() { + return reinterpret_cast( + &_outer_alias_message_default_instance_); + } + static constexpr int kIndexInFileMessages = 18; + friend void swap(outer_alias_message& a, outer_alias_message& b) { a.Swap(&b); } + inline void Swap(outer_alias_message* other) { + if (other == this) return; +#ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetArena() != nullptr && GetArena() == other->GetArena()) { +#else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetArena() == other->GetArena()) { +#endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::google::protobuf::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(outer_alias_message* other) { + if (other == this) return; + ABSL_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + outer_alias_message* New(::google::protobuf::Arena* arena = nullptr) const final { + return ::google::protobuf::Message::DefaultConstruct(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const outer_alias_message& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom(const outer_alias_message& from) { outer_alias_message::MergeImpl(*this, from); } + + private: + static void MergeImpl( + ::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg); + + public: + bool IsInitialized() const { + return true; + } + ABSL_ATTRIBUTE_REINITIALIZES void Clear() final; + ::size_t ByteSizeLong() const final; + ::uint8_t* _InternalSerialize( + ::uint8_t* target, + ::google::protobuf::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::google::protobuf::Arena* arena); + void SharedDtor(); + void InternalSwap(outer_alias_message* other); + private: + friend class ::google::protobuf::internal::AnyMetadata; + static ::absl::string_view FullMessageName() { return "outer_alias_message"; } + + protected: + explicit outer_alias_message(::google::protobuf::Arena* arena); + outer_alias_message(::google::protobuf::Arena* arena, const outer_alias_message& from); + outer_alias_message(::google::protobuf::Arena* arena, outer_alias_message&& from) noexcept + : outer_alias_message(arena) { + *this = ::std::move(from); + } + const ::google::protobuf::Message::ClassData* GetClassData() const final; + + public: + ::google::protobuf::Metadata GetMetadata() const; + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + enum : int { + kInnersFieldNumber = 2, + kIIdFieldNumber = 1, + }; + // repeated .inner_alias_message inners = 2 [(.org.xresloader.field_alias) = "Condition"]; + int inners_size() const; + private: + int _internal_inners_size() const; + + public: + void clear_inners() ; + ::inner_alias_message* mutable_inners(int index); + ::google::protobuf::RepeatedPtrField<::inner_alias_message>* mutable_inners(); + + private: + const ::google::protobuf::RepeatedPtrField<::inner_alias_message>& _internal_inners() const; + ::google::protobuf::RepeatedPtrField<::inner_alias_message>* _internal_mutable_inners(); + public: + const ::inner_alias_message& inners(int index) const; + ::inner_alias_message* add_inners(); + const ::google::protobuf::RepeatedPtrField<::inner_alias_message>& inners() const; + // optional int32 iId = 1 [(.org.xresloader.field_alias) = "ID"]; + bool has_iid() const; + void clear_iid() ; + ::int32_t iid() const; + void set_iid(::int32_t value); + + private: + ::int32_t _internal_iid() const; + void _internal_set_iid(::int32_t value); + + public: + // @@protoc_insertion_point(class_scope:outer_alias_message) + private: + class _Internal; + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable< + 1, 2, 1, + 0, 2> + _table_; + + static constexpr const void* _raw_default_instance_ = + &_outer_alias_message_default_instance_; + + friend class ::google::protobuf::MessageLite; + friend class ::google::protobuf::Arena; + template + friend class ::google::protobuf::Arena::InternalHelper; + using InternalArenaConstructable_ = void; + using DestructorSkippable_ = void; + struct Impl_ { + inline explicit constexpr Impl_( + ::google::protobuf::internal::ConstantInitialized) noexcept; + inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* arena); + inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* arena, const Impl_& from, + const outer_alias_message& from_msg); + ::google::protobuf::internal::HasBits<1> _has_bits_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::RepeatedPtrField< ::inner_alias_message > inners_; + ::int32_t iid_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_kind_2eproto; +}; +// ------------------------------------------------------------------- + class large_file_test final : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:large_file_test) */ { public: @@ -7237,6 +7628,164 @@ inline void large_file_test::set_allocated_id_id(::combine_id* value) { // @@protoc_insertion_point(field_set_allocated:large_file_test.id_id) } +// ------------------------------------------------------------------- + +// inner_alias_message + +// optional int32 iType = 1 [(.org.xresloader.field_alias) = "Type"]; +inline bool inner_alias_message::has_itype() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + return value; +} +inline void inner_alias_message::clear_itype() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.itype_ = 0; + _impl_._has_bits_[0] &= ~0x00000001u; +} +inline ::int32_t inner_alias_message::itype() const { + // @@protoc_insertion_point(field_get:inner_alias_message.iType) + return _internal_itype(); +} +inline void inner_alias_message::set_itype(::int32_t value) { + _internal_set_itype(value); + _impl_._has_bits_[0] |= 0x00000001u; + // @@protoc_insertion_point(field_set:inner_alias_message.iType) +} +inline ::int32_t inner_alias_message::_internal_itype() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.itype_; +} +inline void inner_alias_message::_internal_set_itype(::int32_t value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.itype_ = value; +} + +// repeated int64 paramList = 2 [(.org.xresloader.field_alias) = "Param"]; +inline int inner_alias_message::_internal_paramlist_size() const { + return _internal_paramlist().size(); +} +inline int inner_alias_message::paramlist_size() const { + return _internal_paramlist_size(); +} +inline void inner_alias_message::clear_paramlist() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.paramlist_.Clear(); +} +inline ::int64_t inner_alias_message::paramlist(int index) const { + // @@protoc_insertion_point(field_get:inner_alias_message.paramList) + return _internal_paramlist().Get(index); +} +inline void inner_alias_message::set_paramlist(int index, ::int64_t value) { + _internal_mutable_paramlist()->Set(index, value); + // @@protoc_insertion_point(field_set:inner_alias_message.paramList) +} +inline void inner_alias_message::add_paramlist(::int64_t value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _internal_mutable_paramlist()->Add(value); + // @@protoc_insertion_point(field_add:inner_alias_message.paramList) +} +inline const ::google::protobuf::RepeatedField<::int64_t>& inner_alias_message::paramlist() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_list:inner_alias_message.paramList) + return _internal_paramlist(); +} +inline ::google::protobuf::RepeatedField<::int64_t>* inner_alias_message::mutable_paramlist() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_mutable_list:inner_alias_message.paramList) + ::google::protobuf::internal::TSanWrite(&_impl_); + return _internal_mutable_paramlist(); +} +inline const ::google::protobuf::RepeatedField<::int64_t>& +inner_alias_message::_internal_paramlist() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.paramlist_; +} +inline ::google::protobuf::RepeatedField<::int64_t>* inner_alias_message::_internal_mutable_paramlist() { + ::google::protobuf::internal::TSanRead(&_impl_); + return &_impl_.paramlist_; +} + +// ------------------------------------------------------------------- + +// outer_alias_message + +// optional int32 iId = 1 [(.org.xresloader.field_alias) = "ID"]; +inline bool outer_alias_message::has_iid() const { + bool value = (_impl_._has_bits_[0] & 0x00000001u) != 0; + return value; +} +inline void outer_alias_message::clear_iid() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.iid_ = 0; + _impl_._has_bits_[0] &= ~0x00000001u; +} +inline ::int32_t outer_alias_message::iid() const { + // @@protoc_insertion_point(field_get:outer_alias_message.iId) + return _internal_iid(); +} +inline void outer_alias_message::set_iid(::int32_t value) { + _internal_set_iid(value); + _impl_._has_bits_[0] |= 0x00000001u; + // @@protoc_insertion_point(field_set:outer_alias_message.iId) +} +inline ::int32_t outer_alias_message::_internal_iid() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.iid_; +} +inline void outer_alias_message::_internal_set_iid(::int32_t value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.iid_ = value; +} + +// repeated .inner_alias_message inners = 2 [(.org.xresloader.field_alias) = "Condition"]; +inline int outer_alias_message::_internal_inners_size() const { + return _internal_inners().size(); +} +inline int outer_alias_message::inners_size() const { + return _internal_inners_size(); +} +inline void outer_alias_message::clear_inners() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.inners_.Clear(); +} +inline ::inner_alias_message* outer_alias_message::mutable_inners(int index) + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_mutable:outer_alias_message.inners) + return _internal_mutable_inners()->Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField<::inner_alias_message>* outer_alias_message::mutable_inners() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_mutable_list:outer_alias_message.inners) + ::google::protobuf::internal::TSanWrite(&_impl_); + return _internal_mutable_inners(); +} +inline const ::inner_alias_message& outer_alias_message::inners(int index) const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:outer_alias_message.inners) + return _internal_inners().Get(index); +} +inline ::inner_alias_message* outer_alias_message::add_inners() ABSL_ATTRIBUTE_LIFETIME_BOUND { + ::google::protobuf::internal::TSanWrite(&_impl_); + ::inner_alias_message* _add = _internal_mutable_inners()->Add(); + // @@protoc_insertion_point(field_add:outer_alias_message.inners) + return _add; +} +inline const ::google::protobuf::RepeatedPtrField<::inner_alias_message>& outer_alias_message::inners() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_list:outer_alias_message.inners) + return _internal_inners(); +} +inline const ::google::protobuf::RepeatedPtrField<::inner_alias_message>& +outer_alias_message::_internal_inners() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.inners_; +} +inline ::google::protobuf::RepeatedPtrField<::inner_alias_message>* +outer_alias_message::_internal_mutable_inners() { + ::google::protobuf::internal::TSanRead(&_impl_); + return &_impl_.inners_; +} + #ifdef __GNUC__ #pragma GCC diagnostic pop #endif // __GNUC__ diff --git a/sample/cxx/v3/kind.pb.cc b/sample/cxx/v3/kind.pb.cc index 1d3f013c..cf6b9e52 100755 --- a/sample/cxx/v3/kind.pb.cc +++ b/sample/cxx/v3/kind.pb.cc @@ -92,6 +92,27 @@ struct process_by_script_MapU32StringEntry_DoNotUseDefaultTypeInternal { PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 process_by_script_MapU32StringEntry_DoNotUseDefaultTypeInternal _process_by_script_MapU32StringEntry_DoNotUse_default_instance_; +inline constexpr inner_alias_message::Impl_::Impl_( + ::_pbi::ConstantInitialized) noexcept + : paramlist_{}, + _paramlist_cached_byte_size_{0}, + itype_{0}, + _cached_size_{0} {} + +template +PROTOBUF_CONSTEXPR inner_alias_message::inner_alias_message(::_pbi::ConstantInitialized) + : _impl_(::_pbi::ConstantInitialized()) {} +struct inner_alias_messageDefaultTypeInternal { + PROTOBUF_CONSTEXPR inner_alias_messageDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~inner_alias_messageDefaultTypeInternal() {} + union { + inner_alias_message _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 inner_alias_messageDefaultTypeInternal _inner_alias_message_default_instance_; + inline constexpr event_rule_item::Impl_::Impl_( ::_pbi::ConstantInitialized) noexcept : rule_id_{0u}, @@ -180,6 +201,26 @@ struct process_by_script_TestMapSmEntry_DoNotUseDefaultTypeInternal { PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 process_by_script_TestMapSmEntry_DoNotUseDefaultTypeInternal _process_by_script_TestMapSmEntry_DoNotUse_default_instance_; +inline constexpr outer_alias_message::Impl_::Impl_( + ::_pbi::ConstantInitialized) noexcept + : inners_{}, + iid_{0}, + _cached_size_{0} {} + +template +PROTOBUF_CONSTEXPR outer_alias_message::outer_alias_message(::_pbi::ConstantInitialized) + : _impl_(::_pbi::ConstantInitialized()) {} +struct outer_alias_messageDefaultTypeInternal { + PROTOBUF_CONSTEXPR outer_alias_messageDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~outer_alias_messageDefaultTypeInternal() {} + union { + outer_alias_message _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 outer_alias_messageDefaultTypeInternal _outer_alias_message_default_instance_; + inline constexpr large_file_test::Impl_::Impl_( ::_pbi::ConstantInitialized) noexcept : _cached_size_{0}, @@ -721,6 +762,26 @@ const ::uint32_t ~0u, ~0u, 0, + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::inner_alias_message, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + ~0u, // no _split_ + ~0u, // no sizeof(Split) + PROTOBUF_FIELD_OFFSET(::inner_alias_message, _impl_.itype_), + PROTOBUF_FIELD_OFFSET(::inner_alias_message, _impl_.paramlist_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::outer_alias_message, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + ~0u, // no _inlined_string_donated_ + ~0u, // no _split_ + ~0u, // no sizeof(Split) + PROTOBUF_FIELD_OFFSET(::outer_alias_message, _impl_.iid_), + PROTOBUF_FIELD_OFFSET(::outer_alias_message, _impl_.inners_), }; static const ::_pbi::MigrationSchema @@ -743,6 +804,8 @@ static const ::_pbi::MigrationSchema {244, 254, -1, sizeof(::process_by_script_TestMapSmEntry_DoNotUse)}, {256, 271, -1, sizeof(::process_by_script)}, {278, 293, -1, sizeof(::large_file_test)}, + {300, -1, -1, sizeof(::inner_alias_message)}, + {310, -1, -1, sizeof(::outer_alias_message)}, }; static const ::_pb::Message* const file_default_instances[] = { &::_role_cfg_default_instance_._instance, @@ -763,6 +826,8 @@ static const ::_pb::Message* const file_default_instances[] = { &::_process_by_script_TestMapSmEntry_DoNotUse_default_instance_._instance, &::_process_by_script_default_instance_._instance, &::_large_file_test_default_instance_._instance, + &::_inner_alias_message_default_instance_._instance, + &::_outer_alias_message_default_instance_._instance, }; const char descriptor_table_protodef_kind_2eproto[] ABSL_ATTRIBUTE_SECTION_VARIABLE( protodesc_cold) = { @@ -866,7 +931,12 @@ const char descriptor_table_protodef_kind_2eproto[] ABSL_ATTRIBUTE_SECTION_VARIA "\017large_file_test\022\n\n\002id\030\001 \001(\r\022\020\n\010i32value" "\030\002 \001(\005\022\020\n\010u64value\030\003 \001(\004\022\020\n\010f64value\030\004 \001" "(\001\022\020\n\010f32value\030\005 \001(\002\022\017\n\007szvalue\030\006 \001(\t\022\032\n" - "\005id_id\030\007 \001(\0132\013.combine_idb\006proto3" + "\005id_id\030\007 \001(\0132\013.combine_id\"J\n\023inner_alias" + "_message\022\026\n\005iType\030\001 \001(\005B\007\242\?\004Type\022\033\n\tpara" + "mList\030\002 \003(\003B\010\242\?\005Param\"]\n\023outer_alias_mes" + "sage\022\022\n\003iId\030\001 \001(\005B\005\242\?\002ID\0222\n\006inners\030\002 \003(\013" + "2\024.inner_alias_messageB\014\242\?\tConditionb\006pr" + "oto3" }; static const ::_pbi::DescriptorTable* const descriptor_table_kind_2eproto_deps[6] = { @@ -881,13 +951,13 @@ static ::absl::once_flag descriptor_table_kind_2eproto_once; PROTOBUF_CONSTINIT const ::_pbi::DescriptorTable descriptor_table_kind_2eproto = { false, false, - 4033, + 4204, descriptor_table_protodef_kind_2eproto, "kind.proto", &descriptor_table_kind_2eproto_once, descriptor_table_kind_2eproto_deps, 6, - 18, + 20, schemas, file_default_instances, TableStruct_kind_2eproto::offsets, @@ -6189,6 +6259,441 @@ void large_file_test::InternalSwap(large_file_test* PROTOBUF_RESTRICT other) { ::google::protobuf::Metadata large_file_test::GetMetadata() const { return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); } +// =================================================================== + +class inner_alias_message::_Internal { + public: +}; + +inner_alias_message::inner_alias_message(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(arena) { + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:inner_alias_message) +} +inline PROTOBUF_NDEBUG_INLINE inner_alias_message::Impl_::Impl_( + ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* arena, + const Impl_& from, const ::inner_alias_message& from_msg) + : paramlist_{visibility, arena, from.paramlist_}, + _paramlist_cached_byte_size_{0}, + _cached_size_{0} {} + +inner_alias_message::inner_alias_message( + ::google::protobuf::Arena* arena, + const inner_alias_message& from) + : ::google::protobuf::Message(arena) { + inner_alias_message* const _this = this; + (void)_this; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + new (&_impl_) Impl_(internal_visibility(), arena, from._impl_, from); + _impl_.itype_ = from._impl_.itype_; + + // @@protoc_insertion_point(copy_constructor:inner_alias_message) +} +inline PROTOBUF_NDEBUG_INLINE inner_alias_message::Impl_::Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* arena) + : paramlist_{visibility, arena}, + _paramlist_cached_byte_size_{0}, + _cached_size_{0} {} + +inline void inner_alias_message::SharedCtor(::_pb::Arena* arena) { + new (&_impl_) Impl_(internal_visibility(), arena); + _impl_.itype_ = {}; +} +inner_alias_message::~inner_alias_message() { + // @@protoc_insertion_point(destructor:inner_alias_message) + _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + SharedDtor(); +} +inline void inner_alias_message::SharedDtor() { + ABSL_DCHECK(GetArena() == nullptr); + _impl_.~Impl_(); +} + +const ::google::protobuf::MessageLite::ClassData* +inner_alias_message::GetClassData() const { + PROTOBUF_CONSTINIT static const ::google::protobuf::MessageLite:: + ClassDataFull _data_ = { + { + &_table_.header, + nullptr, // OnDemandRegisterArenaDtor + nullptr, // IsInitialized + PROTOBUF_FIELD_OFFSET(inner_alias_message, _impl_._cached_size_), + false, + }, + &inner_alias_message::MergeImpl, + &inner_alias_message::kDescriptorMethods, + &descriptor_table_kind_2eproto, + nullptr, // tracker + }; + ::google::protobuf::internal::PrefetchToLocalCache(&_data_); + ::google::protobuf::internal::PrefetchToLocalCache(_data_.tc_table); + return _data_.base(); +} +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 +const ::_pbi::TcParseTable<1, 2, 0, 0, 2> inner_alias_message::_table_ = { + { + 0, // no _has_bits_ + 0, // no _extensions_ + 2, 8, // max_field_number, fast_idx_mask + offsetof(decltype(_table_), field_lookup_table), + 4294967292, // skipmap + offsetof(decltype(_table_), field_entries), + 2, // num_field_entries + 0, // num_aux_entries + offsetof(decltype(_table_), field_names), // no aux_entries + &_inner_alias_message_default_instance_._instance, + nullptr, // post_loop_handler + ::_pbi::TcParser::GenericFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::inner_alias_message>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + // repeated int64 paramList = 2 [(.org.xresloader.field_alias) = "Param"]; + {::_pbi::TcParser::FastV64P1, + {18, 63, 0, PROTOBUF_FIELD_OFFSET(inner_alias_message, _impl_.paramlist_)}}, + // int32 iType = 1 [(.org.xresloader.field_alias) = "Type"]; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(inner_alias_message, _impl_.itype_), 63>(), + {8, 63, 0, PROTOBUF_FIELD_OFFSET(inner_alias_message, _impl_.itype_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // int32 iType = 1 [(.org.xresloader.field_alias) = "Type"]; + {PROTOBUF_FIELD_OFFSET(inner_alias_message, _impl_.itype_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kInt32)}, + // repeated int64 paramList = 2 [(.org.xresloader.field_alias) = "Param"]; + {PROTOBUF_FIELD_OFFSET(inner_alias_message, _impl_.paramlist_), 0, 0, + (0 | ::_fl::kFcRepeated | ::_fl::kPackedInt64)}, + }}, + // no aux_entries + {{ + }}, +}; + +PROTOBUF_NOINLINE void inner_alias_message::Clear() { +// @@protoc_insertion_point(message_clear_start:inner_alias_message) + ::google::protobuf::internal::TSanWrite(&_impl_); + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.paramlist_.Clear(); + _impl_.itype_ = 0; + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +::uint8_t* inner_alias_message::_InternalSerialize( + ::uint8_t* target, + ::google::protobuf::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:inner_alias_message) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + // int32 iType = 1 [(.org.xresloader.field_alias) = "Type"]; + if (this->_internal_itype() != 0) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt32ToArrayWithField<1>( + stream, this->_internal_itype(), target); + } + + // repeated int64 paramList = 2 [(.org.xresloader.field_alias) = "Param"]; + { + int byte_size = _impl_._paramlist_cached_byte_size_.Get(); + if (byte_size > 0) { + target = stream->WriteInt64Packed( + 2, _internal_paramlist(), byte_size, target); + } + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = + ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:inner_alias_message) + return target; +} + +::size_t inner_alias_message::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:inner_alias_message) + ::size_t total_size = 0; + + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::_pbi::Prefetch5LinesFrom7Lines(reinterpret_cast(this)); + // repeated int64 paramList = 2 [(.org.xresloader.field_alias) = "Param"]; + { + std::size_t data_size = ::_pbi::WireFormatLite::Int64Size( + this->_internal_paramlist()) + ; + _impl_._paramlist_cached_byte_size_.Set(::_pbi::ToCachedSize(data_size)); + std::size_t tag_size = data_size == 0 + ? 0 + : 1 + ::_pbi::WireFormatLite::Int32Size( + static_cast(data_size)) + ; + total_size += tag_size + data_size; + } + // int32 iType = 1 [(.org.xresloader.field_alias) = "Type"]; + if (this->_internal_itype() != 0) { + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne( + this->_internal_itype()); + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + + +void inner_alias_message::MergeImpl(::google::protobuf::MessageLite& to_msg, const ::google::protobuf::MessageLite& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:inner_alias_message) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + _this->_internal_mutable_paramlist()->MergeFrom(from._internal_paramlist()); + if (from._internal_itype() != 0) { + _this->_impl_.itype_ = from._impl_.itype_; + } + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); +} + +void inner_alias_message::CopyFrom(const inner_alias_message& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:inner_alias_message) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + + +void inner_alias_message::InternalSwap(inner_alias_message* PROTOBUF_RESTRICT other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + _impl_.paramlist_.InternalSwap(&other->_impl_.paramlist_); + swap(_impl_.itype_, other->_impl_.itype_); +} + +::google::protobuf::Metadata inner_alias_message::GetMetadata() const { + return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); +} +// =================================================================== + +class outer_alias_message::_Internal { + public: +}; + +outer_alias_message::outer_alias_message(::google::protobuf::Arena* arena) + : ::google::protobuf::Message(arena) { + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:outer_alias_message) +} +inline PROTOBUF_NDEBUG_INLINE outer_alias_message::Impl_::Impl_( + ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* arena, + const Impl_& from, const ::outer_alias_message& from_msg) + : inners_{visibility, arena, from.inners_}, + _cached_size_{0} {} + +outer_alias_message::outer_alias_message( + ::google::protobuf::Arena* arena, + const outer_alias_message& from) + : ::google::protobuf::Message(arena) { + outer_alias_message* const _this = this; + (void)_this; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + new (&_impl_) Impl_(internal_visibility(), arena, from._impl_, from); + _impl_.iid_ = from._impl_.iid_; + + // @@protoc_insertion_point(copy_constructor:outer_alias_message) +} +inline PROTOBUF_NDEBUG_INLINE outer_alias_message::Impl_::Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* arena) + : inners_{visibility, arena}, + _cached_size_{0} {} + +inline void outer_alias_message::SharedCtor(::_pb::Arena* arena) { + new (&_impl_) Impl_(internal_visibility(), arena); + _impl_.iid_ = {}; +} +outer_alias_message::~outer_alias_message() { + // @@protoc_insertion_point(destructor:outer_alias_message) + _internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + SharedDtor(); +} +inline void outer_alias_message::SharedDtor() { + ABSL_DCHECK(GetArena() == nullptr); + _impl_.~Impl_(); +} + +const ::google::protobuf::MessageLite::ClassData* +outer_alias_message::GetClassData() const { + PROTOBUF_CONSTINIT static const ::google::protobuf::MessageLite:: + ClassDataFull _data_ = { + { + &_table_.header, + nullptr, // OnDemandRegisterArenaDtor + nullptr, // IsInitialized + PROTOBUF_FIELD_OFFSET(outer_alias_message, _impl_._cached_size_), + false, + }, + &outer_alias_message::MergeImpl, + &outer_alias_message::kDescriptorMethods, + &descriptor_table_kind_2eproto, + nullptr, // tracker + }; + ::google::protobuf::internal::PrefetchToLocalCache(&_data_); + ::google::protobuf::internal::PrefetchToLocalCache(_data_.tc_table); + return _data_.base(); +} +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 +const ::_pbi::TcParseTable<1, 2, 1, 0, 2> outer_alias_message::_table_ = { + { + 0, // no _has_bits_ + 0, // no _extensions_ + 2, 8, // max_field_number, fast_idx_mask + offsetof(decltype(_table_), field_lookup_table), + 4294967292, // skipmap + offsetof(decltype(_table_), field_entries), + 2, // num_field_entries + 1, // num_aux_entries + offsetof(decltype(_table_), aux_entries), + &_outer_alias_message_default_instance_._instance, + nullptr, // post_loop_handler + ::_pbi::TcParser::GenericFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::outer_alias_message>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + // repeated .inner_alias_message inners = 2 [(.org.xresloader.field_alias) = "Condition"]; + {::_pbi::TcParser::FastMtR1, + {18, 63, 0, PROTOBUF_FIELD_OFFSET(outer_alias_message, _impl_.inners_)}}, + // int32 iId = 1 [(.org.xresloader.field_alias) = "ID"]; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(outer_alias_message, _impl_.iid_), 63>(), + {8, 63, 0, PROTOBUF_FIELD_OFFSET(outer_alias_message, _impl_.iid_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // int32 iId = 1 [(.org.xresloader.field_alias) = "ID"]; + {PROTOBUF_FIELD_OFFSET(outer_alias_message, _impl_.iid_), 0, 0, + (0 | ::_fl::kFcSingular | ::_fl::kInt32)}, + // repeated .inner_alias_message inners = 2 [(.org.xresloader.field_alias) = "Condition"]; + {PROTOBUF_FIELD_OFFSET(outer_alias_message, _impl_.inners_), 0, 0, + (0 | ::_fl::kFcRepeated | ::_fl::kMessage | ::_fl::kTvTable)}, + }}, {{ + {::_pbi::TcParser::GetTable<::inner_alias_message>()}, + }}, {{ + }}, +}; + +PROTOBUF_NOINLINE void outer_alias_message::Clear() { +// @@protoc_insertion_point(message_clear_start:outer_alias_message) + ::google::protobuf::internal::TSanWrite(&_impl_); + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + _impl_.inners_.Clear(); + _impl_.iid_ = 0; + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +::uint8_t* outer_alias_message::_InternalSerialize( + ::uint8_t* target, + ::google::protobuf::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:outer_alias_message) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + // int32 iId = 1 [(.org.xresloader.field_alias) = "ID"]; + if (this->_internal_iid() != 0) { + target = ::google::protobuf::internal::WireFormatLite:: + WriteInt32ToArrayWithField<1>( + stream, this->_internal_iid(), target); + } + + // repeated .inner_alias_message inners = 2 [(.org.xresloader.field_alias) = "Condition"]; + for (unsigned i = 0, n = static_cast( + this->_internal_inners_size()); + i < n; i++) { + const auto& repfield = this->_internal_inners().Get(i); + target = + ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( + 2, repfield, repfield.GetCachedSize(), + target, stream); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = + ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:outer_alias_message) + return target; +} + +::size_t outer_alias_message::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:outer_alias_message) + ::size_t total_size = 0; + + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::_pbi::Prefetch5LinesFrom7Lines(reinterpret_cast(this)); + // repeated .inner_alias_message inners = 2 [(.org.xresloader.field_alias) = "Condition"]; + total_size += 1UL * this->_internal_inners_size(); + for (const auto& msg : this->_internal_inners()) { + total_size += ::google::protobuf::internal::WireFormatLite::MessageSize(msg); + } + // int32 iId = 1 [(.org.xresloader.field_alias) = "ID"]; + if (this->_internal_iid() != 0) { + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne( + this->_internal_iid()); + } + + return MaybeComputeUnknownFieldsSize(total_size, &_impl_._cached_size_); +} + + +void outer_alias_message::MergeImpl(::google::protobuf::MessageLite& to_msg, const ::google::protobuf::MessageLite& from_msg) { + auto* const _this = static_cast(&to_msg); + auto& from = static_cast(from_msg); + // @@protoc_insertion_point(class_specific_merge_from_start:outer_alias_message) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void) cached_has_bits; + + _this->_internal_mutable_inners()->MergeFrom( + from._internal_inners()); + if (from._internal_iid() != 0) { + _this->_impl_.iid_ = from._impl_.iid_; + } + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>(from._internal_metadata_); +} + +void outer_alias_message::CopyFrom(const outer_alias_message& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:outer_alias_message) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + + +void outer_alias_message::InternalSwap(outer_alias_message* PROTOBUF_RESTRICT other) { + using std::swap; + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + _impl_.inners_.InternalSwap(&other->_impl_.inners_); + swap(_impl_.iid_, other->_impl_.iid_); +} + +::google::protobuf::Metadata outer_alias_message::GetMetadata() const { + return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); +} // @@protoc_insertion_point(namespace_scope) namespace google { namespace protobuf { diff --git a/sample/cxx/v3/kind.pb.h b/sample/cxx/v3/kind.pb.h index 690ad7de..0a92a0bb 100755 --- a/sample/cxx/v3/kind.pb.h +++ b/sample/cxx/v3/kind.pb.h @@ -86,12 +86,18 @@ extern event_reward_itemDefaultTypeInternal _event_reward_item_default_instance_ class event_rule_item; struct event_rule_itemDefaultTypeInternal; extern event_rule_itemDefaultTypeInternal _event_rule_item_default_instance_; +class inner_alias_message; +struct inner_alias_messageDefaultTypeInternal; +extern inner_alias_messageDefaultTypeInternal _inner_alias_message_default_instance_; class keep_or_strip_empty_list_cfg; struct keep_or_strip_empty_list_cfgDefaultTypeInternal; extern keep_or_strip_empty_list_cfgDefaultTypeInternal _keep_or_strip_empty_list_cfg_default_instance_; class large_file_test; struct large_file_testDefaultTypeInternal; extern large_file_testDefaultTypeInternal _large_file_test_default_instance_; +class outer_alias_message; +struct outer_alias_messageDefaultTypeInternal; +extern outer_alias_messageDefaultTypeInternal _outer_alias_message_default_instance_; class process_by_script; struct process_by_scriptDefaultTypeInternal; extern process_by_scriptDefaultTypeInternal _process_by_script_default_instance_; @@ -640,6 +646,198 @@ const ::google::protobuf::Message::ClassData* GetClassData() const final; }; // ------------------------------------------------------------------- +class inner_alias_message final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:inner_alias_message) */ { + public: + inline inner_alias_message() : inner_alias_message(nullptr) {} + ~inner_alias_message() override; + template + explicit PROTOBUF_CONSTEXPR inner_alias_message( + ::google::protobuf::internal::ConstantInitialized); + + inline inner_alias_message(const inner_alias_message& from) : inner_alias_message(nullptr, from) {} + inline inner_alias_message(inner_alias_message&& from) noexcept + : inner_alias_message(nullptr, std::move(from)) {} + inline inner_alias_message& operator=(const inner_alias_message& from) { + CopyFrom(from); + return *this; + } + inline inner_alias_message& operator=(inner_alias_message&& from) noexcept { + if (this == &from) return *this; + if (GetArena() == from.GetArena() +#ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetArena() != nullptr +#endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); + } + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); + } + + static const ::google::protobuf::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::google::protobuf::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::google::protobuf::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const inner_alias_message& default_instance() { + return *internal_default_instance(); + } + static inline const inner_alias_message* internal_default_instance() { + return reinterpret_cast( + &_inner_alias_message_default_instance_); + } + static constexpr int kIndexInFileMessages = 18; + friend void swap(inner_alias_message& a, inner_alias_message& b) { a.Swap(&b); } + inline void Swap(inner_alias_message* other) { + if (other == this) return; +#ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetArena() != nullptr && GetArena() == other->GetArena()) { +#else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetArena() == other->GetArena()) { +#endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::google::protobuf::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(inner_alias_message* other) { + if (other == this) return; + ABSL_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + inner_alias_message* New(::google::protobuf::Arena* arena = nullptr) const final { + return ::google::protobuf::Message::DefaultConstruct(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const inner_alias_message& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom(const inner_alias_message& from) { inner_alias_message::MergeImpl(*this, from); } + + private: + static void MergeImpl( + ::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg); + + public: + bool IsInitialized() const { + return true; + } + ABSL_ATTRIBUTE_REINITIALIZES void Clear() final; + ::size_t ByteSizeLong() const final; + ::uint8_t* _InternalSerialize( + ::uint8_t* target, + ::google::protobuf::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::google::protobuf::Arena* arena); + void SharedDtor(); + void InternalSwap(inner_alias_message* other); + private: + friend class ::google::protobuf::internal::AnyMetadata; + static ::absl::string_view FullMessageName() { return "inner_alias_message"; } + + protected: + explicit inner_alias_message(::google::protobuf::Arena* arena); + inner_alias_message(::google::protobuf::Arena* arena, const inner_alias_message& from); + inner_alias_message(::google::protobuf::Arena* arena, inner_alias_message&& from) noexcept + : inner_alias_message(arena) { + *this = ::std::move(from); + } + const ::google::protobuf::Message::ClassData* GetClassData() const final; + + public: + ::google::protobuf::Metadata GetMetadata() const; + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + enum : int { + kParamListFieldNumber = 2, + kITypeFieldNumber = 1, + }; + // repeated int64 paramList = 2 [(.org.xresloader.field_alias) = "Param"]; + int paramlist_size() const; + private: + int _internal_paramlist_size() const; + + public: + void clear_paramlist() ; + ::int64_t paramlist(int index) const; + void set_paramlist(int index, ::int64_t value); + void add_paramlist(::int64_t value); + const ::google::protobuf::RepeatedField<::int64_t>& paramlist() const; + ::google::protobuf::RepeatedField<::int64_t>* mutable_paramlist(); + + private: + const ::google::protobuf::RepeatedField<::int64_t>& _internal_paramlist() const; + ::google::protobuf::RepeatedField<::int64_t>* _internal_mutable_paramlist(); + + public: + // int32 iType = 1 [(.org.xresloader.field_alias) = "Type"]; + void clear_itype() ; + ::int32_t itype() const; + void set_itype(::int32_t value); + + private: + ::int32_t _internal_itype() const; + void _internal_set_itype(::int32_t value); + + public: + // @@protoc_insertion_point(class_scope:inner_alias_message) + private: + class _Internal; + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable< + 1, 2, 0, + 0, 2> + _table_; + + static constexpr const void* _raw_default_instance_ = + &_inner_alias_message_default_instance_; + + friend class ::google::protobuf::MessageLite; + friend class ::google::protobuf::Arena; + template + friend class ::google::protobuf::Arena::InternalHelper; + using InternalArenaConstructable_ = void; + using DestructorSkippable_ = void; + struct Impl_ { + inline explicit constexpr Impl_( + ::google::protobuf::internal::ConstantInitialized) noexcept; + inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* arena); + inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* arena, const Impl_& from, + const inner_alias_message& from_msg); + ::google::protobuf::RepeatedField<::int64_t> paramlist_; + mutable ::google::protobuf::internal::CachedSize _paramlist_cached_byte_size_; + ::int32_t itype_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_kind_2eproto; +}; +// ------------------------------------------------------------------- + class event_rule_item final : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:event_rule_item) */ { public: @@ -1333,6 +1531,196 @@ const ::google::protobuf::Message::ClassData* GetClassData() const final; }; // ------------------------------------------------------------------- +class outer_alias_message final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:outer_alias_message) */ { + public: + inline outer_alias_message() : outer_alias_message(nullptr) {} + ~outer_alias_message() override; + template + explicit PROTOBUF_CONSTEXPR outer_alias_message( + ::google::protobuf::internal::ConstantInitialized); + + inline outer_alias_message(const outer_alias_message& from) : outer_alias_message(nullptr, from) {} + inline outer_alias_message(outer_alias_message&& from) noexcept + : outer_alias_message(nullptr, std::move(from)) {} + inline outer_alias_message& operator=(const outer_alias_message& from) { + CopyFrom(from); + return *this; + } + inline outer_alias_message& operator=(outer_alias_message&& from) noexcept { + if (this == &from) return *this; + if (GetArena() == from.GetArena() +#ifdef PROTOBUF_FORCE_COPY_IN_MOVE + && GetArena() != nullptr +#endif // !PROTOBUF_FORCE_COPY_IN_MOVE + ) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); + } + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); + } + + static const ::google::protobuf::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::google::protobuf::Descriptor* GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + static const ::google::protobuf::Reflection* GetReflection() { + return default_instance().GetMetadata().reflection; + } + static const outer_alias_message& default_instance() { + return *internal_default_instance(); + } + static inline const outer_alias_message* internal_default_instance() { + return reinterpret_cast( + &_outer_alias_message_default_instance_); + } + static constexpr int kIndexInFileMessages = 19; + friend void swap(outer_alias_message& a, outer_alias_message& b) { a.Swap(&b); } + inline void Swap(outer_alias_message* other) { + if (other == this) return; +#ifdef PROTOBUF_FORCE_COPY_IN_SWAP + if (GetArena() != nullptr && GetArena() == other->GetArena()) { +#else // PROTOBUF_FORCE_COPY_IN_SWAP + if (GetArena() == other->GetArena()) { +#endif // !PROTOBUF_FORCE_COPY_IN_SWAP + InternalSwap(other); + } else { + ::google::protobuf::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(outer_alias_message* other) { + if (other == this) return; + ABSL_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + outer_alias_message* New(::google::protobuf::Arena* arena = nullptr) const final { + return ::google::protobuf::Message::DefaultConstruct(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const outer_alias_message& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom(const outer_alias_message& from) { outer_alias_message::MergeImpl(*this, from); } + + private: + static void MergeImpl( + ::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg); + + public: + bool IsInitialized() const { + return true; + } + ABSL_ATTRIBUTE_REINITIALIZES void Clear() final; + ::size_t ByteSizeLong() const final; + ::uint8_t* _InternalSerialize( + ::uint8_t* target, + ::google::protobuf::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const { return _impl_._cached_size_.Get(); } + + private: + void SharedCtor(::google::protobuf::Arena* arena); + void SharedDtor(); + void InternalSwap(outer_alias_message* other); + private: + friend class ::google::protobuf::internal::AnyMetadata; + static ::absl::string_view FullMessageName() { return "outer_alias_message"; } + + protected: + explicit outer_alias_message(::google::protobuf::Arena* arena); + outer_alias_message(::google::protobuf::Arena* arena, const outer_alias_message& from); + outer_alias_message(::google::protobuf::Arena* arena, outer_alias_message&& from) noexcept + : outer_alias_message(arena) { + *this = ::std::move(from); + } + const ::google::protobuf::Message::ClassData* GetClassData() const final; + + public: + ::google::protobuf::Metadata GetMetadata() const; + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + enum : int { + kInnersFieldNumber = 2, + kIIdFieldNumber = 1, + }; + // repeated .inner_alias_message inners = 2 [(.org.xresloader.field_alias) = "Condition"]; + int inners_size() const; + private: + int _internal_inners_size() const; + + public: + void clear_inners() ; + ::inner_alias_message* mutable_inners(int index); + ::google::protobuf::RepeatedPtrField<::inner_alias_message>* mutable_inners(); + + private: + const ::google::protobuf::RepeatedPtrField<::inner_alias_message>& _internal_inners() const; + ::google::protobuf::RepeatedPtrField<::inner_alias_message>* _internal_mutable_inners(); + public: + const ::inner_alias_message& inners(int index) const; + ::inner_alias_message* add_inners(); + const ::google::protobuf::RepeatedPtrField<::inner_alias_message>& inners() const; + // int32 iId = 1 [(.org.xresloader.field_alias) = "ID"]; + void clear_iid() ; + ::int32_t iid() const; + void set_iid(::int32_t value); + + private: + ::int32_t _internal_iid() const; + void _internal_set_iid(::int32_t value); + + public: + // @@protoc_insertion_point(class_scope:outer_alias_message) + private: + class _Internal; + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable< + 1, 2, 1, + 0, 2> + _table_; + + static constexpr const void* _raw_default_instance_ = + &_outer_alias_message_default_instance_; + + friend class ::google::protobuf::MessageLite; + friend class ::google::protobuf::Arena; + template + friend class ::google::protobuf::Arena::InternalHelper; + using InternalArenaConstructable_ = void; + using DestructorSkippable_ = void; + struct Impl_ { + inline explicit constexpr Impl_( + ::google::protobuf::internal::ConstantInitialized) noexcept; + inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* arena); + inline explicit Impl_(::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* arena, const Impl_& from, + const outer_alias_message& from_msg); + ::google::protobuf::RepeatedPtrField< ::inner_alias_message > inners_; + ::int32_t iid_; + mutable ::google::protobuf::internal::CachedSize _cached_size_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_kind_2eproto; +}; +// ------------------------------------------------------------------- + class large_file_test final : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:large_file_test) */ { public: @@ -7786,6 +8174,152 @@ inline void large_file_test::set_allocated_id_id(::combine_id* value) { // @@protoc_insertion_point(field_set_allocated:large_file_test.id_id) } +// ------------------------------------------------------------------- + +// inner_alias_message + +// int32 iType = 1 [(.org.xresloader.field_alias) = "Type"]; +inline void inner_alias_message::clear_itype() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.itype_ = 0; +} +inline ::int32_t inner_alias_message::itype() const { + // @@protoc_insertion_point(field_get:inner_alias_message.iType) + return _internal_itype(); +} +inline void inner_alias_message::set_itype(::int32_t value) { + _internal_set_itype(value); + // @@protoc_insertion_point(field_set:inner_alias_message.iType) +} +inline ::int32_t inner_alias_message::_internal_itype() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.itype_; +} +inline void inner_alias_message::_internal_set_itype(::int32_t value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.itype_ = value; +} + +// repeated int64 paramList = 2 [(.org.xresloader.field_alias) = "Param"]; +inline int inner_alias_message::_internal_paramlist_size() const { + return _internal_paramlist().size(); +} +inline int inner_alias_message::paramlist_size() const { + return _internal_paramlist_size(); +} +inline void inner_alias_message::clear_paramlist() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.paramlist_.Clear(); +} +inline ::int64_t inner_alias_message::paramlist(int index) const { + // @@protoc_insertion_point(field_get:inner_alias_message.paramList) + return _internal_paramlist().Get(index); +} +inline void inner_alias_message::set_paramlist(int index, ::int64_t value) { + _internal_mutable_paramlist()->Set(index, value); + // @@protoc_insertion_point(field_set:inner_alias_message.paramList) +} +inline void inner_alias_message::add_paramlist(::int64_t value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _internal_mutable_paramlist()->Add(value); + // @@protoc_insertion_point(field_add:inner_alias_message.paramList) +} +inline const ::google::protobuf::RepeatedField<::int64_t>& inner_alias_message::paramlist() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_list:inner_alias_message.paramList) + return _internal_paramlist(); +} +inline ::google::protobuf::RepeatedField<::int64_t>* inner_alias_message::mutable_paramlist() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_mutable_list:inner_alias_message.paramList) + ::google::protobuf::internal::TSanWrite(&_impl_); + return _internal_mutable_paramlist(); +} +inline const ::google::protobuf::RepeatedField<::int64_t>& +inner_alias_message::_internal_paramlist() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.paramlist_; +} +inline ::google::protobuf::RepeatedField<::int64_t>* inner_alias_message::_internal_mutable_paramlist() { + ::google::protobuf::internal::TSanRead(&_impl_); + return &_impl_.paramlist_; +} + +// ------------------------------------------------------------------- + +// outer_alias_message + +// int32 iId = 1 [(.org.xresloader.field_alias) = "ID"]; +inline void outer_alias_message::clear_iid() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.iid_ = 0; +} +inline ::int32_t outer_alias_message::iid() const { + // @@protoc_insertion_point(field_get:outer_alias_message.iId) + return _internal_iid(); +} +inline void outer_alias_message::set_iid(::int32_t value) { + _internal_set_iid(value); + // @@protoc_insertion_point(field_set:outer_alias_message.iId) +} +inline ::int32_t outer_alias_message::_internal_iid() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.iid_; +} +inline void outer_alias_message::_internal_set_iid(::int32_t value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.iid_ = value; +} + +// repeated .inner_alias_message inners = 2 [(.org.xresloader.field_alias) = "Condition"]; +inline int outer_alias_message::_internal_inners_size() const { + return _internal_inners().size(); +} +inline int outer_alias_message::inners_size() const { + return _internal_inners_size(); +} +inline void outer_alias_message::clear_inners() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.inners_.Clear(); +} +inline ::inner_alias_message* outer_alias_message::mutable_inners(int index) + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_mutable:outer_alias_message.inners) + return _internal_mutable_inners()->Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField<::inner_alias_message>* outer_alias_message::mutable_inners() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_mutable_list:outer_alias_message.inners) + ::google::protobuf::internal::TSanWrite(&_impl_); + return _internal_mutable_inners(); +} +inline const ::inner_alias_message& outer_alias_message::inners(int index) const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:outer_alias_message.inners) + return _internal_inners().Get(index); +} +inline ::inner_alias_message* outer_alias_message::add_inners() ABSL_ATTRIBUTE_LIFETIME_BOUND { + ::google::protobuf::internal::TSanWrite(&_impl_); + ::inner_alias_message* _add = _internal_mutable_inners()->Add(); + // @@protoc_insertion_point(field_add:outer_alias_message.inners) + return _add; +} +inline const ::google::protobuf::RepeatedPtrField<::inner_alias_message>& outer_alias_message::inners() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_list:outer_alias_message.inners) + return _internal_inners(); +} +inline const ::google::protobuf::RepeatedPtrField<::inner_alias_message>& +outer_alias_message::_internal_inners() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.inners_; +} +inline ::google::protobuf::RepeatedPtrField<::inner_alias_message>* +outer_alias_message::_internal_mutable_inners() { + ::google::protobuf::internal::TSanRead(&_impl_); + return &_impl_.inners_; +} + #ifdef __GNUC__ #pragma GCC diagnostic pop #endif // __GNUC__ diff --git a/sample/gen_sample_output.ps1 b/sample/gen_sample_output.ps1 index a5c0d880..36560a21 100755 --- a/sample/gen_sample_output.ps1 +++ b/sample/gen_sample_output.ps1 @@ -69,6 +69,8 @@ foreach ($proto_dir in "proto_v2", "proto_v3") { " -t json -p protobuf -o '$proto_dir' -f '$proto_dir/kind.pb' -m CallbackScript=cb_script.js -m 'DataSource=$XLSX_FILE|process_by_script1|2,1' -m 'DataSource=$XLSX_FILE|process_by_script2|2,1' -m ProtoName=process_by_script -m OutputFile=process_by_script.json -m KeyRow=1 --pretty 2 --list-strip-empty-tail" " -t bin -p protobuf -o '$proto_dir' -f '$proto_dir/kind.pb' -m CallbackScript=cb_script.js -m 'DataSource=$XLSX_FILE|process_by_script1|2,1' -m 'DataSource=$XLSX_FILE|process_by_script2|2,1' -m ProtoName=process_by_script -m OutputFile=process_by_script.bin -m KeyRow=1 --list-strip-empty-tail" " -t lua -p protobuf -o '$proto_dir' -f '$proto_dir/kind.pb' -m CallbackScript=cb_script.js -m 'DataSource=$XLSX_FILE|process_by_script1|2,1' -m 'DataSource=$XLSX_FILE|process_by_script2|2,1' -m ProtoName=process_by_script -m OutputFile=process_by_script.lua -m KeyRow=1 --pretty 2 --list-strip-empty-tail" + " -t bin -p protobuf -o '$proto_dir' -f '$proto_dir/kind.pb' -m 'DataSource=$XLSX_FILE|nest_alias|3,1' -m ProtoName=outer_alias_message -m OutputFile=next_alias.bin -m KeyRow=2 --require-mapping-all --list-keep-empty --enable-alias-mapping" + " -t lua -p protobuf -o '$proto_dir' -f '$proto_dir/kind.pb' -m 'DataSource=$XLSX_FILE|nest_alias|3,1' -m ProtoName=outer_alias_message -m OutputFile=next_alias.lua -m KeyRow=2 --pretty 2 --require-mapping-all --list-keep-empty --enable-alias-mapping" ) Write-Output "Write-Output '$($TASK_LINES -join "`n")' | java `"-Dfile.encoding=UTF-8`" `"-Dlog4j.appender.console.encoding=UTF-8`" -client -jar `"$XRESLOADER`" --stdin --data-version 1.0.0.0" $TASK_LINES -join "`n" | java "-Dfile.encoding=UTF-8" "-Dlog4j.appender.console.encoding=UTF-8" -client -jar "$XRESLOADER" --stdin --data-version 1.0.0.0 diff --git a/sample/gen_sample_output.sh b/sample/gen_sample_output.sh index 20e2fc63..840adfde 100755 --- a/sample/gen_sample_output.sh +++ b/sample/gen_sample_output.sh @@ -60,9 +60,11 @@ for proto_dir in proto_v2 proto_v3; do -t ue-json -o '$proto_dir/json' -f '$proto_dir/kind.pb' -m DataSource='$XLSX_FILE'|keep_or_strip_empty_list|3,1 -m ProtoName=keep_or_strip_empty_list_cfg -m OutputFile=StripListTailCfg.json -m KeyRow=2 -m UeCfg-CodeOutput=|Public/ConfigRec|Private/ConfigRec --list-strip-empty-tail -t ue-csv -o '$proto_dir/csv' -f '$proto_dir/kind.pb' -m DataSource='$XLSX_FILE'|keep_or_strip_empty_list|3,1 -m ProtoName=keep_or_strip_empty_list_cfg -m OutputFile=StripListTailCfg.csv -m KeyRow=2 -m UeCfg-CodeOutput=|Public/ConfigRec|Private/ConfigRec --list-strip-empty-tail -t bin -p protobuf -o '$proto_dir' -f '$proto_dir/kind.pb' -m DataSource='$XLSX_FILE'|keep_or_strip_empty_list|3,1 -m ProtoName=keep_or_strip_empty_list_cfg -m OutputFile=strip_list_tail_cfg.bin -m KeyRow=2 --list-strip-empty-tail - " -t json -p protobuf -o '$proto_dir' -f '$proto_dir/kind.pb' -m CallbackScript=cb_script.js -m DataSource='$XLSX_FILE'|process_by_script1|2,1 -m DataSource='$XLSX_FILE'|process_by_script2|2,1 -m ProtoName=process_by_script -m OutputFile=process_by_script.json -m KeyRow=1 --pretty 2 --list-strip-empty-tail" - " -t bin -p protobuf -o '$proto_dir' -f '$proto_dir/kind.pb' -m CallbackScript=cb_script.js -m DataSource='$XLSX_FILE'|process_by_script1|2,1 -m DataSource='$XLSX_FILE'|process_by_script2|2,1 -m ProtoName=process_by_script -m OutputFile=process_by_script.bin -m KeyRow=1 --list-strip-empty-tail" - " -t lua -p protobuf -o '$proto_dir' -f '$proto_dir/kind.pb' -m CallbackScript=cb_script.js -m DataSource='$XLSX_FILE'|process_by_script1|2,1 -m DataSource='$XLSX_FILE'|process_by_script2|2,1 -m ProtoName=process_by_script -m OutputFile=process_by_script.lua -m KeyRow=1 --pretty 2 --list-strip-empty-tail" + -t json -p protobuf -o '$proto_dir' -f '$proto_dir/kind.pb' -m CallbackScript=cb_script.js -m DataSource='$XLSX_FILE'|process_by_script1|2,1 -m DataSource='$XLSX_FILE'|process_by_script2|2,1 -m ProtoName=process_by_script -m OutputFile=process_by_script.json -m KeyRow=1 --pretty 2 --list-strip-empty-tail + -t bin -p protobuf -o '$proto_dir' -f '$proto_dir/kind.pb' -m CallbackScript=cb_script.js -m DataSource='$XLSX_FILE'|process_by_script1|2,1 -m DataSource='$XLSX_FILE'|process_by_script2|2,1 -m ProtoName=process_by_script -m OutputFile=process_by_script.bin -m KeyRow=1 --list-strip-empty-tail + -t lua -p protobuf -o '$proto_dir' -f '$proto_dir/kind.pb' -m CallbackScript=cb_script.js -m DataSource='$XLSX_FILE'|process_by_script1|2,1 -m DataSource='$XLSX_FILE'|process_by_script2|2,1 -m ProtoName=process_by_script -m OutputFile=process_by_script.lua -m KeyRow=1 --pretty 2 --list-strip-empty-tail + -t bin -p protobuf -o '$proto_dir' -f '$proto_dir/kind.pb' -m DataSource='$XLSX_FILE'|nest_alias|3,1 -m ProtoName=outer_alias_message -m OutputFile=next_alias.bin -m KeyRow=2 --require-mapping-all --list-keep-empty --enable-alias-mapping + -t lua -p protobuf -o '$proto_dir' -f '$proto_dir/kind.pb' -m DataSource='$XLSX_FILE'|nest_alias|3,1 -m ProtoName=outer_alias_message -m OutputFile=next_alias.lua -m KeyRow=2 --pretty 2 --require-mapping-all --list-keep-empty --enable-alias-mapping ' echo "Run with --stdin: $CMDS" diff --git a/sample/proto_v2/kind.desc.json b/sample/proto_v2/kind.desc.json index 0e430d32..844ffafd 100644 --- a/sample/proto_v2/kind.desc.json +++ b/sample/proto_v2/kind.desc.json @@ -405,6 +405,23 @@ "name": "event_rule_item", "oneof_decl": {"nested": {"name": "nested"}} }, + "inner_alias_message": { + "field": { + "iType": { + "name": "iType", + "number": 1, + "options": {"field_alias": ["Type"]}, + "type_name": "INT32" + }, + "paramList": { + "name": "paramList", + "number": 2, + "options": {"field_alias": ["Param"]}, + "type_name": "INT64" + } + }, + "name": "inner_alias_message" + }, "keep_or_strip_empty_list_cfg": { "field": { "array_int32": { @@ -480,6 +497,23 @@ }, "name": "large_file_test" }, + "outer_alias_message": { + "field": { + "iId": { + "name": "iId", + "number": 1, + "options": {"field_alias": ["ID"]}, + "type_name": "INT32" + }, + "inners": { + "name": "inners", + "number": 2, + "options": {"field_alias": ["Condition"]}, + "type_name": "MESSAGE" + } + }, + "name": "outer_alias_message" + }, "process_by_script": { "enum_type": { "MapU32StringEntry": { diff --git a/sample/proto_v2/kind.desc.lua b/sample/proto_v2/kind.desc.lua index 6ac72510..4464bd8b 100644 --- a/sample/proto_v2/kind.desc.lua +++ b/sample/proto_v2/kind.desc.lua @@ -299,6 +299,31 @@ local const_res = { }, name = "event_rule_item", }, + inner_alias_message = { + field = { + iType = { + name = "iType", + number = 1, + options = { + field_alias = { + "Type", + }, + }, + type_name = "INT32", + }, + paramList = { + name = "paramList", + number = 2, + options = { + field_alias = { + "Param", + }, + }, + type_name = "INT64", + }, + }, + name = "inner_alias_message", + }, keep_or_strip_empty_list_cfg = { field = { id = { @@ -316,6 +341,31 @@ local const_res = { helper = "helper", }, }, + outer_alias_message = { + field = { + iId = { + name = "iId", + number = 1, + options = { + field_alias = { + "ID", + }, + }, + type_name = "INT32", + }, + inners = { + name = "inners", + number = 2, + options = { + field_alias = { + "Condition", + }, + }, + type_name = "MESSAGE", + }, + }, + name = "outer_alias_message", + }, process_by_script = { enum_type = { MapU32StringEntry = { diff --git a/sample/proto_v2/kind.pb b/sample/proto_v2/kind.pb index b9cb8549dafcdd63cda0854021d614ac3a130291..dc060855b8530f654866717a6b1a5cd2eb8946bd 100755 GIT binary patch delta 219 zcmeyTc0yxA1ryUb<;_)0EQ0k)F8V1pT&$TPl?AC1 zj0%hztWNBU>{&qEAc&}t8W(3lVo_qQPiAq61d{@@2D1~#B74>VkXR5xN-2v=IKQ+6 z!*p>j=1k8NpxNFa!&w*EGkLlMfrNytxY)qXDF&O$Z6uo-f(;WM8*lMNV;r5LaGmaY=k)PG(}U1e1^q2cr-h2e&}JKmm~E5vUZX z65`F(W=VwYWGjJrw}+ C;5#$` literal 0 HcmV?d00001 diff --git a/sample/proto_v2/next_alias.lua b/sample/proto_v2/next_alias.lua new file mode 100644 index 00000000..13fb2068 --- /dev/null +++ b/sample/proto_v2/next_alias.lua @@ -0,0 +1,66 @@ +-- this file is generated by xresloader, please don't edit it. + +return { + [1] = { + count = 2, + data_source = { + { + count = 2, + file = "资源转换示例.xlsx", + sheet = "nest_alias", + }, + }, + data_ver = "1.0.0.0", + hash_code = "sha256:9a34adc87f8576240d82bfda90295964233c3e3102e3ca4889cea3d8b8b4157c", + xres_ver = "2.18.0", + }, + [2] = "outer_alias_message", + outer_alias_message = { + { + iId = 1, + inners = { + { + iType = 11, + paramList = { + 111, + 112, + }, + }, + { + iType = 12, + paramList = { + 121, + 122, + }, + }, + { + iType = 13, + paramList = { + 131, + 132, + }, + }, + }, + }, + { + iId = 2, + inners = { + { + iType = 21, + paramList = { + 211, + 212, + }, + }, + { + }, + { + iType = 23, + paramList = { + 231, + }, + }, + }, + }, + }, +} \ No newline at end of file diff --git a/sample/proto_v3/kind.desc.json b/sample/proto_v3/kind.desc.json index 77a01f72..e02d03b8 100644 --- a/sample/proto_v3/kind.desc.json +++ b/sample/proto_v3/kind.desc.json @@ -458,6 +458,23 @@ "name": "event_rule_item", "oneof_decl": {"nested": {"name": "nested"}} }, + "inner_alias_message": { + "field": { + "iType": { + "name": "iType", + "number": 1, + "options": {"field_alias": ["Type"]}, + "type_name": "INT32" + }, + "paramList": { + "name": "paramList", + "number": 2, + "options": {"field_alias": ["Param"]}, + "type_name": "INT64" + } + }, + "name": "inner_alias_message" + }, "keep_or_strip_empty_list_cfg": { "field": { "array_int32": { @@ -533,6 +550,23 @@ }, "name": "large_file_test" }, + "outer_alias_message": { + "field": { + "iId": { + "name": "iId", + "number": 1, + "options": {"field_alias": ["ID"]}, + "type_name": "INT32" + }, + "inners": { + "name": "inners", + "number": 2, + "options": {"field_alias": ["Condition"]}, + "type_name": "MESSAGE" + } + }, + "name": "outer_alias_message" + }, "process_by_script": { "enum_type": { "MapU32StringEntry": { diff --git a/sample/proto_v3/kind.desc.lua b/sample/proto_v3/kind.desc.lua index 72dd4fc7..5236cdb6 100644 --- a/sample/proto_v3/kind.desc.lua +++ b/sample/proto_v3/kind.desc.lua @@ -301,6 +301,31 @@ local const_res = { }, name = "event_rule_item", }, + inner_alias_message = { + field = { + iType = { + name = "iType", + number = 1, + options = { + field_alias = { + "Type", + }, + }, + type_name = "INT32", + }, + paramList = { + name = "paramList", + number = 2, + options = { + field_alias = { + "Param", + }, + }, + type_name = "INT64", + }, + }, + name = "inner_alias_message", + }, keep_or_strip_empty_list_cfg = { field = { id = { @@ -318,6 +343,31 @@ local const_res = { helper = "helper", }, }, + outer_alias_message = { + field = { + iId = { + name = "iId", + number = 1, + options = { + field_alias = { + "ID", + }, + }, + type_name = "INT32", + }, + inners = { + name = "inners", + number = 2, + options = { + field_alias = { + "Condition", + }, + }, + type_name = "MESSAGE", + }, + }, + name = "outer_alias_message", + }, process_by_script = { enum_type = { MapU32StringEntry = { diff --git a/sample/proto_v3/kind.pb b/sample/proto_v3/kind.pb index 3ff477073682ae097cbc0b0f0bc49d14e8018dcb..b042a473462d9aade78779f92c01cead39c88143 100755 GIT binary patch delta 227 zcmZ3c^Fen*2NTmXjm=$5Q-tf4Vz`7e^YT)Q;uCW+6N}?>Q;Ule(^G|HxmYtpDhpC2 z7!?>bSe@7x*|UJSK@d?PH7?GA#G=GppUmPC2_^+*4Q3~fMfR)#Ah95Xlu{O#aDHhC zhUwy5%$c4kK(m8EhO;iRXYzCj0tpFOaj}7&Qw%nh+ekzYi|d?t7TI$;=jWwlmSpDV Q1wnNru@w~Mm*g7*0AjmFNB{r; delta 24 fcmeyMyG&<82NTmA_03&OQ-nE^*b0jBOY)5Ybu9?2 diff --git a/sample/proto_v3/kind.proto b/sample/proto_v3/kind.proto index 0a748615..73b48b51 100755 --- a/sample/proto_v3/kind.proto +++ b/sample/proto_v3/kind.proto @@ -179,4 +179,14 @@ message large_file_test { float f32value = 5; string szvalue = 6; combine_id id_id = 7; -} \ No newline at end of file +} + +message inner_alias_message { + int32 iType = 1 [ (org.xresloader.field_alias) = "Type" ]; + repeated int64 paramList = 2 [ (org.xresloader.field_alias) = "Param" ]; +} + +message outer_alias_message { + int32 iId = 1 [ (org.xresloader.field_alias) = "ID" ]; + repeated inner_alias_message inners = 2 [ (org.xresloader.field_alias) = "Condition" ]; +} diff --git a/sample/proto_v3/kind_option.js b/sample/proto_v3/kind_option.js index 2514c595..1e193f8e 100644 --- a/sample/proto_v3/kind_option.js +++ b/sample/proto_v3/kind_option.js @@ -300,6 +300,31 @@ exports.files = [ }, name : "event_rule_item" }, + inner_alias_message : { + field : { + iType : { + name : "iType", + number : 1, + options : { + field_alias : [ + "Type" + ] + }, + type_name : "INT32" + }, + paramList : { + name : "paramList", + number : 2, + options : { + field_alias : [ + "Param" + ] + }, + type_name : "INT64" + } + }, + name : "inner_alias_message" + }, keep_or_strip_empty_list_cfg : { field : { id : { @@ -317,6 +342,31 @@ exports.files = [ helper : "helper" } }, + outer_alias_message : { + field : { + iId : { + name : "iId", + number : 1, + options : { + field_alias : [ + "ID" + ] + }, + type_name : "INT32" + }, + inners : { + name : "inners", + number : 2, + options : { + field_alias : [ + "Condition" + ] + }, + type_name : "MESSAGE" + } + }, + name : "outer_alias_message" + }, process_by_script : { enum_type : { MapU32StringEntry : { diff --git a/sample/proto_v3/kind_option.lua b/sample/proto_v3/kind_option.lua index b952860f..393cf15c 100644 --- a/sample/proto_v3/kind_option.lua +++ b/sample/proto_v3/kind_option.lua @@ -301,6 +301,31 @@ local const_res = { }, name = "event_rule_item", }, + inner_alias_message = { + field = { + iType = { + name = "iType", + number = 1, + options = { + field_alias = { + "Type", + }, + }, + type_name = "INT32", + }, + paramList = { + name = "paramList", + number = 2, + options = { + field_alias = { + "Param", + }, + }, + type_name = "INT64", + }, + }, + name = "inner_alias_message", + }, keep_or_strip_empty_list_cfg = { field = { id = { @@ -318,6 +343,31 @@ local const_res = { helper = "helper", }, }, + outer_alias_message = { + field = { + iId = { + name = "iId", + number = 1, + options = { + field_alias = { + "ID", + }, + }, + type_name = "INT32", + }, + inners = { + name = "inners", + number = 2, + options = { + field_alias = { + "Condition", + }, + }, + type_name = "MESSAGE", + }, + }, + name = "outer_alias_message", + }, process_by_script = { enum_type = { MapU32StringEntry = { diff --git a/sample/proto_v3/kind_option.mod.lua b/sample/proto_v3/kind_option.mod.lua index 09b02bf1..beb868fe 100644 --- a/sample/proto_v3/kind_option.mod.lua +++ b/sample/proto_v3/kind_option.mod.lua @@ -302,6 +302,31 @@ local const_res = { }, name = "event_rule_item", }, + inner_alias_message = { + field = { + iType = { + name = "iType", + number = 1, + options = { + field_alias = { + "Type", + }, + }, + type_name = "INT32", + }, + paramList = { + name = "paramList", + number = 2, + options = { + field_alias = { + "Param", + }, + }, + type_name = "INT64", + }, + }, + name = "inner_alias_message", + }, keep_or_strip_empty_list_cfg = { field = { id = { @@ -319,6 +344,31 @@ local const_res = { helper = "helper", }, }, + outer_alias_message = { + field = { + iId = { + name = "iId", + number = 1, + options = { + field_alias = { + "ID", + }, + }, + type_name = "INT32", + }, + inners = { + name = "inners", + number = 2, + options = { + field_alias = { + "Condition", + }, + }, + type_name = "MESSAGE", + }, + }, + name = "outer_alias_message", + }, process_by_script = { enum_type = { MapU32StringEntry = { diff --git a/sample/proto_v3/next_alias.bin b/sample/proto_v3/next_alias.bin new file mode 100644 index 0000000000000000000000000000000000000000..0b417ab790df6410e31edb7847186eaa1128e8eb GIT binary patch literal 211 zcmd;TW#nQr(lfNsGZ11o)H47<2__}?;*3NiQ!^{WG*csU^Q1Hri^Nm|lQaWE missingFields, HashMap name_list boolean test_passed = false; name_list.removeLast(); - name_list.addLast(DataDstWriterNode.makeNodeName(fd.getName(), count)); - if (test(c, name_list)) { - child = node.addChild(fd.getName(), c, fd, DataDstWriterNode.CHILD_NODE_TYPE.STANDARD); - ret = true; - test_passed = true; + // 检测使用的名字,message不允许混合别名。以防别名组合指数级膨胀 + String select_name = ""; + if (data_src.containsIdentifyMappingPrefix( + DataDstWriterNode.makeChildPath(prefix, fd.getName(), + count))) { + select_name = fd.getName(); } else if (null != field_alias) { for (String alias_name : field_alias) { String test_field_name = alias_name.strip(); if (test_field_name.isEmpty()) { continue; } - name_list.removeLast(); - name_list.addLast(DataDstWriterNode.makeNodeName(test_field_name, count)); - if (test(c, name_list)) { - child = node.addChild(fd.getName(), c, fd, - DataDstWriterNode.CHILD_NODE_TYPE.STANDARD); - ret = true; - test_passed = true; + + if (data_src.containsIdentifyMappingPrefix( + DataDstWriterNode.makeChildPath(prefix, test_field_name, + count))) { + select_name = test_field_name; break; } } } + name_list.addLast(DataDstWriterNode.makeNodeName(select_name, count)); + if (!select_name.isEmpty() && test(c, name_list)) { + child = node.addChild(fd.getName(), c, fd, DataDstWriterNode.CHILD_NODE_TYPE.STANDARD); + ret = true; + test_passed = true; + } if (!test_passed) { // try plain mode - array item @@ -1645,34 +1650,34 @@ private boolean testMessage(DataDstWriterNode node, LinkedList name_list DataDstWriterNode.JAVA_TYPE.MESSAGE, pbTypeToTypeLimit(fd.getType()), -1); boolean test_passed = false; - name_list.addLast(DataDstWriterNode.makeNodeName(fd.getName())); - if (test(c, name_list)) { - filterMissingFields(missingFields, oneofField, fd, false); - child = node.addChild(fd.getName(), c, fd, DataDstWriterNode.CHILD_NODE_TYPE.STANDARD); - ret = true; - test_passed = true; + // 检测使用的名字,message不允许混合别名。以防别名组合指数级膨胀 + String select_name = ""; + if (data_src.containsIdentifyMappingPrefix( + DataDstWriterNode.makeChildPath(prefix, fd.getName()))) { + select_name = fd.getName(); } else if (null != field_alias) { for (String alias_name : field_alias) { String test_field_name = alias_name.strip(); if (test_field_name.isEmpty()) { continue; } - name_list.removeLast(); - name_list.addLast(DataDstWriterNode.makeNodeName(test_field_name)); - if (test(c, name_list)) { - filterMissingFields(missingFields, oneofField, fd, false); - child = node.addChild(fd.getName(), c, fd, - DataDstWriterNode.CHILD_NODE_TYPE.STANDARD); - ret = true; - test_passed = true; + + if (data_src.containsIdentifyMappingPrefix( + DataDstWriterNode.makeChildPath(prefix, test_field_name))) { + select_name = test_field_name; break; } } } + name_list.addLast(DataDstWriterNode.makeNodeName(select_name)); + if (test(c, name_list)) { + filterMissingFields(missingFields, oneofField, fd, false); + child = node.addChild(fd.getName(), c, fd, DataDstWriterNode.CHILD_NODE_TYPE.STANDARD); + ret = true; + test_passed = true; + } if (!test_passed) { - filterMissingFields(missingFields, oneofField, fd, true); - // try plain mode String real_name = DataDstWriterNode.makeChildPath(prefix, fd.getName()); IdentifyDescriptor col = data_src.getColumnByName(real_name); @@ -1837,7 +1842,7 @@ private boolean testMessage(DataDstWriterNode node, LinkedList name_list for (Descriptors.OneofDescriptor fd : desc.getOneofs()) { if (node.getTypeDescriptor() == null) { setLastErrorMessage( - "type descriptor \"%s\" not found, it's probably a BUG, please report to %s, current version: %s", + "Type descriptor \"%s\" not found, it's probably a BUG, please report to %s, current version: %s", node.getFullName(), ProgramOptions.getReportUrl(), ProgramOptions.getInstance().getVersion()); throw new ConvException(getLastErrorMessage()); } @@ -1845,7 +1850,7 @@ private boolean testMessage(DataDstWriterNode node, LinkedList name_list DataDstOneofDescriptor oneof_inner_desc = node.getTypeDescriptor().oneofs.getOrDefault(fd.getName(), null); if (oneof_inner_desc == null) { setLastErrorMessage( - "oneof descriptor \"%s\" not found in type descriptor \"%s\", it's probably a BUG, please report to %s, current version: %s", + "Oneof descriptor \"%s\" not found in type descriptor \"%s\", it's probably a BUG, please report to %s, current version: %s", fd.getFullName(), node.getFullName(), ProgramOptions.getReportUrl(), ProgramOptions.getInstance().getVersion()); throw new ConvException(getLastErrorMessage()); @@ -1862,7 +1867,7 @@ private boolean testMessage(DataDstWriterNode node, LinkedList name_list String old_field = oneofField.getOrDefault(fd.getFullName(), null); if (old_field != null) { setLastErrorMessage( - "field \"%s\" in oneof descriptor \"%s\" already exists, can not add the oneof writer again", + "Field \"%s\" in oneof descriptor \"%s\" already exists, can not add the oneof writer again", old_field, fd.getFullName()); throw new ConvException(getLastErrorMessage()); } @@ -1877,9 +1882,9 @@ private boolean testMessage(DataDstWriterNode node, LinkedList name_list } if (require_mapping_all_fields) { - String missingFliedDesc = ""; + String missingFieldDesc = ""; if (missingFields != null && !missingFields.isEmpty()) { - missingFliedDesc = String.format(" fields %s", String.join(",", missingFields)); + missingFieldDesc = String.format(" fields %s", String.join(",", missingFields)); } String missingOneofDesc = ""; @@ -1894,9 +1899,14 @@ private boolean testMessage(DataDstWriterNode node, LinkedList name_list missingOneofDesc = String.format(" oneof %s", String.join(",", missingOneofs)); } - if (!missingFliedDesc.isEmpty() || !missingOneofDesc.isEmpty()) { - setLastErrorMessage("message %s in %s can not find%s%s in data source", desc.getFullName(), prefix, - missingFliedDesc, missingOneofDesc); + if (!missingFieldDesc.isEmpty() || !missingOneofDesc.isEmpty()) { + if (prefix.isEmpty()) { + setLastErrorMessage("Message %s can not find%s%s in data source", desc.getFullName(), + missingFieldDesc, missingOneofDesc); + } else { + setLastErrorMessage("Message %s in %s can not find%s%s in data source", desc.getFullName(), prefix, + missingFieldDesc, missingOneofDesc); + } throw new ConvException(getLastErrorMessage()); } } diff --git a/src/org/xresloader/core/data/src/DataSrcExcel.java b/src/org/xresloader/core/data/src/DataSrcExcel.java index ced854d4..8a957c47 100644 --- a/src/org/xresloader/core/data/src/DataSrcExcel.java +++ b/src/org/xresloader/core/data/src/DataSrcExcel.java @@ -27,6 +27,7 @@ private class DataSheetInfo { public int lastRowNumber = -1; public HashMap nameMapping = new HashMap(); public LinkedList indexMapping = new LinkedList(); + public HashMap identifyPrefixAvailable = new HashMap(); } private HashMap macros = null; @@ -261,7 +262,7 @@ private int init_sheet() { DataContainer k = getStringCache(""); ExcelEngine.cell2s(k, rowWrapper, column_ident, res.formula); IdentifyDescriptor ident = IdentifyEngine.n2i(k.get(), i); - String[] multipleNames = ident.name.split("[,;|]"); + String[] multipleNames = ident.name.split("[,;\\|]"); if (multipleNames.length > 1) { for (String realName : multipleNames) { String trimName = realName.trim(); @@ -413,6 +414,34 @@ public IdentifyDescriptor getColumnByName(String _name) { return current.nameMapping.getOrDefault(_name, null); } + @Override + public boolean containsIdentifyMappingPrefix(String _name) { + var ret = current.identifyPrefixAvailable.getOrDefault(_name, null); + if (ret != null) { + return ret.booleanValue(); + } + + boolean res = false; + for (HashMap.Entry ident : current.nameMapping.entrySet()) { + if (!ident.getKey().startsWith(_name)) { + continue; + } + + if (ident.getKey().length() == _name.length()) { + res = true; + break; + } + + if (ident.getKey().charAt(_name.length()) == '.' || ident.getKey().charAt(_name.length()) == '[') { + res = true; + break; + } + } + + current.identifyPrefixAvailable.put(_name, res); + return res; + } + @Override public HashMap getMacros() { return macros; diff --git a/src/org/xresloader/core/data/src/DataSrcImpl.java b/src/org/xresloader/core/data/src/DataSrcImpl.java index 1dfa2711..72465cca 100644 --- a/src/org/xresloader/core/data/src/DataSrcImpl.java +++ b/src/org/xresloader/core/data/src/DataSrcImpl.java @@ -163,6 +163,10 @@ public IdentifyDescriptor getColumnByName(String _name) { return null; } + public boolean containsIdentifyMappingPrefix(String _name) { + return false; + } + public HashMap getMacros() { return null; } From f4cb0930eeab03971277f2c455af8a4a83b173e6 Mon Sep 17 00:00:00 2001 From: owent <> Date: Thu, 25 Jul 2024 23:40:01 +0800 Subject: [PATCH 07/10] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=80=82=E9=85=8DExcel?= =?UTF-8?q?=E5=AF=B9=E5=A4=A7=E6=95=B0=E5=AD=97=E8=87=AA=E5=8A=A8=E9=99=84?= =?UTF-8?q?=E5=8A=A0=E7=9A=84=20`,`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sample/proto_v2/next_alias.bin | Bin 210 -> 216 bytes sample/proto_v2/next_alias.lua | 6 +++--- sample/proto_v3/next_alias.bin | Bin 211 -> 217 bytes sample/proto_v3/next_alias.lua | 6 +++--- ...54\346\215\242\347\244\272\344\276\213.xlsx" | 4 ++-- .../core/data/vfy/DataVerifyImpl.java | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/sample/proto_v2/next_alias.bin b/sample/proto_v2/next_alias.bin index eb3de9755be9ffcc10aee1cc054d4c189c83491c..a8b3e473333d51201507afc75606441526941583 100644 GIT binary patch delta 102 zcmcb_c!P0*yhDn4Qj(>4vSqSiijhUCX_}##nW3?fp>dL>MUt7RWs<3RN{V5Md5WQh zk%4iVVRDjXl4VMYMVh6tWvXSWk>SL6EiQQuMj=j)0~_bFPMjdlCBeZY#LaQwUL)7U Gbt(YgJsj5n delta 115 zcmcb?c!_a>yn~5xQldqwsi{Gdd7`DIL29yriFu+?Vw!nMVp5t#a$1U+MUr7svZ1kw zVX~Q-QKE&RrKyRTrJ1prNn&!MMdHMGEmau~MjxestgCC5E}=#5L12ukmeC$s;m;?;NTTvX=ZF; P6cXcL0`f#BZczmQ1il+E diff --git a/sample/proto_v3/next_alias.lua b/sample/proto_v3/next_alias.lua index 13fb2068..dbde6b3a 100644 --- a/sample/proto_v3/next_alias.lua +++ b/sample/proto_v3/next_alias.lua @@ -11,7 +11,7 @@ return { }, }, data_ver = "1.0.0.0", - hash_code = "sha256:9a34adc87f8576240d82bfda90295964233c3e3102e3ca4889cea3d8b8b4157c", + hash_code = "sha256:f7be6e49644c9dc400f09df3c23276e0c1f3c233fa208720999ca0e6db00afd6", xres_ver = "2.18.0", }, [2] = "outer_alias_message", @@ -20,7 +20,7 @@ return { iId = 1, inners = { { - iType = 11, + iType = 11000000, paramList = { 111, 112, @@ -46,7 +46,7 @@ return { iId = 2, inners = { { - iType = 21, + iType = 21000000, paramList = { 211, 212, diff --git "a/sample/\350\265\204\346\272\220\350\275\254\346\215\242\347\244\272\344\276\213.xlsx" "b/sample/\350\265\204\346\272\220\350\275\254\346\215\242\347\244\272\344\276\213.xlsx" index 1747ae6f..456c25f4 100755 --- "a/sample/\350\265\204\346\272\220\350\275\254\346\215\242\347\244\272\344\276\213.xlsx" +++ "b/sample/\350\265\204\346\272\220\350\275\254\346\215\242\347\244\272\344\276\213.xlsx" @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ea92a316b9def76fbdc39e0aec9757a99f5a4a05e6d015c81fbfd24b19223cb1 -size 39441 +oid sha256:40dcdf622e8473b753dddb8d2eb9c0f0d0eba5b5c29f0885a0876127c175ca0f +size 39489 diff --git a/src/org/xresloader/core/data/vfy/DataVerifyImpl.java b/src/org/xresloader/core/data/vfy/DataVerifyImpl.java index 3513e681..63949dd4 100644 --- a/src/org/xresloader/core/data/vfy/DataVerifyImpl.java +++ b/src/org/xresloader/core/data/vfy/DataVerifyImpl.java @@ -62,7 +62,7 @@ private static double doubleValueOf(String input) { private static long longValueOf(String input) { Matcher matcher = INTEGER_WITH_DOT_PATTERN.get().matcher(input); if (matcher.matches()) { - return Long.valueOf(matcher.group(1).trim()); + return Long.valueOf(input.replaceAll(",", "").trim()); } return Long.valueOf(input); } From aeb5d373b69415c5ccd46aa7f52049659611a9e9 Mon Sep 17 00:00:00 2001 From: owent <> Date: Thu, 25 Jul 2024 23:40:34 +0800 Subject: [PATCH 08/10] Update README --- HISTORY.md | 1 + 1 file changed, 1 insertion(+) diff --git a/HISTORY.md b/HISTORY.md index 1992f76c..314a78ab 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -9,6 +9,7 @@ 3. 增加插件 `org.xresloader.field_list_max_size="|枚举名"` 用于给单个字段数组最大长度要求。 4. 增加选项 `--disable-alias-mapping` 用于关闭字段映射时使用别名。 5. 修复使用别名时,message结构未被正确映射的问题。 +6. 修复对Excel对大数字自动附加的 `,` 的适配。 ### BREAKCHANGES From 10f5616ed800c7b4ac4b62116dae38f291bc4e27 Mon Sep 17 00:00:00 2001 From: owent <> Date: Fri, 26 Jul 2024 17:36:32 +0800 Subject: [PATCH 09/10] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AF=B9=E9=9D=9E?= =?UTF-8?q?=E8=A3=81=E5=89=AA=E6=A8=A1=E5=BC=8F=E4=B8=8B=E7=9A=84=E6=95=B0?= =?UTF-8?q?=E7=BB=84=E6=95=B0=E6=8D=AE=E8=87=AA=E5=8A=A8=E8=A1=A5=E5=85=A8?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HISTORY.md | 1 + sample/cxx/v2/kind.pb.cc | 73 ++++++++--- sample/cxx/v2/kind.pb.h | 71 ++++++++++- sample/cxx/v3/kind.pb.cc | 75 +++++++++--- sample/cxx/v3/kind.pb.h | 72 ++++++++++- sample/proto_v2/kind.desc.json | 14 ++- sample/proto_v2/kind.desc.lua | 12 ++ sample/proto_v2/kind.pb | Bin 5192 -> 5237 bytes sample/proto_v2/kind.proto | 7 +- sample/proto_v2/kind_option.js | 14 ++- sample/proto_v2/kind_option.lua | 12 ++ sample/proto_v2/kind_option.mod.lua | 12 ++ sample/proto_v2/next_alias.bin | Bin 216 -> 256 bytes sample/proto_v2/next_alias.lua | 23 +++- sample/proto_v3/kind.desc.json | 14 ++- sample/proto_v3/kind.desc.lua | 12 ++ sample/proto_v3/kind.pb | Bin 5872 -> 5917 bytes sample/proto_v3/kind.proto | 7 +- sample/proto_v3/kind_option.js | 14 ++- sample/proto_v3/kind_option.lua | 12 ++ sample/proto_v3/kind_option.mod.lua | 12 ++ sample/proto_v3/next_alias.bin | Bin 217 -> 247 bytes sample/proto_v3/next_alias.lua | 23 +++- ...\346\215\242\347\244\272\344\276\213.xlsx" | 4 +- .../xresloader/core/data/dst/DataDstJava.java | 115 +++++++++++++----- .../xresloader/core/data/dst/DataDstPb.java | 54 +++++--- 26 files changed, 550 insertions(+), 103 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 314a78ab..d0e44c71 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -10,6 +10,7 @@ 4. 增加选项 `--disable-alias-mapping` 用于关闭字段映射时使用别名。 5. 修复使用别名时,message结构未被正确映射的问题。 6. 修复对Excel对大数字自动附加的 `,` 的适配。 +7. 修复对非裁剪模式下的数组数据自动补全问题。 ### BREAKCHANGES diff --git a/sample/cxx/v2/kind.pb.cc b/sample/cxx/v2/kind.pb.cc index 681e732e..6e7cd064 100755 --- a/sample/cxx/v2/kind.pb.cc +++ b/sample/cxx/v2/kind.pb.cc @@ -228,6 +228,7 @@ inline constexpr outer_alias_message::Impl_::Impl_( ::_pbi::ConstantInitialized) noexcept : _cached_size_{0}, inners_{}, + nest_int_{}, iid_{0} {} template @@ -761,8 +762,10 @@ const ::uint32_t ~0u, // no sizeof(Split) PROTOBUF_FIELD_OFFSET(::outer_alias_message, _impl_.iid_), PROTOBUF_FIELD_OFFSET(::outer_alias_message, _impl_.inners_), + PROTOBUF_FIELD_OFFSET(::outer_alias_message, _impl_.nest_int_), 0, ~0u, + ~0u, }; static const ::_pbi::MigrationSchema @@ -785,7 +788,7 @@ static const ::_pbi::MigrationSchema {268, 281, -1, sizeof(::process_by_script)}, {286, 301, -1, sizeof(::large_file_test)}, {308, 318, -1, sizeof(::inner_alias_message)}, - {320, 330, -1, sizeof(::outer_alias_message)}, + {320, 331, -1, sizeof(::outer_alias_message)}, }; static const ::_pb::Message* const file_default_instances[] = { &::_role_cfg_default_instance_._instance, @@ -897,11 +900,12 @@ const char descriptor_table_protodef_kind_2eproto[] ABSL_ATTRIBUTE_SECTION_VARIA "\n\n\002id\030\001 \001(\r\022\020\n\010i32value\030\002 \001(\005\022\020\n\010u64valu" "e\030\003 \001(\004\022\020\n\010f64value\030\004 \001(\001\022\020\n\010f32value\030\005 " "\001(\002\022\017\n\007szvalue\030\006 \001(\t\022\032\n\005id_id\030\007 \001(\0132\013.co" - "mbine_id\"J\n\023inner_alias_message\022\026\n\005iType" - "\030\001 \001(\005B\007\242\?\004Type\022\033\n\tparamList\030\002 \003(\003B\010\242\?\005P" - "aram\"]\n\023outer_alias_message\022\022\n\003iId\030\001 \001(\005" - "B\005\242\?\002ID\0222\n\006inners\030\002 \003(\0132\024.inner_alias_me" - "ssageB\014\242\?\tCondition" + "mbine_id\"N\n\023inner_alias_message\022\026\n\005iType" + "\030\001 \001(\005B\007\242\?\004Type\022\037\n\tparamList\030\002 \003(\003B\014\242\?\005P" + "aram\332\?\0012\"|\n\023outer_alias_message\022\022\n\003iId\030\001" + " \001(\005B\005\242\?\002ID\0222\n\006inners\030\002 \003(\0132\024.inner_alia" + "s_messageB\014\242\?\tCondition\022\035\n\010nest_int\030\003 \003(" + "\005B\013\242\?\004Nest\332\?\0012" }; static const ::_pbi::DescriptorTable* const descriptor_table_kind_2eproto_deps[6] = { @@ -916,7 +920,7 @@ static ::absl::once_flag descriptor_table_kind_2eproto_once; PROTOBUF_CONSTINIT const ::_pbi::DescriptorTable descriptor_table_kind_2eproto = { false, false, - 3659, + 3694, descriptor_table_protodef_kind_2eproto, "kind.proto", &descriptor_table_kind_2eproto_once, @@ -5826,7 +5830,7 @@ const ::_pbi::TcParseTable<1, 2, 0, 0, 2> inner_alias_message::_table_ = { ::_pbi::TcParser::GetTable<::inner_alias_message>(), // to_prefetch #endif // PROTOBUF_PREFETCH_PARSE_TABLE }, {{ - // repeated int64 paramList = 2 [(.org.xresloader.field_alias) = "Param"]; + // repeated int64 paramList = 2 [(.org.xresloader.field_alias) = "Param", (.org.xresloader.field_list_min_size) = "2"]; {::_pbi::TcParser::FastV64R1, {16, 63, 0, PROTOBUF_FIELD_OFFSET(inner_alias_message, _impl_.paramlist_)}}, // optional int32 iType = 1 [(.org.xresloader.field_alias) = "Type"]; @@ -5838,7 +5842,7 @@ const ::_pbi::TcParseTable<1, 2, 0, 0, 2> inner_alias_message::_table_ = { // optional int32 iType = 1 [(.org.xresloader.field_alias) = "Type"]; {PROTOBUF_FIELD_OFFSET(inner_alias_message, _impl_.itype_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kInt32)}, - // repeated int64 paramList = 2 [(.org.xresloader.field_alias) = "Param"]; + // repeated int64 paramList = 2 [(.org.xresloader.field_alias) = "Param", (.org.xresloader.field_list_min_size) = "2"]; {PROTOBUF_FIELD_OFFSET(inner_alias_message, _impl_.paramlist_), -1, 0, (0 | ::_fl::kFcRepeated | ::_fl::kInt64)}, }}, @@ -5875,7 +5879,7 @@ ::uint8_t* inner_alias_message::_InternalSerialize( stream, this->_internal_itype(), target); } - // repeated int64 paramList = 2 [(.org.xresloader.field_alias) = "Param"]; + // repeated int64 paramList = 2 [(.org.xresloader.field_alias) = "Param", (.org.xresloader.field_list_min_size) = "2"]; for (int i = 0, n = this->_internal_paramlist_size(); i < n; ++i) { target = stream->EnsureSpace(target); target = ::_pbi::WireFormatLite::WriteInt64ToArray( @@ -5900,7 +5904,7 @@ ::size_t inner_alias_message::ByteSizeLong() const { (void) cached_has_bits; ::_pbi::Prefetch5LinesFrom7Lines(reinterpret_cast(this)); - // repeated int64 paramList = 2 [(.org.xresloader.field_alias) = "Param"]; + // repeated int64 paramList = 2 [(.org.xresloader.field_alias) = "Param", (.org.xresloader.field_list_min_size) = "2"]; { std::size_t data_size = ::_pbi::WireFormatLite::Int64Size( this->_internal_paramlist()) @@ -5977,7 +5981,8 @@ inline PROTOBUF_NDEBUG_INLINE outer_alias_message::Impl_::Impl_( const Impl_& from, const ::outer_alias_message& from_msg) : _has_bits_{from._has_bits_}, _cached_size_{0}, - inners_{visibility, arena, from.inners_} {} + inners_{visibility, arena, from.inners_}, + nest_int_{visibility, arena, from.nest_int_} {} outer_alias_message::outer_alias_message( ::google::protobuf::Arena* arena, @@ -5996,7 +6001,8 @@ inline PROTOBUF_NDEBUG_INLINE outer_alias_message::Impl_::Impl_( ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* arena) : _cached_size_{0}, - inners_{visibility, arena} {} + inners_{visibility, arena}, + nest_int_{visibility, arena} {} inline void outer_alias_message::SharedCtor(::_pb::Arena* arena) { new (&_impl_) Impl_(internal_visibility(), arena); @@ -6033,15 +6039,15 @@ outer_alias_message::GetClassData() const { return _data_.base(); } PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<1, 2, 1, 0, 2> outer_alias_message::_table_ = { +const ::_pbi::TcParseTable<2, 3, 1, 0, 2> outer_alias_message::_table_ = { { PROTOBUF_FIELD_OFFSET(outer_alias_message, _impl_._has_bits_), 0, // no _extensions_ - 2, 8, // max_field_number, fast_idx_mask + 3, 24, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294967292, // skipmap + 4294967288, // skipmap offsetof(decltype(_table_), field_entries), - 2, // num_field_entries + 3, // num_field_entries 1, // num_aux_entries offsetof(decltype(_table_), aux_entries), &_outer_alias_message_default_instance_._instance, @@ -6051,12 +6057,16 @@ const ::_pbi::TcParseTable<1, 2, 1, 0, 2> outer_alias_message::_table_ = { ::_pbi::TcParser::GetTable<::outer_alias_message>(), // to_prefetch #endif // PROTOBUF_PREFETCH_PARSE_TABLE }, {{ - // repeated .inner_alias_message inners = 2 [(.org.xresloader.field_alias) = "Condition"]; - {::_pbi::TcParser::FastMtR1, - {18, 63, 0, PROTOBUF_FIELD_OFFSET(outer_alias_message, _impl_.inners_)}}, + {::_pbi::TcParser::MiniParse, {}}, // optional int32 iId = 1 [(.org.xresloader.field_alias) = "ID"]; {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(outer_alias_message, _impl_.iid_), 0>(), {8, 0, 0, PROTOBUF_FIELD_OFFSET(outer_alias_message, _impl_.iid_)}}, + // repeated .inner_alias_message inners = 2 [(.org.xresloader.field_alias) = "Condition"]; + {::_pbi::TcParser::FastMtR1, + {18, 63, 0, PROTOBUF_FIELD_OFFSET(outer_alias_message, _impl_.inners_)}}, + // repeated int32 nest_int = 3 [(.org.xresloader.field_alias) = "Nest", (.org.xresloader.field_list_min_size) = "2"]; + {::_pbi::TcParser::FastV32R1, + {24, 63, 0, PROTOBUF_FIELD_OFFSET(outer_alias_message, _impl_.nest_int_)}}, }}, {{ 65535, 65535 }}, {{ @@ -6066,6 +6076,9 @@ const ::_pbi::TcParseTable<1, 2, 1, 0, 2> outer_alias_message::_table_ = { // repeated .inner_alias_message inners = 2 [(.org.xresloader.field_alias) = "Condition"]; {PROTOBUF_FIELD_OFFSET(outer_alias_message, _impl_.inners_), -1, 0, (0 | ::_fl::kFcRepeated | ::_fl::kMessage | ::_fl::kTvTable)}, + // repeated int32 nest_int = 3 [(.org.xresloader.field_alias) = "Nest", (.org.xresloader.field_list_min_size) = "2"]; + {PROTOBUF_FIELD_OFFSET(outer_alias_message, _impl_.nest_int_), -1, 0, + (0 | ::_fl::kFcRepeated | ::_fl::kInt32)}, }}, {{ {::_pbi::TcParser::GetTable<::inner_alias_message>()}, }}, {{ @@ -6080,6 +6093,7 @@ PROTOBUF_NOINLINE void outer_alias_message::Clear() { (void) cached_has_bits; _impl_.inners_.Clear(); + _impl_.nest_int_.Clear(); _impl_.iid_ = 0; _impl_._has_bits_.Clear(); _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); @@ -6111,6 +6125,13 @@ ::uint8_t* outer_alias_message::_InternalSerialize( target, stream); } + // repeated int32 nest_int = 3 [(.org.xresloader.field_alias) = "Nest", (.org.xresloader.field_list_min_size) = "2"]; + for (int i = 0, n = this->_internal_nest_int_size(); i < n; ++i) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteInt32ToArray( + 3, this->_internal_nest_int().Get(i), target); + } + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( @@ -6134,6 +6155,16 @@ ::size_t outer_alias_message::ByteSizeLong() const { for (const auto& msg : this->_internal_inners()) { total_size += ::google::protobuf::internal::WireFormatLite::MessageSize(msg); } + // repeated int32 nest_int = 3 [(.org.xresloader.field_alias) = "Nest", (.org.xresloader.field_list_min_size) = "2"]; + { + std::size_t data_size = ::_pbi::WireFormatLite::Int32Size( + this->_internal_nest_int()) + ; + std::size_t tag_size = std::size_t{1} * + ::_pbi::FromIntSize(this->_internal_nest_int_size()); + ; + total_size += tag_size + data_size; + } // optional int32 iId = 1 [(.org.xresloader.field_alias) = "ID"]; cached_has_bits = _impl_._has_bits_[0]; if (cached_has_bits & 0x00000001u) { @@ -6155,6 +6186,7 @@ void outer_alias_message::MergeImpl(::google::protobuf::MessageLite& to_msg, con _this->_internal_mutable_inners()->MergeFrom( from._internal_inners()); + _this->_internal_mutable_nest_int()->MergeFrom(from._internal_nest_int()); cached_has_bits = from._impl_._has_bits_[0]; if (cached_has_bits & 0x00000001u) { _this->_impl_.iid_ = from._impl_.iid_; @@ -6176,6 +6208,7 @@ void outer_alias_message::InternalSwap(outer_alias_message* PROTOBUF_RESTRICT ot _internal_metadata_.InternalSwap(&other->_internal_metadata_); swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); _impl_.inners_.InternalSwap(&other->_impl_.inners_); + _impl_.nest_int_.InternalSwap(&other->_impl_.nest_int_); swap(_impl_.iid_, other->_impl_.iid_); } diff --git a/sample/cxx/v2/kind.pb.h b/sample/cxx/v2/kind.pb.h index ee0e093b..a7868e11 100755 --- a/sample/cxx/v2/kind.pb.h +++ b/sample/cxx/v2/kind.pb.h @@ -725,7 +725,7 @@ class inner_alias_message final : public ::google::protobuf::Message kParamListFieldNumber = 2, kITypeFieldNumber = 1, }; - // repeated int64 paramList = 2 [(.org.xresloader.field_alias) = "Param"]; + // repeated int64 paramList = 2 [(.org.xresloader.field_alias) = "Param", (.org.xresloader.field_list_min_size) = "2"]; int paramlist_size() const; private: int _internal_paramlist_size() const; @@ -1848,6 +1848,7 @@ class outer_alias_message final : public ::google::protobuf::Message // accessors ------------------------------------------------------- enum : int { kInnersFieldNumber = 2, + kNestIntFieldNumber = 3, kIIdFieldNumber = 1, }; // repeated .inner_alias_message inners = 2 [(.org.xresloader.field_alias) = "Condition"]; @@ -1867,6 +1868,24 @@ class outer_alias_message final : public ::google::protobuf::Message const ::inner_alias_message& inners(int index) const; ::inner_alias_message* add_inners(); const ::google::protobuf::RepeatedPtrField<::inner_alias_message>& inners() const; + // repeated int32 nest_int = 3 [(.org.xresloader.field_alias) = "Nest", (.org.xresloader.field_list_min_size) = "2"]; + int nest_int_size() const; + private: + int _internal_nest_int_size() const; + + public: + void clear_nest_int() ; + ::int32_t nest_int(int index) const; + void set_nest_int(int index, ::int32_t value); + void add_nest_int(::int32_t value); + const ::google::protobuf::RepeatedField<::int32_t>& nest_int() const; + ::google::protobuf::RepeatedField<::int32_t>* mutable_nest_int(); + + private: + const ::google::protobuf::RepeatedField<::int32_t>& _internal_nest_int() const; + ::google::protobuf::RepeatedField<::int32_t>* _internal_mutable_nest_int(); + + public: // optional int32 iId = 1 [(.org.xresloader.field_alias) = "ID"]; bool has_iid() const; void clear_iid() ; @@ -1883,7 +1902,7 @@ class outer_alias_message final : public ::google::protobuf::Message class _Internal; friend class ::google::protobuf::internal::TcParser; static const ::google::protobuf::internal::TcParseTable< - 1, 2, 1, + 2, 3, 1, 0, 2> _table_; @@ -1907,6 +1926,7 @@ class outer_alias_message final : public ::google::protobuf::Message ::google::protobuf::internal::HasBits<1> _has_bits_; mutable ::google::protobuf::internal::CachedSize _cached_size_; ::google::protobuf::RepeatedPtrField< ::inner_alias_message > inners_; + ::google::protobuf::RepeatedField<::int32_t> nest_int_; ::int32_t iid_; PROTOBUF_TSAN_DECLARE_MEMBER }; @@ -7660,7 +7680,7 @@ inline void inner_alias_message::_internal_set_itype(::int32_t value) { _impl_.itype_ = value; } -// repeated int64 paramList = 2 [(.org.xresloader.field_alias) = "Param"]; +// repeated int64 paramList = 2 [(.org.xresloader.field_alias) = "Param", (.org.xresloader.field_list_min_size) = "2"]; inline int inner_alias_message::_internal_paramlist_size() const { return _internal_paramlist().size(); } @@ -7786,6 +7806,51 @@ outer_alias_message::_internal_mutable_inners() { return &_impl_.inners_; } +// repeated int32 nest_int = 3 [(.org.xresloader.field_alias) = "Nest", (.org.xresloader.field_list_min_size) = "2"]; +inline int outer_alias_message::_internal_nest_int_size() const { + return _internal_nest_int().size(); +} +inline int outer_alias_message::nest_int_size() const { + return _internal_nest_int_size(); +} +inline void outer_alias_message::clear_nest_int() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.nest_int_.Clear(); +} +inline ::int32_t outer_alias_message::nest_int(int index) const { + // @@protoc_insertion_point(field_get:outer_alias_message.nest_int) + return _internal_nest_int().Get(index); +} +inline void outer_alias_message::set_nest_int(int index, ::int32_t value) { + _internal_mutable_nest_int()->Set(index, value); + // @@protoc_insertion_point(field_set:outer_alias_message.nest_int) +} +inline void outer_alias_message::add_nest_int(::int32_t value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _internal_mutable_nest_int()->Add(value); + // @@protoc_insertion_point(field_add:outer_alias_message.nest_int) +} +inline const ::google::protobuf::RepeatedField<::int32_t>& outer_alias_message::nest_int() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_list:outer_alias_message.nest_int) + return _internal_nest_int(); +} +inline ::google::protobuf::RepeatedField<::int32_t>* outer_alias_message::mutable_nest_int() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_mutable_list:outer_alias_message.nest_int) + ::google::protobuf::internal::TSanWrite(&_impl_); + return _internal_mutable_nest_int(); +} +inline const ::google::protobuf::RepeatedField<::int32_t>& +outer_alias_message::_internal_nest_int() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.nest_int_; +} +inline ::google::protobuf::RepeatedField<::int32_t>* outer_alias_message::_internal_mutable_nest_int() { + ::google::protobuf::internal::TSanRead(&_impl_); + return &_impl_.nest_int_; +} + #ifdef __GNUC__ #pragma GCC diagnostic pop #endif // __GNUC__ diff --git a/sample/cxx/v3/kind.pb.cc b/sample/cxx/v3/kind.pb.cc index cf6b9e52..85716d15 100755 --- a/sample/cxx/v3/kind.pb.cc +++ b/sample/cxx/v3/kind.pb.cc @@ -204,6 +204,8 @@ PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT inline constexpr outer_alias_message::Impl_::Impl_( ::_pbi::ConstantInitialized) noexcept : inners_{}, + nest_int_{}, + _nest_int_cached_byte_size_{0}, iid_{0}, _cached_size_{0} {} @@ -782,6 +784,7 @@ const ::uint32_t ~0u, // no sizeof(Split) PROTOBUF_FIELD_OFFSET(::outer_alias_message, _impl_.iid_), PROTOBUF_FIELD_OFFSET(::outer_alias_message, _impl_.inners_), + PROTOBUF_FIELD_OFFSET(::outer_alias_message, _impl_.nest_int_), }; static const ::_pbi::MigrationSchema @@ -931,12 +934,12 @@ const char descriptor_table_protodef_kind_2eproto[] ABSL_ATTRIBUTE_SECTION_VARIA "\017large_file_test\022\n\n\002id\030\001 \001(\r\022\020\n\010i32value" "\030\002 \001(\005\022\020\n\010u64value\030\003 \001(\004\022\020\n\010f64value\030\004 \001" "(\001\022\020\n\010f32value\030\005 \001(\002\022\017\n\007szvalue\030\006 \001(\t\022\032\n" - "\005id_id\030\007 \001(\0132\013.combine_id\"J\n\023inner_alias" - "_message\022\026\n\005iType\030\001 \001(\005B\007\242\?\004Type\022\033\n\tpara" - "mList\030\002 \003(\003B\010\242\?\005Param\"]\n\023outer_alias_mes" - "sage\022\022\n\003iId\030\001 \001(\005B\005\242\?\002ID\0222\n\006inners\030\002 \003(\013" - "2\024.inner_alias_messageB\014\242\?\tConditionb\006pr" - "oto3" + "\005id_id\030\007 \001(\0132\013.combine_id\"N\n\023inner_alias" + "_message\022\026\n\005iType\030\001 \001(\005B\007\242\?\004Type\022\037\n\tpara" + "mList\030\002 \003(\003B\014\242\?\005Param\332\?\0012\"|\n\023outer_alias" + "_message\022\022\n\003iId\030\001 \001(\005B\005\242\?\002ID\0222\n\006inners\030\002" + " \003(\0132\024.inner_alias_messageB\014\242\?\tCondition" + "\022\035\n\010nest_int\030\003 \003(\005B\013\242\?\004Nest\332\?\0012b\006proto3" }; static const ::_pbi::DescriptorTable* const descriptor_table_kind_2eproto_deps[6] = { @@ -951,7 +954,7 @@ static ::absl::once_flag descriptor_table_kind_2eproto_once; PROTOBUF_CONSTINIT const ::_pbi::DescriptorTable descriptor_table_kind_2eproto = { false, false, - 4204, + 4239, descriptor_table_protodef_kind_2eproto, "kind.proto", &descriptor_table_kind_2eproto_once, @@ -6350,7 +6353,7 @@ const ::_pbi::TcParseTable<1, 2, 0, 0, 2> inner_alias_message::_table_ = { ::_pbi::TcParser::GetTable<::inner_alias_message>(), // to_prefetch #endif // PROTOBUF_PREFETCH_PARSE_TABLE }, {{ - // repeated int64 paramList = 2 [(.org.xresloader.field_alias) = "Param"]; + // repeated int64 paramList = 2 [(.org.xresloader.field_alias) = "Param", (.org.xresloader.field_list_min_size) = "2"]; {::_pbi::TcParser::FastV64P1, {18, 63, 0, PROTOBUF_FIELD_OFFSET(inner_alias_message, _impl_.paramlist_)}}, // int32 iType = 1 [(.org.xresloader.field_alias) = "Type"]; @@ -6362,7 +6365,7 @@ const ::_pbi::TcParseTable<1, 2, 0, 0, 2> inner_alias_message::_table_ = { // int32 iType = 1 [(.org.xresloader.field_alias) = "Type"]; {PROTOBUF_FIELD_OFFSET(inner_alias_message, _impl_.itype_), 0, 0, (0 | ::_fl::kFcSingular | ::_fl::kInt32)}, - // repeated int64 paramList = 2 [(.org.xresloader.field_alias) = "Param"]; + // repeated int64 paramList = 2 [(.org.xresloader.field_alias) = "Param", (.org.xresloader.field_list_min_size) = "2"]; {PROTOBUF_FIELD_OFFSET(inner_alias_message, _impl_.paramlist_), 0, 0, (0 | ::_fl::kFcRepeated | ::_fl::kPackedInt64)}, }}, @@ -6397,7 +6400,7 @@ ::uint8_t* inner_alias_message::_InternalSerialize( stream, this->_internal_itype(), target); } - // repeated int64 paramList = 2 [(.org.xresloader.field_alias) = "Param"]; + // repeated int64 paramList = 2 [(.org.xresloader.field_alias) = "Param", (.org.xresloader.field_list_min_size) = "2"]; { int byte_size = _impl_._paramlist_cached_byte_size_.Get(); if (byte_size > 0) { @@ -6424,7 +6427,7 @@ ::size_t inner_alias_message::ByteSizeLong() const { (void) cached_has_bits; ::_pbi::Prefetch5LinesFrom7Lines(reinterpret_cast(this)); - // repeated int64 paramList = 2 [(.org.xresloader.field_alias) = "Param"]; + // repeated int64 paramList = 2 [(.org.xresloader.field_alias) = "Param", (.org.xresloader.field_list_min_size) = "2"]; { std::size_t data_size = ::_pbi::WireFormatLite::Int64Size( this->_internal_paramlist()) @@ -6495,6 +6498,8 @@ inline PROTOBUF_NDEBUG_INLINE outer_alias_message::Impl_::Impl_( ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* arena, const Impl_& from, const ::outer_alias_message& from_msg) : inners_{visibility, arena, from.inners_}, + nest_int_{visibility, arena, from.nest_int_}, + _nest_int_cached_byte_size_{0}, _cached_size_{0} {} outer_alias_message::outer_alias_message( @@ -6514,6 +6519,8 @@ inline PROTOBUF_NDEBUG_INLINE outer_alias_message::Impl_::Impl_( ::google::protobuf::internal::InternalVisibility visibility, ::google::protobuf::Arena* arena) : inners_{visibility, arena}, + nest_int_{visibility, arena}, + _nest_int_cached_byte_size_{0}, _cached_size_{0} {} inline void outer_alias_message::SharedCtor(::_pb::Arena* arena) { @@ -6551,15 +6558,15 @@ outer_alias_message::GetClassData() const { return _data_.base(); } PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 -const ::_pbi::TcParseTable<1, 2, 1, 0, 2> outer_alias_message::_table_ = { +const ::_pbi::TcParseTable<2, 3, 1, 0, 2> outer_alias_message::_table_ = { { 0, // no _has_bits_ 0, // no _extensions_ - 2, 8, // max_field_number, fast_idx_mask + 3, 24, // max_field_number, fast_idx_mask offsetof(decltype(_table_), field_lookup_table), - 4294967292, // skipmap + 4294967288, // skipmap offsetof(decltype(_table_), field_entries), - 2, // num_field_entries + 3, // num_field_entries 1, // num_aux_entries offsetof(decltype(_table_), aux_entries), &_outer_alias_message_default_instance_._instance, @@ -6569,12 +6576,16 @@ const ::_pbi::TcParseTable<1, 2, 1, 0, 2> outer_alias_message::_table_ = { ::_pbi::TcParser::GetTable<::outer_alias_message>(), // to_prefetch #endif // PROTOBUF_PREFETCH_PARSE_TABLE }, {{ - // repeated .inner_alias_message inners = 2 [(.org.xresloader.field_alias) = "Condition"]; - {::_pbi::TcParser::FastMtR1, - {18, 63, 0, PROTOBUF_FIELD_OFFSET(outer_alias_message, _impl_.inners_)}}, + {::_pbi::TcParser::MiniParse, {}}, // int32 iId = 1 [(.org.xresloader.field_alias) = "ID"]; {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(outer_alias_message, _impl_.iid_), 63>(), {8, 63, 0, PROTOBUF_FIELD_OFFSET(outer_alias_message, _impl_.iid_)}}, + // repeated .inner_alias_message inners = 2 [(.org.xresloader.field_alias) = "Condition"]; + {::_pbi::TcParser::FastMtR1, + {18, 63, 0, PROTOBUF_FIELD_OFFSET(outer_alias_message, _impl_.inners_)}}, + // repeated int32 nest_int = 3 [(.org.xresloader.field_alias) = "Nest", (.org.xresloader.field_list_min_size) = "2"]; + {::_pbi::TcParser::FastV32P1, + {26, 63, 0, PROTOBUF_FIELD_OFFSET(outer_alias_message, _impl_.nest_int_)}}, }}, {{ 65535, 65535 }}, {{ @@ -6584,6 +6595,9 @@ const ::_pbi::TcParseTable<1, 2, 1, 0, 2> outer_alias_message::_table_ = { // repeated .inner_alias_message inners = 2 [(.org.xresloader.field_alias) = "Condition"]; {PROTOBUF_FIELD_OFFSET(outer_alias_message, _impl_.inners_), 0, 0, (0 | ::_fl::kFcRepeated | ::_fl::kMessage | ::_fl::kTvTable)}, + // repeated int32 nest_int = 3 [(.org.xresloader.field_alias) = "Nest", (.org.xresloader.field_list_min_size) = "2"]; + {PROTOBUF_FIELD_OFFSET(outer_alias_message, _impl_.nest_int_), 0, 0, + (0 | ::_fl::kFcRepeated | ::_fl::kPackedInt32)}, }}, {{ {::_pbi::TcParser::GetTable<::inner_alias_message>()}, }}, {{ @@ -6598,6 +6612,7 @@ PROTOBUF_NOINLINE void outer_alias_message::Clear() { (void) cached_has_bits; _impl_.inners_.Clear(); + _impl_.nest_int_.Clear(); _impl_.iid_ = 0; _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); } @@ -6627,6 +6642,15 @@ ::uint8_t* outer_alias_message::_InternalSerialize( target, stream); } + // repeated int32 nest_int = 3 [(.org.xresloader.field_alias) = "Nest", (.org.xresloader.field_list_min_size) = "2"]; + { + int byte_size = _impl_._nest_int_cached_byte_size_.Get(); + if (byte_size > 0) { + target = stream->WriteInt32Packed( + 3, _internal_nest_int(), byte_size, target); + } + } + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { target = ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( @@ -6650,6 +6674,19 @@ ::size_t outer_alias_message::ByteSizeLong() const { for (const auto& msg : this->_internal_inners()) { total_size += ::google::protobuf::internal::WireFormatLite::MessageSize(msg); } + // repeated int32 nest_int = 3 [(.org.xresloader.field_alias) = "Nest", (.org.xresloader.field_list_min_size) = "2"]; + { + std::size_t data_size = ::_pbi::WireFormatLite::Int32Size( + this->_internal_nest_int()) + ; + _impl_._nest_int_cached_byte_size_.Set(::_pbi::ToCachedSize(data_size)); + std::size_t tag_size = data_size == 0 + ? 0 + : 1 + ::_pbi::WireFormatLite::Int32Size( + static_cast(data_size)) + ; + total_size += tag_size + data_size; + } // int32 iId = 1 [(.org.xresloader.field_alias) = "ID"]; if (this->_internal_iid() != 0) { total_size += ::_pbi::WireFormatLite::Int32SizePlusOne( @@ -6670,6 +6707,7 @@ void outer_alias_message::MergeImpl(::google::protobuf::MessageLite& to_msg, con _this->_internal_mutable_inners()->MergeFrom( from._internal_inners()); + _this->_internal_mutable_nest_int()->MergeFrom(from._internal_nest_int()); if (from._internal_iid() != 0) { _this->_impl_.iid_ = from._impl_.iid_; } @@ -6688,6 +6726,7 @@ void outer_alias_message::InternalSwap(outer_alias_message* PROTOBUF_RESTRICT ot using std::swap; _internal_metadata_.InternalSwap(&other->_internal_metadata_); _impl_.inners_.InternalSwap(&other->_impl_.inners_); + _impl_.nest_int_.InternalSwap(&other->_impl_.nest_int_); swap(_impl_.iid_, other->_impl_.iid_); } diff --git a/sample/cxx/v3/kind.pb.h b/sample/cxx/v3/kind.pb.h index 0a92a0bb..9e9b2057 100755 --- a/sample/cxx/v3/kind.pb.h +++ b/sample/cxx/v3/kind.pb.h @@ -773,7 +773,7 @@ class inner_alias_message final : public ::google::protobuf::Message kParamListFieldNumber = 2, kITypeFieldNumber = 1, }; - // repeated int64 paramList = 2 [(.org.xresloader.field_alias) = "Param"]; + // repeated int64 paramList = 2 [(.org.xresloader.field_alias) = "Param", (.org.xresloader.field_list_min_size) = "2"]; int paramlist_size() const; private: int _internal_paramlist_size() const; @@ -1656,6 +1656,7 @@ class outer_alias_message final : public ::google::protobuf::Message // accessors ------------------------------------------------------- enum : int { kInnersFieldNumber = 2, + kNestIntFieldNumber = 3, kIIdFieldNumber = 1, }; // repeated .inner_alias_message inners = 2 [(.org.xresloader.field_alias) = "Condition"]; @@ -1675,6 +1676,24 @@ class outer_alias_message final : public ::google::protobuf::Message const ::inner_alias_message& inners(int index) const; ::inner_alias_message* add_inners(); const ::google::protobuf::RepeatedPtrField<::inner_alias_message>& inners() const; + // repeated int32 nest_int = 3 [(.org.xresloader.field_alias) = "Nest", (.org.xresloader.field_list_min_size) = "2"]; + int nest_int_size() const; + private: + int _internal_nest_int_size() const; + + public: + void clear_nest_int() ; + ::int32_t nest_int(int index) const; + void set_nest_int(int index, ::int32_t value); + void add_nest_int(::int32_t value); + const ::google::protobuf::RepeatedField<::int32_t>& nest_int() const; + ::google::protobuf::RepeatedField<::int32_t>* mutable_nest_int(); + + private: + const ::google::protobuf::RepeatedField<::int32_t>& _internal_nest_int() const; + ::google::protobuf::RepeatedField<::int32_t>* _internal_mutable_nest_int(); + + public: // int32 iId = 1 [(.org.xresloader.field_alias) = "ID"]; void clear_iid() ; ::int32_t iid() const; @@ -1690,7 +1709,7 @@ class outer_alias_message final : public ::google::protobuf::Message class _Internal; friend class ::google::protobuf::internal::TcParser; static const ::google::protobuf::internal::TcParseTable< - 1, 2, 1, + 2, 3, 1, 0, 2> _table_; @@ -1712,6 +1731,8 @@ class outer_alias_message final : public ::google::protobuf::Message ::google::protobuf::Arena* arena, const Impl_& from, const outer_alias_message& from_msg); ::google::protobuf::RepeatedPtrField< ::inner_alias_message > inners_; + ::google::protobuf::RepeatedField<::int32_t> nest_int_; + mutable ::google::protobuf::internal::CachedSize _nest_int_cached_byte_size_; ::int32_t iid_; mutable ::google::protobuf::internal::CachedSize _cached_size_; PROTOBUF_TSAN_DECLARE_MEMBER @@ -8200,7 +8221,7 @@ inline void inner_alias_message::_internal_set_itype(::int32_t value) { _impl_.itype_ = value; } -// repeated int64 paramList = 2 [(.org.xresloader.field_alias) = "Param"]; +// repeated int64 paramList = 2 [(.org.xresloader.field_alias) = "Param", (.org.xresloader.field_list_min_size) = "2"]; inline int inner_alias_message::_internal_paramlist_size() const { return _internal_paramlist().size(); } @@ -8320,6 +8341,51 @@ outer_alias_message::_internal_mutable_inners() { return &_impl_.inners_; } +// repeated int32 nest_int = 3 [(.org.xresloader.field_alias) = "Nest", (.org.xresloader.field_list_min_size) = "2"]; +inline int outer_alias_message::_internal_nest_int_size() const { + return _internal_nest_int().size(); +} +inline int outer_alias_message::nest_int_size() const { + return _internal_nest_int_size(); +} +inline void outer_alias_message::clear_nest_int() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.nest_int_.Clear(); +} +inline ::int32_t outer_alias_message::nest_int(int index) const { + // @@protoc_insertion_point(field_get:outer_alias_message.nest_int) + return _internal_nest_int().Get(index); +} +inline void outer_alias_message::set_nest_int(int index, ::int32_t value) { + _internal_mutable_nest_int()->Set(index, value); + // @@protoc_insertion_point(field_set:outer_alias_message.nest_int) +} +inline void outer_alias_message::add_nest_int(::int32_t value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _internal_mutable_nest_int()->Add(value); + // @@protoc_insertion_point(field_add:outer_alias_message.nest_int) +} +inline const ::google::protobuf::RepeatedField<::int32_t>& outer_alias_message::nest_int() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_list:outer_alias_message.nest_int) + return _internal_nest_int(); +} +inline ::google::protobuf::RepeatedField<::int32_t>* outer_alias_message::mutable_nest_int() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_mutable_list:outer_alias_message.nest_int) + ::google::protobuf::internal::TSanWrite(&_impl_); + return _internal_mutable_nest_int(); +} +inline const ::google::protobuf::RepeatedField<::int32_t>& +outer_alias_message::_internal_nest_int() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.nest_int_; +} +inline ::google::protobuf::RepeatedField<::int32_t>* outer_alias_message::_internal_mutable_nest_int() { + ::google::protobuf::internal::TSanRead(&_impl_); + return &_impl_.nest_int_; +} + #ifdef __GNUC__ #pragma GCC diagnostic pop #endif // __GNUC__ diff --git a/sample/proto_v2/kind.desc.json b/sample/proto_v2/kind.desc.json index 844ffafd..57c889bc 100644 --- a/sample/proto_v2/kind.desc.json +++ b/sample/proto_v2/kind.desc.json @@ -416,7 +416,10 @@ "paramList": { "name": "paramList", "number": 2, - "options": {"field_alias": ["Param"]}, + "options": { + "field_alias": ["Param"], + "field_list_min_size": "2" + }, "type_name": "INT64" } }, @@ -510,6 +513,15 @@ "number": 2, "options": {"field_alias": ["Condition"]}, "type_name": "MESSAGE" + }, + "nest_int": { + "name": "nest_int", + "number": 3, + "options": { + "field_alias": ["Nest"], + "field_list_min_size": "2" + }, + "type_name": "INT32" } }, "name": "outer_alias_message" diff --git a/sample/proto_v2/kind.desc.lua b/sample/proto_v2/kind.desc.lua index 4464bd8b..bb2d7789 100644 --- a/sample/proto_v2/kind.desc.lua +++ b/sample/proto_v2/kind.desc.lua @@ -318,6 +318,7 @@ local const_res = { field_alias = { "Param", }, + field_list_min_size = "2", }, type_name = "INT64", }, @@ -363,6 +364,17 @@ local const_res = { }, type_name = "MESSAGE", }, + nest_int = { + name = "nest_int", + number = 3, + options = { + field_alias = { + "Nest", + }, + field_list_min_size = "2", + }, + type_name = "INT32", + }, }, name = "outer_alias_message", }, diff --git a/sample/proto_v2/kind.pb b/sample/proto_v2/kind.pb index dc060855b8530f654866717a6b1a5cd2eb8946bd..7e847fc3193b0dd628e745e3c34575b238c3ab41 100755 GIT binary patch delta 112 zcmX@1@l|6(1ry`%&6P}Sf{Y218-z{uw75765{nXZeKLznB$yPKHJF`v7TL1~fW&Uu zGa3aUq?INyPQE9cr6Huo#gUg$=E#6BF)ms#N0B?(7+(s#KJJu z)Y!zpIMFmUDbdp0G9}HxEG^O4z-VH;R=GY0qYyX8fsON71@Z+71PX;XICumq1*!z9 zfx^53&5Qyqi~_BU61|KPeT)+Qj6wz+OhSAd2ktd;30!6rxWXuKl~IU`gF)afqrg2z t0S2Icae?QI0xuXPJ~B#tVw7Nz63#CzNiB*`%*jkFj?YakE>28O1ptgOG1&kB delta 154 zcmZo*y1_U>-XX<2Daq12*)rKM#mFMnG|kY=%+T1#&^XD`BFW6uGRf3DCB-nsJjKw$ z$iO(wFgeLG$ucFyBF)m+GSxEG$Z%r3mcKj)qYx*@fsON71@Z+7gxENE1S$opgg7{O z1)3QJS{Q{SIGBXEIS$-wQh(U;zLtNlFqm*!dX-R5Pd}2;!VsU(KYH@L5 GdMW@@3@G3L diff --git a/sample/proto_v2/next_alias.lua b/sample/proto_v2/next_alias.lua index dbde6b3a..627bbeeb 100644 --- a/sample/proto_v2/next_alias.lua +++ b/sample/proto_v2/next_alias.lua @@ -11,7 +11,7 @@ return { }, }, data_ver = "1.0.0.0", - hash_code = "sha256:f7be6e49644c9dc400f09df3c23276e0c1f3c233fa208720999ca0e6db00afd6", + hash_code = "sha256:e99feb6b80a35127a916429bb5f48c7e15bd16e198bad71422598eb47765aa67", xres_ver = "2.18.0", }, [2] = "outer_alias_message", @@ -24,6 +24,7 @@ return { paramList = { 111, 112, + 113, }, }, { @@ -31,6 +32,7 @@ return { paramList = { 121, 122, + 123, }, }, { @@ -38,9 +40,15 @@ return { paramList = { 131, 132, + 133, }, }, }, + nest_int = { + 141, + 142, + 143, + }, }, { iId = 2, @@ -50,17 +58,30 @@ return { paramList = { 211, 212, + 213, }, }, { + iType = 0, + paramList = { + 221, + 222, + 0, + }, }, { iType = 23, paramList = { 231, + 232, }, }, }, + nest_int = { + 241, + 242, + 0, + }, }, }, } \ No newline at end of file diff --git a/sample/proto_v3/kind.desc.json b/sample/proto_v3/kind.desc.json index e02d03b8..b2db27b9 100644 --- a/sample/proto_v3/kind.desc.json +++ b/sample/proto_v3/kind.desc.json @@ -469,7 +469,10 @@ "paramList": { "name": "paramList", "number": 2, - "options": {"field_alias": ["Param"]}, + "options": { + "field_alias": ["Param"], + "field_list_min_size": "2" + }, "type_name": "INT64" } }, @@ -563,6 +566,15 @@ "number": 2, "options": {"field_alias": ["Condition"]}, "type_name": "MESSAGE" + }, + "nest_int": { + "name": "nest_int", + "number": 3, + "options": { + "field_alias": ["Nest"], + "field_list_min_size": "2" + }, + "type_name": "INT32" } }, "name": "outer_alias_message" diff --git a/sample/proto_v3/kind.desc.lua b/sample/proto_v3/kind.desc.lua index 5236cdb6..912e1eb2 100644 --- a/sample/proto_v3/kind.desc.lua +++ b/sample/proto_v3/kind.desc.lua @@ -320,6 +320,7 @@ local const_res = { field_alias = { "Param", }, + field_list_min_size = "2", }, type_name = "INT64", }, @@ -365,6 +366,17 @@ local const_res = { }, type_name = "MESSAGE", }, + nest_int = { + name = "nest_int", + number = 3, + options = { + field_alias = { + "Nest", + }, + field_list_min_size = "2", + }, + type_name = "INT32", + }, }, name = "outer_alias_message", }, diff --git a/sample/proto_v3/kind.pb b/sample/proto_v3/kind.pb index b042a473462d9aade78779f92c01cead39c88143..8465affb05293a572dab73af5fa98737cec87031 100755 GIT binary patch delta 121 zcmeyMJ6CT*2NTm|&COj*Q-v85CM$@U>S=Lt79J7BT3iyJnO7pg4AjEv#J$L##SbV1*1-;v^vo+sVk;=h IFUdCs0K-Eh)Bpeg delta 76 zcmbQM_d$0<2NTmXjm=$5Q-v90CM$@UYN~N@79Zryn}hFg^{JXp^=4&VY0cQg=JE*nL(P7g?W;>kwHp|SyGBca+*=9k&&r^ zxtU>7qKRRmMVhgJp@m@@P{PE-d}6#-o;C-g5EsXRjq_QBnDYw?h1fZGgqSO= 0 && field.getListExtension() != null + && field.getListExtension().minSize >= listIndex + 1) { + if (container != null) { + this.logErrorMessage( + "Field \"%s\" in \"%s\" has set field_list_min_size %d, which is not allowed to be auto filled with default value.", + field.getName(), container.getFullName(), + field.getListExtension().minSize); + } else { + this.logErrorMessage( + "Field \"%s\" has set field_list_min_size %d, which is not allowed to be auto filled with default value.", + field.getName(), + field.getListExtension().minSize); + } + throw new ConvException(getLastErrorMessage()); + } + switch (field.getType()) { case INT: val = Integer.valueOf(0); @@ -297,7 +315,15 @@ private Object getDefault(DataDstWriterNode.DataDstFieldDescriptor field) { .getTypeDescriptor().fields.entrySet()) { // 仅仅Required需要导出默认值 if (sub_item.getValue().isRequired()) { - dumpDefault(sub_msg, sub_item.getValue()); + dumpDefault(sub_msg, field + .getTypeDescriptor(), sub_item.getValue(), 0); + } else if (sub_item.getValue().isList() && sub_item.getValue().getListExtension() != null + && sub_item.getValue().getListExtension().minSize > 0) { + this.logErrorMessage( + "Field \"%s\" in \"%s\" has set field_list_min_size %d, which is not allowed to be auto filled with default value.", + sub_item.getValue().getName(), field.getTypeDescriptor().getFullName(), + sub_item.getValue().getListExtension().minSize); + throw new ConvException(getLastErrorMessage()); } } val = sub_msg; @@ -429,13 +455,17 @@ private Object getValueFromDataSource(DataDstWriterNode desc, DataRowContext row return val; } - private void dumpDefault(HashMap builder, DataDstWriterNode.DataDstChildrenNode as_child) { - dumpDefault(builder, as_child.innerFieldDesc); + private void dumpDefault(HashMap builder, DataDstWriterNode.DataDstTypeDescriptor container, + DataDstWriterNode.DataDstChildrenNode as_child, int listIndex) + throws ConvException { + dumpDefault(builder, container, as_child.innerFieldDesc, listIndex); } @SuppressWarnings("unchecked") - private void dumpDefault(HashMap builder, DataDstWriterNode.DataDstFieldDescriptor field) { - Object val = getDefault(field); + private void dumpDefault(HashMap builder, DataDstWriterNode.DataDstTypeDescriptor container, + DataDstWriterNode.DataDstFieldDescriptor field, int listIndex) + throws ConvException { + Object val = getDefault(container, field, listIndex); if (val == null) { return; } @@ -483,7 +513,8 @@ protected boolean dumpMessage(HashMap builder, DataDstWriterNode String subFieldPath = String.format("%s.%s", fieldPath, c.getKey()); for (DataDstWriterNode child : c.getValue().nodes) { - if (dumpPlainField(builder, child.identify, child.getOneofDescriptor(), child, rowContext, + if (dumpPlainField(builder, node.getTypeDescriptor(), child.identify, child.getOneofDescriptor(), + child, rowContext, subFieldPath)) { ret = true; fieldHasValue = true; @@ -503,7 +534,8 @@ protected boolean dumpMessage(HashMap builder, DataDstWriterNode } else { subFieldPath = String.format("%s.%s", fieldPath, c.getKey()); } - if (dumpStandardField(builder, child, c.getValue(), rowContext, subFieldPath)) { + if (dumpStandardField(builder, node.getTypeDescriptor(), child, c.getValue(), rowContext, + subFieldPath)) { ret = true; fieldHasValue = true; } @@ -518,7 +550,8 @@ protected boolean dumpMessage(HashMap builder, DataDstWriterNode String subFieldPath = String.format("%s.%s", fieldPath, c.getKey()); for (DataDstWriterNode child : c.getValue().nodes) { - if (dumpPlainField(builder, child.identify, child.getFieldDescriptor(), child, rowContext, + if (dumpPlainField(builder, node.getTypeDescriptor(), child.identify, child.getFieldDescriptor(), + child, rowContext, subFieldPath)) { ret = true; fieldHasValue = true; @@ -562,13 +595,14 @@ protected boolean dumpMessage(HashMap builder, DataDstWriterNode } @SuppressWarnings("unchecked") - private boolean dumpStandardField(HashMap builder, DataDstWriterNode desc, + private boolean dumpStandardField(HashMap builder, + DataDstWriterNode.DataDstTypeDescriptor container, DataDstWriterNode desc, DataDstWriterNode.DataDstChildrenNode as_child, DataRowContext rowContext, String fieldPath) throws ConvException { if (null == desc.identify && DataDstWriterNode.JAVA_TYPE.MESSAGE != desc.getType()) { if (as_child.isRequired() || as_child.getFieldListStripRule() == DataDstWriterNode.ListStripRule.STRIP_NOTHING) { - dumpDefault(builder, as_child); + dumpDefault(builder, container, as_child, desc.getListIndex()); } return false; @@ -579,7 +613,7 @@ private boolean dumpStandardField(HashMap builder, DataDstWriter if (null == val) { if (as_child.isRequired() || as_child.getFieldListStripRule() == DataDstWriterNode.ListStripRule.STRIP_NOTHING) { - dumpDefault(builder, as_child); + dumpDefault(builder, container, as_child, desc.getListIndex()); } return false; @@ -616,7 +650,7 @@ private boolean dumpStandardField(HashMap builder, DataDstWriter if (stripListRule == DataDstWriterNode.ListStripRule.STRIP_NOTHING || stripListRule == DataDstWriterNode.ListStripRule.STRIP_TAIL) { while (old.size() < index) { - dumpDefault(builder, as_child); + dumpDefault(builder, container, as_child, old.size()); } } @@ -645,7 +679,8 @@ private boolean dumpStandardField(HashMap builder, DataDstWriter return true; } - private boolean dumpPlainField(HashMap builder, IdentifyDescriptor ident, + private boolean dumpPlainField(HashMap builder, DataDstWriterNode.DataDstTypeDescriptor container, + IdentifyDescriptor ident, DataDstWriterNode.DataDstOneofDescriptor field, DataDstWriterNode maybeFromNode, DataRowContext rowContext, String fieldPath) throws ConvException { @@ -662,10 +697,11 @@ private boolean dumpPlainField(HashMap builder, IdentifyDescript return false; } - return dumpPlainField(builder, ident, field, maybeFromNode, res.value, rowContext, fieldPath); + return dumpPlainField(builder, container, ident, field, maybeFromNode, res.value, rowContext, fieldPath); } - private boolean dumpPlainField(HashMap builder, IdentifyDescriptor ident, + private boolean dumpPlainField(HashMap builder, DataDstWriterNode.DataDstTypeDescriptor container, + IdentifyDescriptor ident, DataDstWriterNode.DataDstOneofDescriptor field, DataDstWriterNode maybeFromNode, String input, DataRowContext rowContext, String fieldPath) @@ -693,13 +729,17 @@ private boolean dumpPlainField(HashMap builder, IdentifyDescript } if (res.length == 1) { - dumpDefault(builder, sub_field); + if (maybeFromNode != null) { + dumpDefault(builder, container, sub_field, maybeFromNode.getListIndex()); + } else { + dumpDefault(builder, container, sub_field, 0); + } ret = true; break; } // 非顶层,不用验证类型 - ret = dumpPlainField(builder, null, sub_field, null, (String) res[1], rowContext, fieldPath); + ret = dumpPlainField(builder, container, null, sub_field, null, (String) res[1], rowContext, fieldPath); } while (false); for (var subField : field.getSortedFields()) { @@ -714,7 +754,8 @@ private boolean dumpPlainField(HashMap builder, IdentifyDescript return ret; } - private boolean dumpPlainField(HashMap builder, IdentifyDescriptor ident, + private boolean dumpPlainField(HashMap builder, DataDstWriterNode.DataDstTypeDescriptor container, + IdentifyDescriptor ident, DataDstWriterNode.DataDstFieldDescriptor field, DataDstWriterNode maybeFromNode, DataRowContext rowContext, String fieldPath) throws ConvException { @@ -722,7 +763,11 @@ private boolean dumpPlainField(HashMap builder, IdentifyDescript // Plain模式的repeated对于STRIP_EMPTY_TAIL也可以直接全部strip掉,下同 if (field.isRequired() || field.getListStripRule() == DataDstWriterNode.ListStripRule.STRIP_NOTHING) { - dumpDefault(builder, field); + if (maybeFromNode != null) { + dumpDefault(builder, container, field, maybeFromNode.getListIndex()); + } else { + dumpDefault(builder, container, field, 0); + } } return false; } @@ -731,16 +776,21 @@ private boolean dumpPlainField(HashMap builder, IdentifyDescript if (null == res || !res.valid) { if (field.isRequired() || field.getListStripRule() == DataDstWriterNode.ListStripRule.STRIP_NOTHING) { - dumpDefault(builder, field); + if (maybeFromNode != null) { + dumpDefault(builder, container, field, maybeFromNode.getListIndex()); + } else { + dumpDefault(builder, container, field, 0); + } } return false; } - return dumpPlainField(builder, ident, field, maybeFromNode, res.value, rowContext, fieldPath); + return dumpPlainField(builder, container, ident, field, maybeFromNode, res.value, rowContext, fieldPath); } @SuppressWarnings("unchecked") - private boolean dumpPlainField(HashMap builder, IdentifyDescriptor ident, + private boolean dumpPlainField(HashMap builder, DataDstWriterNode.DataDstTypeDescriptor container, + IdentifyDescriptor ident, DataDstWriterNode.DataDstFieldDescriptor field, DataDstWriterNode maybeFromNode, String input, DataRowContext rowContext, String fieldPath) @@ -994,7 +1044,7 @@ private boolean dumpPlainField(HashMap builder, IdentifyDescript if (stripListRule == DataDstWriterNode.ListStripRule.STRIP_NOTHING || stripListRule == DataDstWriterNode.ListStripRule.STRIP_TAIL) { while (valArray.size() < index) { - valArray.add(getDefault(field)); + valArray.add(getDefault(container, field, valArray.size())); } } @@ -1013,8 +1063,13 @@ private boolean dumpPlainField(HashMap builder, IdentifyDescript } } } else if (field.getListStripRule() == DataDstWriterNode.ListStripRule.STRIP_NOTHING) { - ArrayList valArray = (ArrayList) val; - valArray.add(getDefault(field)); + if (null != maybeFromNode && maybeFromNode.getListIndex() >= 0) { + int index = maybeFromNode.getListIndex(); + ArrayList valArray = (ArrayList) val; + while (valArray.size() <= index) { + valArray.add(getDefault(container, field, valArray.size())); + } + } } else { ret = false; } @@ -1115,7 +1170,7 @@ private boolean dumpPlainField(HashMap builder, IdentifyDescript builder.put(field.getReferOriginField().getName(), res.origin); } } else if (field.isRequired()) { - dumpDefault(builder, field); + dumpDefault(builder, container, field, -1); } break; } @@ -1232,7 +1287,8 @@ public ParseResult parsePlainDataMessage(String[] inputs, IdentifyDescriptor ide } if (usedInputIdx < inputs.length - && dumpPlainField(ret.value, null, child.getReferOneof(), null, inputs[usedInputIdx], + && dumpPlainField(ret.value, field.getTypeDescriptor(), null, child.getReferOneof(), null, + inputs[usedInputIdx], rowContext, fieldPath)) { dumpedOneof.add(child.getReferOneof().getFullName()); @@ -1252,7 +1308,8 @@ && dumpPlainField(ret.value, null, child.getReferOneof(), null, inputs[usedInput } else { String subFieldPath = String.format("%s.%s", fieldPath, children.get(i).getName()); if (usedInputIdx < inputs.length - && dumpPlainField(ret.value, null, children.get(i), null, inputs[usedInputIdx], rowContext, + && dumpPlainField(ret.value, field.getTypeDescriptor(), null, children.get(i), null, + inputs[usedInputIdx], rowContext, subFieldPath)) { missingFields.remove(child.getIndex()); } else { diff --git a/src/org/xresloader/core/data/dst/DataDstPb.java b/src/org/xresloader/core/data/dst/DataDstPb.java index d9245a70..a3854d58 100644 --- a/src/org/xresloader/core/data/dst/DataDstPb.java +++ b/src/org/xresloader/core/data/dst/DataDstPb.java @@ -1035,7 +1035,7 @@ public boolean init() { currentMsgDesc = get_message_proto(cachePbs, SchemeConf.getInstance().getProtoName()); if (null == currentMsgDesc) { - this.setLastErrorMessage("Can not find protocol message %s", SchemeConf.getInstance().getProtoName()); + this.logErrorMessage("Can not find protocol message %s", SchemeConf.getInstance().getProtoName()); return false; } @@ -1055,7 +1055,7 @@ public boolean init() { oneFileCustomValidatorMode ? cachePbs.oneCustomValidatorFiles : cachePbs.mixedCustomValidatorFiles); if (null == validatorSet) { - this.setLastErrorMessage("Can not build custom validators from file \"%s\"", + this.logErrorMessage("Can not build custom validators from file \"%s\"", ruleFilePath); return false; } @@ -1465,7 +1465,7 @@ private void filterMissingFields(LinkedList missingFields, HashMap name_list // 索引oneof for (Descriptors.OneofDescriptor fd : desc.getOneofs()) { if (node.getTypeDescriptor() == null) { - setLastErrorMessage( + this.logErrorMessage( "Type descriptor \"%s\" not found, it's probably a BUG, please report to %s, current version: %s", node.getFullName(), ProgramOptions.getReportUrl(), ProgramOptions.getInstance().getVersion()); throw new ConvException(getLastErrorMessage()); @@ -1849,7 +1849,7 @@ private boolean testMessage(DataDstWriterNode node, LinkedList name_list DataDstOneofDescriptor oneof_inner_desc = node.getTypeDescriptor().oneofs.getOrDefault(fd.getName(), null); if (oneof_inner_desc == null) { - setLastErrorMessage( + this.logErrorMessage( "Oneof descriptor \"%s\" not found in type descriptor \"%s\", it's probably a BUG, please report to %s, current version: %s", fd.getFullName(), node.getFullName(), ProgramOptions.getReportUrl(), ProgramOptions.getInstance().getVersion()); @@ -1866,7 +1866,7 @@ private boolean testMessage(DataDstWriterNode node, LinkedList name_list String old_field = oneofField.getOrDefault(fd.getFullName(), null); if (old_field != null) { - setLastErrorMessage( + this.logErrorMessage( "Field \"%s\" in oneof descriptor \"%s\" already exists, can not add the oneof writer again", old_field, fd.getFullName()); throw new ConvException(getLastErrorMessage()); @@ -1901,10 +1901,10 @@ private boolean testMessage(DataDstWriterNode node, LinkedList name_list if (!missingFieldDesc.isEmpty() || !missingOneofDesc.isEmpty()) { if (prefix.isEmpty()) { - setLastErrorMessage("Message %s can not find%s%s in data source", desc.getFullName(), + this.logErrorMessage("Message %s can not find%s%s in data source", desc.getFullName(), missingFieldDesc, missingOneofDesc); } else { - setLastErrorMessage("Message %s in %s can not find%s%s in data source", desc.getFullName(), prefix, + this.logErrorMessage("Message %s in %s can not find%s%s in data source", desc.getFullName(), prefix, missingFieldDesc, missingOneofDesc); } throw new ConvException(getLastErrorMessage()); @@ -1944,14 +1944,23 @@ private ByteString convData(DataDstWriterNode node, DataTableContext tableContex try { return root.build().toByteString(); } catch (Exception e) { - this.logErrorMessage("serialize failed. %s", e.getMessage()); + this.logErrorMessage("Serialize failed. %s", e.getMessage()); return null; } } - private Object getDefault(DynamicMessage.Builder builder, DataDstFieldDescriptor field) { + private Object getDefault(DynamicMessage.Builder builder, DataDstFieldDescriptor field, int listIndex) + throws ConvException { Descriptors.FieldDescriptor fd = (Descriptors.FieldDescriptor) field.getRawDescriptor(); Object val = null; + if (field.isList() && field.getListExtension() != null + && field.getListExtension().minSize >= listIndex + 1) { + this.logErrorMessage( + "Field \"%s\" in \"%s\" has set field_list_min_size %d, which is not allowed to be auto filled with default value.", + field.getName(), fd.getContainingType().getFullName(), + field.getListExtension().minSize); + throw new ConvException(getLastErrorMessage()); + } switch (fd.getType()) { case DOUBLE: val = Double.valueOf(0.0); @@ -1993,6 +2002,13 @@ private Object getDefault(DynamicMessage.Builder builder, DataDstFieldDescriptor for (DataDstFieldDescriptor subField : field.getTypeDescriptor().getSortedFields()) { if (subField.isRequired()) { dumpDefault(subnode, subField, 0); + } else if (subField.isList() && subField.getListExtension() != null + && subField.getListExtension().minSize > 0) { + this.logErrorMessage( + "Field \"%s\" in \"%s\" has set field_list_min_size %d, which is not allowed to be auto filled with default value.", + subField.getName(), fd.getFullName(), + subField.getListExtension().minSize); + throw new ConvException(getLastErrorMessage()); } } @@ -2144,7 +2160,7 @@ private Object getValueFromDataSource(DataDstWriterNode desc, DataDstFieldDescri private void dumpValue(DynamicMessage.Builder builder, DataDstFieldDescriptor field, Object val, int index, DataRowContext rowContext, - String fieldPath) { + String fieldPath) throws ConvException { DataDstWriterNode.ListStripRule stripListRule = field.getListStripRule(); Descriptors.FieldDescriptor fd = (Descriptors.FieldDescriptor) field.getRawDescriptor(); @@ -2153,7 +2169,7 @@ private void dumpValue(DynamicMessage.Builder builder, DataDstFieldDescriptor fi || stripListRule == DataDstWriterNode.ListStripRule.STRIP_TAIL)) { int fill_default_size = builder.getRepeatedFieldCount(fd); for (int i = fill_default_size; i < index; ++i) { - Object defaultVal = getDefault(builder, field); + Object defaultVal = getDefault(builder, field, i); if (defaultVal != null) { builder.addRepeatedField(fd, defaultVal); } @@ -2225,8 +2241,9 @@ private void dumpDefault(DynamicMessage.Builder builder, DataDstOneofDescriptor builder.clearOneof((Descriptors.OneofDescriptor) oneof.getRawDescriptor()); } - private void dumpDefault(DynamicMessage.Builder builder, DataDstFieldDescriptor field, int index) { - Object val = getDefault(builder, field); + private void dumpDefault(DynamicMessage.Builder builder, DataDstFieldDescriptor field, int index) + throws ConvException { + Object val = getDefault(builder, field, index); if (val != null) { dumpValue(builder, field, val, index, null, ""); } @@ -2667,7 +2684,7 @@ private boolean dumpPlainField(DynamicMessage.Builder builder, IdentifyDescripto if (stripListRule == DataDstWriterNode.ListStripRule.STRIP_NOTHING || stripListRule == DataDstWriterNode.ListStripRule.STRIP_TAIL) { while (builder.getRepeatedFieldCount(fd) < index) { - builder.addRepeatedField(fd, getDefault(builder, field)); + builder.addRepeatedField(fd, getDefault(builder, field, builder.getRepeatedFieldCount(fd))); } } @@ -2702,7 +2719,12 @@ private boolean dumpPlainField(DynamicMessage.Builder builder, IdentifyDescripto } } } else if (field.getListStripRule() == DataDstWriterNode.ListStripRule.STRIP_NOTHING) { - builder.addRepeatedField(fd, getDefault(builder, field)); + if (null != maybeFromNode && maybeFromNode.getListIndex() >= 0) { + int index = maybeFromNode.getListIndex(); + while (builder.getRepeatedFieldCount(fd) <= index) { + builder.addRepeatedField(fd, getDefault(builder, field, builder.getRepeatedFieldCount(fd))); + } + } } else { ret = false; } From 2cb9ee296d6fd80c28fb565faa5be338426eb8e9 Mon Sep 17 00:00:00 2001 From: owent <> Date: Fri, 26 Jul 2024 21:34:34 +0800 Subject: [PATCH 10/10] Add `org.xresloader.field_list_strict_size` --- HISTORY.md | 9 +-- README.md | 1 + header/org/xresloader/Xresloader.java | 56 ++++++++++++------ .../xresloader/core/data/dst/DataDstJava.java | 3 +- .../xresloader/core/data/dst/DataDstPb.java | 8 ++- .../core/data/dst/DataDstWriterNode.java | 1 + third_party/xresloader-protocol | 2 +- tools/extensions.pb | Bin 3139 -> 3224 bytes 8 files changed, 53 insertions(+), 27 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index d0e44c71..3a6cf59b 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -7,10 +7,11 @@ 1. 增加插件 `org.xresloader.field_list_strip_option=LIST_STRIP_DEFAULT|LIST_STRIP_NOTHING|LIST_STRIP_TAIL|LIST_STRIP_ALL` 用于给单个字段设置数组裁剪。 2. 增加插件 `org.xresloader.field_list_min_size="|枚举名"` 用于给单个字段数组最小长度要求。 3. 增加插件 `org.xresloader.field_list_max_size="|枚举名"` 用于给单个字段数组最大长度要求。 -4. 增加选项 `--disable-alias-mapping` 用于关闭字段映射时使用别名。 -5. 修复使用别名时,message结构未被正确映射的问题。 -6. 修复对Excel对大数字自动附加的 `,` 的适配。 -7. 修复对非裁剪模式下的数组数据自动补全问题。 +4. 增加插件 `org.xresloader.field_list_strict_size=` 用于设置单个字段数组的严格长度要求,即不自动补全最小长度,而是报错。 +5. 增加选项 `--disable-alias-mapping` 用于关闭字段映射时使用别名。 +6. 修复使用别名时,message结构未被正确映射的问题。 +7. 修复对Excel对大数字自动附加的 `,` 的适配。 +8. 修复对非裁剪模式下的数组数据自动补全问题。 ### BREAKCHANGES diff --git a/README.md b/README.md index 8a77ff8c..303a091a 100644 --- a/README.md +++ b/README.md @@ -349,6 +349,7 @@ validator: | | + `LIST_STRIP_ALL`: 裁剪全部空值,相当于 `--list-strip-all-empty` | | org.xresloader.field_list_min_size | 给单个字段设置数组最小长度,输入字符串:`"\|枚举名"`(版本 2.18.0 版本开始支持) | | org.xresloader.field_list_max_size | 给单个字段设置数组最大长度,输入字符串:`"\|枚举名"`(版本 2.18.0 版本开始支持) | +| org.xresloader.field_list_strict_size | 设置单个字段设置数组严格长度要求,即不自动补全最小长度,而是报错。:`false\|true`(默认值: `false` ,版本 2.18.0 版本开始支持) | | org.xresloader.ue.key_tag | 生成UE代码时,如果需要支持多个Key组合成一个Name,用这个字段指定系数(必须大于0) | | org.xresloader.ue.ue_type_name | 生成UE代码时,如果指定了这个字段,那么生成的字段类型将是 `TSoftObjectPtr` , 并且支持蓝图中直接引用 | | org.xresloader.ue.ue_type_is_class | 生成UE代码时,如果指定了这个字段,那么生成的字段类型将是 `TSoftClassPtr` , 并且支持蓝图中直接引用 | diff --git a/header/org/xresloader/Xresloader.java b/header/org/xresloader/Xresloader.java index e6097c49..4c048d9d 100644 --- a/header/org/xresloader/Xresloader.java +++ b/header/org/xresloader/Xresloader.java @@ -38,6 +38,7 @@ public static void registerAllExtensions( registry.add(org.xresloader.Xresloader.fieldListStripOption); registry.add(org.xresloader.Xresloader.fieldListMinSize); registry.add(org.xresloader.Xresloader.fieldListMaxSize); + registry.add(org.xresloader.Xresloader.fieldListStrictSize); registry.add(org.xresloader.Xresloader.oneofDescription); registry.add(org.xresloader.Xresloader.oneofSeparator); registry.add(org.xresloader.Xresloader.oneofNotNull); @@ -520,6 +521,21 @@ private ListStripOption(int value) { .newFileScopedGeneratedExtension( java.lang.String.class, null); + public static final int FIELD_LIST_STRICT_SIZE_FIELD_NUMBER = 1021; + /** + *
+   * List类型严格尺寸模式(不允许对min_size以下数据自动填充)
+   * 
+ * + * extend .google.protobuf.FieldOptions { ... } + */ + public static final + com.google.protobuf.GeneratedMessage.GeneratedExtension< + com.google.protobuf.DescriptorProtos.FieldOptions, + java.lang.Boolean> fieldListStrictSize = com.google.protobuf.GeneratedMessage + .newFileScopedGeneratedExtension( + java.lang.Boolean.class, + null); public static final int ONEOF_DESCRIPTION_FIELD_NUMBER = 1001; /** *
@@ -668,18 +684,19 @@ private ListStripOption(int value) {
       "loader.ListStripOption:;\n\023field_list_min" +
       "_size\022\035.google.protobuf.FieldOptions\030\373\007 " +
       "\001(\t:;\n\023field_list_max_size\022\035.google.prot" +
-      "obuf.FieldOptions\030\374\007 \001(\t:9\n\021oneof_descri" +
-      "ption\022\035.google.protobuf.OneofOptions\030\351\007 " +
-      "\001(\t:7\n\017oneof_separator\022\035.google.protobuf" +
-      ".OneofOptions\030\352\007 \001(\t:6\n\016oneof_not_null\022\035" +
-      ".google.protobuf.OneofOptions\030\353\007 \001(\010:I\n!" +
-      "oneof_allow_missing_in_plain_mode\022\035.goog" +
-      "le.protobuf.OneofOptions\030\354\007 \001(\010:7\n\020enum_" +
-      "description\022\034.google.protobuf.EnumOption" +
-      "s\030\351\007 \001(\t:=\n\021enumv_description\022!.google.p" +
-      "rotobuf.EnumValueOptions\030\351\007 \001(\t:6\n\nenum_" +
-      "alias\022!.google.protobuf.EnumValueOptions" +
-      "\030\352\007 \003(\tb\006proto3"
+      "obuf.FieldOptions\030\374\007 \001(\t:>\n\026field_list_s" +
+      "trict_size\022\035.google.protobuf.FieldOption" +
+      "s\030\375\007 \001(\010:9\n\021oneof_description\022\035.google.p" +
+      "rotobuf.OneofOptions\030\351\007 \001(\t:7\n\017oneof_sep" +
+      "arator\022\035.google.protobuf.OneofOptions\030\352\007" +
+      " \001(\t:6\n\016oneof_not_null\022\035.google.protobuf" +
+      ".OneofOptions\030\353\007 \001(\010:I\n!oneof_allow_miss" +
+      "ing_in_plain_mode\022\035.google.protobuf.Oneo" +
+      "fOptions\030\354\007 \001(\010:7\n\020enum_description\022\034.go" +
+      "ogle.protobuf.EnumOptions\030\351\007 \001(\t:=\n\021enum" +
+      "v_description\022!.google.protobuf.EnumValu" +
+      "eOptions\030\351\007 \001(\t:6\n\nenum_alias\022!.google.p" +
+      "rotobuf.EnumValueOptions\030\352\007 \003(\tb\006proto3"
     };
     descriptor = com.google.protobuf.Descriptors.FileDescriptor
       .internalBuildGeneratedFileFrom(descriptorData,
@@ -706,13 +723,14 @@ private ListStripOption(int value) {
     fieldListStripOption.internalInit(descriptor.getExtensions().get(17));
     fieldListMinSize.internalInit(descriptor.getExtensions().get(18));
     fieldListMaxSize.internalInit(descriptor.getExtensions().get(19));
-    oneofDescription.internalInit(descriptor.getExtensions().get(20));
-    oneofSeparator.internalInit(descriptor.getExtensions().get(21));
-    oneofNotNull.internalInit(descriptor.getExtensions().get(22));
-    oneofAllowMissingInPlainMode.internalInit(descriptor.getExtensions().get(23));
-    enumDescription.internalInit(descriptor.getExtensions().get(24));
-    enumvDescription.internalInit(descriptor.getExtensions().get(25));
-    enumAlias.internalInit(descriptor.getExtensions().get(26));
+    fieldListStrictSize.internalInit(descriptor.getExtensions().get(20));
+    oneofDescription.internalInit(descriptor.getExtensions().get(21));
+    oneofSeparator.internalInit(descriptor.getExtensions().get(22));
+    oneofNotNull.internalInit(descriptor.getExtensions().get(23));
+    oneofAllowMissingInPlainMode.internalInit(descriptor.getExtensions().get(24));
+    enumDescription.internalInit(descriptor.getExtensions().get(25));
+    enumvDescription.internalInit(descriptor.getExtensions().get(26));
+    enumAlias.internalInit(descriptor.getExtensions().get(27));
     descriptor.resolveAllFeaturesImmutable();
     com.google.protobuf.DescriptorProtos.getDescriptor();
   }
diff --git a/src/org/xresloader/core/data/dst/DataDstJava.java b/src/org/xresloader/core/data/dst/DataDstJava.java
index 3ff66556..7c336b08 100644
--- a/src/org/xresloader/core/data/dst/DataDstJava.java
+++ b/src/org/xresloader/core/data/dst/DataDstJava.java
@@ -272,7 +272,7 @@ private Object getDefault(DataDstWriterNode.DataDstTypeDescriptor container,
             throws ConvException {
         Object val = null;
         if (field.isList() && listIndex >= 0 && field.getListExtension() != null
-                && field.getListExtension().minSize >= listIndex + 1) {
+                && field.getListExtension().strictSize && field.getListExtension().minSize >= listIndex + 1) {
             if (container != null) {
                 this.logErrorMessage(
                         "Field \"%s\" in \"%s\" has set field_list_min_size %d, which is not allowed to be auto filled with default value.",
@@ -318,6 +318,7 @@ private Object getDefault(DataDstWriterNode.DataDstTypeDescriptor container,
                         dumpDefault(sub_msg, field
                                 .getTypeDescriptor(), sub_item.getValue(), 0);
                     } else if (sub_item.getValue().isList() && sub_item.getValue().getListExtension() != null
+                            && sub_item.getValue().getListExtension().strictSize
                             && sub_item.getValue().getListExtension().minSize > 0) {
                         this.logErrorMessage(
                                 "Field \"%s\" in \"%s\" has set field_list_min_size %d, which is not allowed to be auto filled with default value.",
diff --git a/src/org/xresloader/core/data/dst/DataDstPb.java b/src/org/xresloader/core/data/dst/DataDstPb.java
index a3854d58..b31091b7 100644
--- a/src/org/xresloader/core/data/dst/DataDstPb.java
+++ b/src/org/xresloader/core/data/dst/DataDstPb.java
@@ -697,6 +697,10 @@ static private boolean setup_extension(DataDstTypeDescriptor parent_message, Dat
                     }
                 }
             }
+            if (fd.getOptions().hasExtension(Xresloader.fieldListStrictSize)) {
+                child_field.mutableExtension()
+                        .mutableList().strictSize = fd.getOptions().getExtension(Xresloader.fieldListStrictSize);
+            }
         }
 
         if (gen == null) {
@@ -1954,7 +1958,7 @@ private Object getDefault(DynamicMessage.Builder builder, DataDstFieldDescriptor
         Descriptors.FieldDescriptor fd = (Descriptors.FieldDescriptor) field.getRawDescriptor();
         Object val = null;
         if (field.isList() && field.getListExtension() != null
-                && field.getListExtension().minSize >= listIndex + 1) {
+                && field.getListExtension().strictSize && field.getListExtension().minSize >= listIndex + 1) {
             this.logErrorMessage(
                     "Field \"%s\" in \"%s\" has set field_list_min_size %d, which is not allowed to be auto filled with default value.",
                     field.getName(), fd.getContainingType().getFullName(),
@@ -2003,7 +2007,7 @@ private Object getDefault(DynamicMessage.Builder builder, DataDstFieldDescriptor
                         if (subField.isRequired()) {
                             dumpDefault(subnode, subField, 0);
                         } else if (subField.isList() && subField.getListExtension() != null
-                                && subField.getListExtension().minSize > 0) {
+                                && subField.getListExtension().strictSize && subField.getListExtension().minSize > 0) {
                             this.logErrorMessage(
                                     "Field \"%s\" in \"%s\" has set field_list_min_size %d, which is not allowed to be auto filled with default value.",
                                     subField.getName(), fd.getFullName(),
diff --git a/src/org/xresloader/core/data/dst/DataDstWriterNode.java b/src/org/xresloader/core/data/dst/DataDstWriterNode.java
index 73e2f8e4..ea35a7bf 100644
--- a/src/org/xresloader/core/data/dst/DataDstWriterNode.java
+++ b/src/org/xresloader/core/data/dst/DataDstWriterNode.java
@@ -50,6 +50,7 @@ static public class DataDstFieldExtList {
         public ListStripRule stripOption = ListStripRule.DEFAULT;
         public int minSize = 0;
         public int maxSize = 0;
+        public boolean strictSize = false;
     }
 
     static public class DataDstFieldExt {
diff --git a/third_party/xresloader-protocol b/third_party/xresloader-protocol
index e43f077e..6723388a 160000
--- a/third_party/xresloader-protocol
+++ b/third_party/xresloader-protocol
@@ -1 +1 @@
-Subproject commit e43f077ef0bf6535add33a3a4ca5d2c46ec041ce
+Subproject commit 6723388ae7cb4ad4036512bb58a15e0f7ebc4d46
diff --git a/tools/extensions.pb b/tools/extensions.pb
index 6f50adcea1db0d95bf8bc17c7308bc541e40e44d..f4dbfad47995a53bb001cbe6c28465c1ac05cdb9 100644
GIT binary patch
delta 66
zcmX>sF+-A>YrD`!<{fMz!CYc#nW;G`@j02rCGo{2MVZMZll9nC#s9J^FlulF34>*Q
OfRe#rxy{?ydRYO{RTfGB

delta 17
YcmbOsd02v(>yh9_<{fOC1=u@S0W;eLRsaA1