mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-19 00:20:25 +02:00
Support for comptime file IO and process creation
This commit is contained in:
parent
045e706600
commit
ce4b6e04de
19 changed files with 726 additions and 89 deletions
|
@ -2,6 +2,7 @@ using System.Reflection;
|
|||
using System.Diagnostics;
|
||||
using System.Collections;
|
||||
using System.Security.Cryptography;
|
||||
using System.IO;
|
||||
|
||||
namespace System
|
||||
{
|
||||
|
@ -306,5 +307,21 @@ namespace System
|
|||
if (Compiler.IsComptime)
|
||||
Comptime_EmitMixin(text);
|
||||
}
|
||||
|
||||
[Comptime]
|
||||
public static Span<uint8> ReadBinary(StringView path)
|
||||
{
|
||||
List<uint8> data = scope .();
|
||||
File.ReadAll(path, data);
|
||||
return data;
|
||||
}
|
||||
|
||||
[Comptime]
|
||||
public static String ReadText(StringView path)
|
||||
{
|
||||
String data = scope .();
|
||||
File.ReadAllText(path, data);
|
||||
return data;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue