mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-19 00:20:25 +02:00
ReadStrSized32
This commit is contained in:
parent
d08b45018c
commit
351d94e0e8
1 changed files with 10 additions and 4 deletions
|
@ -97,10 +97,10 @@ namespace System.IO
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Read sized string from stream
|
/// Read sized string from stream
|
||||||
public Result<void> ReadStrSized32(int64 size, String output)
|
public Result<void> ReadStrSized32(int size, String output)
|
||||||
{
|
{
|
||||||
if (size <= 0)
|
if (size < 0)
|
||||||
return .Err;
|
return .Err;
|
||||||
|
|
||||||
for (int64 i = 0; i < size; i++)
|
for (int64 i = 0; i < size; i++)
|
||||||
|
@ -115,7 +115,13 @@ namespace System.IO
|
||||||
return .Ok;
|
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)
|
public Result<void> ReadStrC(String output)
|
||||||
{
|
{
|
||||||
Result<char8> char0;
|
Result<char8> char0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue