ReadLine
| 160 | |
| 161 | //ReadLine |
| 162 | FORCEINLINE void ReadLine(lua_State *L, bool bWithNewLineCh = false) |
| 163 | { |
| 164 | if (FILE->AtEnd()) |
| 165 | { |
| 166 | lua_pushnil(L); |
| 167 | } |
| 168 | else |
| 169 | { |
| 170 | TArray<uint8> Buffer; |
| 171 | uint8 Ch; |
| 172 | while (!FILE->AtEnd()) |
| 173 | { |
| 174 | FILE->SerializeBits(&Ch, sizeof(uint8) * 8); |
| 175 | if (Ch == '\n') |
| 176 | { |
| 177 | if (bWithNewLineCh) |
| 178 | { |
| 179 | Buffer.Add(Ch); |
| 180 | } |
| 181 | break; |
| 182 | } |
| 183 | Buffer.Add(Ch); |
| 184 | } |
| 185 | lua_pushlstring(L, (const char*)Buffer.GetData(), Buffer.Num()); |
| 186 | } |
| 187 | } |
| 188 | |
| 189 | |
| 190 | FORCEINLINE void ReadNumber(lua_State *L) |
no test coverage detected