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

Function StringToString

sdk/tests/test_feature/source/test_addon_debugger.cpp:146–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

144};
145
146std::string StringToString(void *obj, int /*expandMembers*/, CDebugger * /*dbg*/)
147{
148 std::string *val = reinterpret_cast<std::string*>(obj);
149 std::stringstream s;
150 s << "(len=" << val->length() << ") \"";
151 // TODO: How to allow user to define how many characters in the string that should be expanded?
152 if( val->length() < 20 )
153 s << *val << "\"";
154 else
155 s << val->substr(0, 20) << "...";
156 return s.str();
157}
158
159std::string ArrayToString(void *obj, int expandMembers, CDebugger *dbg)
160{

Callers

nothing calls this directly

Calls 2

strMethod · 0.80
lengthMethod · 0.45

Tested by

no test coverage detected