Fixed StringView::GetText() related issued pointed out in review.

This commit is contained in:
Zbigniew Skowron
2021-08-09 22:09:06 +02:00
parent aecc81f5e5
commit bd70e53806
4 changed files with 10 additions and 7 deletions

View File

@@ -166,7 +166,7 @@ namespace Flax.Build.Bindings
if (typeInfo.Type == "String")
return $"(StringView){value}";
if (typeInfo.IsPtr && typeInfo.IsConst && typeInfo.Type == "Char")
return $"((StringView){value}).GetNonTerminatedText()"; // This is a bug, as we need a null-terminated strig here. Any idea how to fix it?
return $"((StringView){value}).GetNonTerminatedText()"; // (StringView)Variant, if not empty, is guaranteed to point to a null-terminated buffer.
if (typeInfo.Type == "AssetReference" || typeInfo.Type == "WeakAssetReference")
return $"ScriptingObject::Cast<{typeInfo.GenericArgs[0].Type}>((Asset*){value})";
if (typeInfo.Type == "ScriptingObjectReference" || typeInfo.Type == "SoftObjectReference")