1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-19 00:20:25 +02:00

ReadStrSized32

This commit is contained in:
Brian Fiete 2021-05-20 06:33:28 -04:00
parent d08b45018c
commit 351d94e0e8

View file

@ -97,10 +97,10 @@ namespace System.IO
}
}
//Read sized string from stream
public Result<void> ReadStrSized32(int64 size, String output)
/// Read sized string from stream
public Result<void> ReadStrSized32(int size, String output)
{
if (size <= 0)
if (size < 0)
return .Err;
for (int64 i = 0; i < size; i++)
@ -115,7 +115,13 @@ namespace System.IO
return .Ok;
}
//Reads null terminated ASCII string from the stream. Null terminator is read from stream but isn't appended to output string
public Result<void> ReadStrSized32(String output)
{
int size = Try!(Read<int32>());
return ReadStrSized32(size, output);
}
/// Reads null terminated ASCII string from the stream. Null terminator is read from stream but isn't appended to output string
public Result<void> ReadStrC(String output)
{
Result<char8> char0;