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

Enhanced Write/WriteLine

This commit is contained in:
Brian Fiete 2020-03-25 09:17:53 -07:00
parent dde6a56a03
commit 19e53801f1
2 changed files with 33 additions and 10 deletions

View file

@ -96,41 +96,40 @@ namespace System
public static void Write(String fmt, params Object[] args)
{
String str = scope String();
String str = scope String(256);
str.AppendF(fmt, params args);
Write(str);
}
public static void Write(Object obj)
{
String str = scope String();
String str = scope String(256);
obj.ToString(str);
Write(str);
}
public static void WriteLine()
{
Out.Write("\n").IgnoreError();
}
public static void WriteLine(String line)
{
//PrintF("Hey!");
Out.WriteLine(line).IgnoreError();
}
public static void WriteLine(StringView fmt, params Object[] args)
{
String str = scope String();
String str = scope String(256);
str.AppendF(fmt, params args);
WriteLine(str);
}
public static void WriteLine(Object obj)
{
String str = scope String();
String str = scope String(256);
obj.ToString(str);
WriteLine(str);
}
[Inline]
public static void WriteLine(){
Out.Write("\n").IgnoreError();
}
}
}

View file

@ -41,6 +41,30 @@ namespace System.Diagnostics
static extern void Write(char8* str, int strLen);
public static void Write(String line)
{
Write(line.Ptr, line.Length);
}
public static void Write(String fmt, params Object[] args)
{
String str = scope String(256);
str.AppendF(fmt, params args);
Write(str);
}
public static void Write(Object obj)
{
String str = scope String(256);
obj.ToString(str);
Write(str);
}
public static void WriteLine()
{
Write("\n", 1);
}
public static void WriteLine(StringView line)
{
Write(line.Ptr, line.Length);