mirror of
https://github.com/Ed94/gencpp.git
synced 2025-06-15 03:01:47 -07:00
More refactoring, getting rid of meson in favor of just powershell scripts
This commit is contained in:
@ -12,6 +12,7 @@ Builder Builder::open( char const* path )
|
||||
|
||||
result.Buffer = String::make_reserve( GlobalAllocator, Builder_StrBufferReserve );
|
||||
|
||||
// log_fmt("$Builder - Opened file: %s\n", result.File.filename );
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -22,7 +23,11 @@ void Builder::pad_lines( s32 num )
|
||||
|
||||
void Builder::print( Code code )
|
||||
{
|
||||
Buffer.append( code->to_string() );
|
||||
String str = code->to_string();
|
||||
const sw len = str.length();
|
||||
|
||||
// log_fmt( "%s - print: %.*s\n", File.filename, len > 80 ? 80 : len, str.Data );
|
||||
Buffer.append( str );
|
||||
}
|
||||
|
||||
void Builder::print_fmt( char const* fmt, ... )
|
||||
@ -35,6 +40,7 @@ void Builder::print_fmt( char const* fmt, ... )
|
||||
res = str_fmt_va( buf, count_of( buf ) - 1, fmt, va ) - 1;
|
||||
va_end( va );
|
||||
|
||||
// log_fmt( "$%s - print_fmt: %.*s\n", File.filename, res > 80 ? 80 : res, buf );
|
||||
Buffer.append( buf, res );
|
||||
}
|
||||
|
||||
@ -43,8 +49,9 @@ void Builder::write()
|
||||
bool result = file_write( & File, Buffer, Buffer.length() );
|
||||
|
||||
if ( result == false )
|
||||
log_failure("gen::File::write - Failed to write to file: %s", file_name( & File ) );
|
||||
log_failure("gen::File::write - Failed to write to file: %s\n", file_name( & File ) );
|
||||
|
||||
log_fmt( "Generated: %s\n", File.filename );
|
||||
file_close( & File );
|
||||
Buffer.free();
|
||||
}
|
||||
|
Reference in New Issue
Block a user