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

Function Stream_tostring

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

Source from the content-addressed store, hash-verified

828 }
829
830 static int Stream_tostring(lua_State* L)
831 {
832 DM_LUA_STACK_CHECK(L, 1);
833 BufferStream* stream = CheckStream(L, 1);
834 dmBuffer::ValueType type;
835 uint32_t type_count;
836 dmBuffer::Result r = GetStreamType(stream->m_Buffer, stream->m_Name, &type, &type_count);
837 if( r == dmBuffer::RESULT_OK )
838 lua_pushfstring(L, "%s.%s({ hash(\"%s\"), buffer.%s, %d })", SCRIPT_LIB_NAME, SCRIPT_TYPE_NAME_BUFFERSTREAM, dmHashReverseSafe64(stream->m_Name), dmBuffer::GetValueTypeString(type), type_count );
839 else
840 lua_pushfstring(L, "%s.%s({ hash(\"%s\"), unknown, unknown })", SCRIPT_LIB_NAME, SCRIPT_TYPE_NAME_BUFFERSTREAM, dmHashReverseSafe64(stream->m_Name));
841 return 1;
842 }
843
844 static int Stream_len(lua_State* L)
845 {

Callers

nothing calls this directly

Calls 5

CheckStreamFunction · 0.85
GetStreamTypeFunction · 0.85
lua_pushfstringFunction · 0.85
dmHashReverseSafe64Function · 0.85
GetValueTypeStringFunction · 0.85

Tested by

no test coverage detected