MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / saveToFile

Function saveToFile

include/daScript/ast/ast_aot_cpp.h:8–20  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6namespace das {
7
8 inline bool saveToFile ( TextPrinter &tout, const string_view & fname, const string_view & str, bool quiet = false ) {
9 FILE * f = fopen ( fname.data(), "wb" );
10 if ( !f ) {
11 tout << "can't open " << fname.data() << "\n";
12 return false;
13 }
14 if ( !quiet ) {
15 tout << "saving to " << fname.data() << "\n";
16 }
17 fwrite ( str.data(), str.length(), 1, f );
18 fclose ( f );
19 return true;
20 }
21
22 /**
23 * Shortcut to wrap code into namespace

Callers 1

aot_compileFunction · 0.85

Calls 2

dataMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected