MCPcopy Create free account
hub / github.com/BernardoGiordano/Checkpoint / strArray

Method strArray

common/script/scriptargs.cpp:193–205  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

191/* ---- arrays ------------------------------------------------------------ */
192
193char* const* ScriptArgs::strArray(int i, int count) const
194{
195 char* const* items = (char* const*)ptrAt(i, count > 0 ? false : true);
196 // Walked once here so the binding's own loop can index without checking:
197 // a NULL element becomes a named script error instead of the strlen that
198 // faults inside whatever std::string is being built from it.
199 for (int n = 0; n < count; n++) {
200 if (items[n] == nullptr) {
201 fail("argument %d element %d is NULL", i + 1, n);
202 }
203 }
204 return items;
205}
206
207int* ScriptArgs::intArray(int i, int count) const
208{

Callers 2

ckpt_gui_pick_oneFunction · 0.80
ckpt_gui_pick_manyFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected