MCPcopy Create free account
hub / github.com/MayaPosch/NymphCast / ArrayToString

Function ArrayToString

src/server/angelscript/samples/asrun/source/main.cpp:236–256  ·  view source on GitHub ↗

This is the to-string callback for the array type This is generic and will take care of all template instances based on the array template

Source from the content-addressed store, hash-verified

234// This is the to-string callback for the array type
235// This is generic and will take care of all template instances based on the array template
236std::string ArrayToString(void *obj, int expandMembers, CDebugger *dbg)
237{
238 CScriptArray *arr = reinterpret_cast<CScriptArray*>(obj);
239
240 std::stringstream s;
241 s << "(len=" << arr->GetSize() << ")";
242
243 if( expandMembers > 0 )
244 {
245 s << " [";
246 for( asUINT n = 0; n < arr->GetSize(); n++ )
247 {
248 s << dbg->ToString(arr->At(n), arr->GetElementTypeId(), expandMembers - 1, arr->GetArrayObjectType()->GetEngine());
249 if( n < arr->GetSize()-1 )
250 s << ", ";
251 }
252 s << "]";
253 }
254
255 return s.str();
256}
257
258// This is the to-string callback for the dictionary type
259std::string DictionaryToString(void *obj, int expandMembers, CDebugger *dbg)

Callers

nothing calls this directly

Calls 6

ToStringMethod · 0.80
GetArrayObjectTypeMethod · 0.80
GetSizeMethod · 0.45
AtMethod · 0.45
GetElementTypeIdMethod · 0.45
GetEngineMethod · 0.45

Tested by

no test coverage detected