| 911 | } |
| 912 | |
| 913 | Fory build_fory(bool compatible = true, bool xlang = true, |
| 914 | bool check_struct_version = false, bool track_ref = false) { |
| 915 | // In Java xlang mode, check_class_version is automatically set to true for |
| 916 | // SCHEMA_CONSISTENT mode (compatible=false). Match this behavior in C++. |
| 917 | bool actual_check_version = check_struct_version; |
| 918 | if (xlang && !compatible) { |
| 919 | actual_check_version = true; |
| 920 | } |
| 921 | return Fory::builder() |
| 922 | .compatible(compatible) |
| 923 | .xlang(xlang) |
| 924 | .check_struct_version(actual_check_version) |
| 925 | .track_ref(track_ref) |
| 926 | .build(); |
| 927 | } |
| 928 | |
| 929 | void register_basic_structs(Fory &fory) { |
| 930 | ensure_ok(fory.register_enum<Color>(101), "register Color"); |
no test coverage detected