MCPcopy Create free account
hub / github.com/defold/defold / CheckStream

Function CheckStream

engine/gamesys/src/gamesys/scripts/script_buffer.cpp:262–275  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

260 }
261
262 static BufferStream* CheckStream(lua_State* L, int index)
263 {
264 if (lua_type(L, index) == LUA_TUSERDATA)
265 {
266 BufferStream* stream = (BufferStream*)dmScript::CheckUserType(L, index, dmScript::SCRIPT_BUFFERSTREAM_TYPE_HASH, 0);
267 if (stream && dmBuffer::IsBufferValid(stream->m_Buffer))
268 {
269 return stream;
270 }
271 luaL_error(L, "The buffer handle is invalid");
272 }
273 luaL_typerror(L, index, SCRIPT_TYPE_NAME_BUFFERSTREAM);
274 return 0x0;
275 }
276
277 ////////////////////////////////////////////////////////
278 // Buffer Module

Callers 5

CopyStreamFunction · 0.85
Stream_tostringFunction · 0.85
Stream_lenFunction · 0.85
Stream_indexFunction · 0.85
Stream_newindexFunction · 0.85

Calls 5

lua_typeFunction · 0.85
CheckUserTypeFunction · 0.85
IsBufferValidFunction · 0.85
luaL_errorFunction · 0.85
luaL_typerrorFunction · 0.50

Tested by

no test coverage detected