MCPcopy Create free account
hub / github.com/HaxeFoundation/hxcpp / StringFromAnonFields

Function StringFromAnonFields

src/hx/Anon.cpp:408–427  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

406}
407
408String StringFromAnonFields(hx::Object *inPtr)
409{
410 Array<String> fields = Array_obj<String>::__new();
411 inPtr->__GetFields(fields);
412
413 int n = fields->length;
414 Array<String> array = Array<String>(0,n*4+4);
415 array->push(HX_CSTRING("{ "));
416 for(int i=0;i<n;i++)
417 {
418 if (array->length>1)
419 array->push(HX_CSTRING(", "));
420
421 array->push(fields[i]);
422 array->push(HX_CSTRING(" => "));
423 array->push( inPtr->__Field( fields[i], HX_PROP_DYNAMIC) );
424 }
425 array->push(HX_CSTRING(" }"));
426 return array->join(HX_CSTRING(""));
427}
428
429
430

Callers 5

toStringMethod · 0.85
AnonStruct2_objClass · 0.85
AnonStruct3_objClass · 0.85
toStringMethod · 0.85
toStringMethod · 0.85

Calls 4

__newFunction · 0.85
__GetFieldsMethod · 0.45
pushMethod · 0.45
__FieldMethod · 0.45

Tested by

no test coverage detected