MCPcopy Create free account
hub / github.com/SakuraEngine/SakuraEngine / saveToFile

Function saveToFile

tools/dascript_aot/aot_cc/src/main.cpp:22–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20das::Context * get_context ( int stackSize=0 );
21
22bool saveToFile ( const string & fname, const string & str ) {
23 if ( !quiet ) {
24 tout << "saving to " << fname << "\n";
25 }
26 FILE * f = fopen ( fname.c_str(), "w" );
27 if ( !f ) {
28 tout << "can't open " << fname << "\n";
29 return false;
30 }
31 fwrite ( str.c_str(), str.length(), 1, f );
32 fclose ( f );
33 return true;
34}
35
36bool compile ( const string & fn, const string & cppFn, bool dryRun ) {
37 auto access = get_file_access((char*)(projectFile.empty() ? nullptr : projectFile.c_str()));

Callers 1

compileFunction · 0.70

Calls 2

c_strMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected