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

Function saveToFile

tests/daS/dasTestAnnotation/annotation_compiler.cpp:25–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23das::Context * get_context ( int stackSize=0 );
24
25bool saveToFile ( const string & fname, const string & str ) {
26 if ( !quiet ) {
27 tout << "saving to " << fname << "\n";
28 }
29 FILE * f = fopen ( fname.c_str(), "w" );
30 if ( !f ) {
31 tout << "can't open " << fname << "\n";
32 return false;
33 }
34 fwrite ( str.c_str(), str.length(), 1, f );
35 fclose ( f );
36 return true;
37}
38
39bool compile ( const string & fn, const string & cppFn, bool dryRun ) {
40 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