• S
    Generate nullable properties in C# object-based API for optional scalars.... · 65c41591
    Stefan F 提交于
    Generate nullable properties in C# object-based API for optional scalars. (without -gen-mutable) (#6273)
    
    * Added missing EndTable() call to VerifyObject()
    
    VerifyObject called VerifyTableStart() but not EndTable(). This made Verifier::VerifyComplexity() increase depth_ with each table, not with the depth of tables.
    
    https://groups.google.com/forum/#!topic/flatbuffers/OpxtW5UFAdg
    
    * Added Check to VerifyAlignment
    
    https://stackoverflow.com/questions/59376308/flatbuffers-verifier-returns-false-without-any-assertion-flatbuffers-debug-veri
    
    * Add GetStringView (Convenience function to get string_view from a String returning an empty string_view on null pointer) like GetString, GetCstring
    
    * flatc should warn, when an attribute is attached more than once.
    
    flatc.exe -b duplicate.fbs
    warning: duplicate.fbs(5, 36): warning: attribute already found: priority
    
    duplicate.fbs:
    
    namespace MyGame;
    
    attribute "priority";
    
    table Monster (priority:1, priority:2) {
    }
    
    root_type Monster;
    
    * flatc should support --binary --schema with optional scalar fields.
    
    This fixes 'error: Optional scalars are not yet supported in at least one the of the specified programming languages.' when calling flatc.exe --binary --schema with a schema containing optional scalars.
    
    * Generate nullable properties in C# object-based API for optional scalars.
    tests\generate_code.bat extended to test this.
    
    Ran tests\generate_code.bat
    Ran tests\Flatbuffers.Test\NetTest.bat
    
    * %TEST_BASE_FLAGS% replaced with --gen-object-api in generate_code.bat, because only this is part of this PR. Added this same flag to generate_code.sh
    
    * generate_code.bat and generate_code.sh changed to only test c# with object based api.
    65c41591
idl_gen_csharp.cpp 82.6 KB