MCPcopy Create free account
hub / github.com/anjo76/angelscript / ArrayToString

Function ArrayToString

sdk/tests/test_feature/source/test_addon_debugger.cpp:159–175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

157}
158
159std::string ArrayToString(void *obj, int expandMembers, CDebugger *dbg)
160{
161 CScriptArray *arr = reinterpret_cast<CScriptArray*>(obj);
162
163 std::stringstream s;
164 s << "(len=" << arr->GetSize() << ") [";
165 // TODO: How to allow user to define how many elements in the array that should be expanded?
166 for( asUINT n = 0; n < arr->GetSize(); n++ )
167 {
168 s << dbg->ToString(arr->At(n), arr->GetElementTypeId(), expandMembers - 1, arr->GetArrayObjectType()->GetEngine());
169 if( n < arr->GetSize()-1 )
170 s << ", ";
171 }
172 s << "]";
173
174 return s.str();
175}
176
177//#ifndef AS_CAN_USE_CPP11
178static bool cmp(const string &a, const string &b) { return a > b; }

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected