Initial commit

This commit is contained in:
Beef Bindings
2026-03-11 15:48:30 +00:00
commit 97e8446b96
9 changed files with 322 additions and 0 deletions

52
Setup/src/Program.bf Normal file
View File

@@ -0,0 +1,52 @@
using System;
using System.IO;
using System.Collections;
using System.Diagnostics;
using Cpp2Beef;
using LibClang;
namespace <ProjectName>.Setup;
class <ProjectName>Generator : Cpp2BeefGenerator, this(Span<char8*> args)
{
protected override Span<char8*> Args => args;
protected override Flags Flags => .None;
StreamWriter writer = new .()..Create(TODO)..Write("""
// This file was generated by Cpp2Beef
using System;
using System.Interop;
namespace <ProjectName>;
""");
protected override StreamWriter GetWriterForHeader(StringView header)
{
if (header.EndsWith(TODO))
return writer;
return null;
}
}
class Program
{
[CLink] static extern int32 system(char8*);
private static mixin RunCommand(char8* cmd)
{
Console.WriteLine($"> {StringView(cmd)}");
int32 rcode = system(cmd);
if (rcode != 0)
return rcode;
}
public static int Main(String[] args)
{
scope <ProjectName>Generator(char8*[?]("--language=c")).Generate(TODO, null);
return 0;
}
}