| 191 | /* ---- arrays ------------------------------------------------------------ */ |
| 192 | |
| 193 | char* 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 | |
| 207 | int* ScriptArgs::intArray(int i, int count) const |
| 208 | { |
no outgoing calls
no test coverage detected