MCPcopy Create free account
hub / github.com/MayaPosch/NymphCast / ReadString

Method ReadString

src/server/angelscript/angelscript/source/as_restore.cpp:2116–2139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2114}
2115
2116void asCReader::ReadString(asCString* str)
2117{
2118 asUINT len = ReadEncodedUInt();
2119 if( len & 1 )
2120 {
2121 asUINT idx = len/2;
2122 if( idx < savedStrings.GetLength() )
2123 *str = savedStrings[idx];
2124 else
2125 Error(TXT_INVALID_BYTECODE_d);
2126 }
2127 else if( len > 0 )
2128 {
2129 len /= 2;
2130 str->SetLength(len);
2131 int r = stream->Read(str->AddressOf(), len);
2132 if (r < 0)
2133 Error(TXT_UNEXPECTED_END_OF_FILE);
2134
2135 savedStrings.PushLast(*str);
2136 }
2137 else
2138 str->SetLength(0);
2139}
2140
2141void asCReader::ReadGlobalProperty()
2142{

Callers

nothing calls this directly

Calls 5

PushLastMethod · 0.80
GetLengthMethod · 0.45
SetLengthMethod · 0.45
ReadMethod · 0.45
AddressOfMethod · 0.45

Tested by

no test coverage detected