MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / stringify

Method stringify

core/variant/variant.cpp:1019–1161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1017}
1018
1019String Variant::stringify(int recursion_count) const {
1020 switch (type) {
1021 case NIL:
1022 return "<null>";
1023 case BOOL:
1024 return _data._bool ? "true" : "false";
1025 case INT:
1026 return itos(_data._int);
1027 case FLOAT:
1028 return String::num_real(_data._float, true);
1029 case STRING:
1030 return *reinterpret_cast<const String *>(_data._mem);
1031 case VECTOR2:
1032 return String(operator Vector2());
1033 case VECTOR2I:
1034 return String(operator Vector2i());
1035 case RECT2:
1036 return String(operator Rect2());
1037 case RECT2I:
1038 return String(operator Rect2i());
1039 case TRANSFORM2D:
1040 return String(operator Transform2D());
1041 case VECTOR3:
1042 return String(operator Vector3());
1043 case VECTOR3I:
1044 return String(operator Vector3i());
1045 case VECTOR4:
1046 return String(operator Vector4());
1047 case VECTOR4I:
1048 return String(operator Vector4i());
1049 case PLANE:
1050 return String(operator Plane());
1051 case AABB:
1052 return String(operator ::AABB());
1053 case QUATERNION:
1054 return String(operator Quaternion());
1055 case BASIS:
1056 return String(operator Basis());
1057 case TRANSFORM3D:
1058 return String(operator Transform3D());
1059 case PROJECTION:
1060 return String(operator Projection());
1061 case STRING_NAME:
1062 return operator StringName();
1063 case NODE_PATH:
1064 return String(operator NodePath());
1065 case COLOR:
1066 return String(operator Color());
1067 case DICTIONARY: {
1068 ERR_FAIL_COND_V_MSG(recursion_count > MAX_RECURSION, "{ ... }", "Maximum dictionary recursion reached!");
1069 recursion_count++;
1070
1071 const Dictionary &d = *reinterpret_cast<const Dictionary *>(_data._mem);
1072
1073 // Add leading and trailing space to Dictionary printing. This distinguishes it
1074 // from array printing on fonts that have similar-looking {} and [] characters.
1075 String str("{ ");
1076

Callers 1

stringify_variant_cleanFunction · 0.45

Calls 15

itosFunction · 0.85
stringify_variant_cleanFunction · 0.85
stringify_vectorFunction · 0.85
StringNameClass · 0.70
ArrayClass · 0.70
sizeMethod · 0.65
StringClass · 0.50
Vector2Function · 0.50
Vector2iClass · 0.50
Rect2Class · 0.50
Rect2iClass · 0.50
Transform2DClass · 0.50

Tested by

no test coverage detected