MCPcopy Create free account
hub / github.com/christophhart/HISE / flushTemporaryFile

Method flushTemporaryFile

hi_scripting/scripting/api/ScriptingApiObjects.cpp:1370–1390  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1368}
1369
1370void ScriptingObjects::ScriptDownloadObject::flushTemporaryFile()
1371{
1372 if (resumeFile.existsAsFile())
1373 {
1374 ScopedPointer<FileInputStream> fis = new FileInputStream(resumeFile);
1375 FileOutputStream fos(targetFile);
1376
1377 auto numWritten = fos.writeFromInputStream(*fis, -1);
1378
1379 ignoreUnused(numWritten);
1380
1381 fos.flush();
1382 fis = nullptr;
1383
1384 download = nullptr;
1385 auto ok = resumeFile.deleteFile();
1386
1387 if(ok)
1388 resumeFile = File();
1389 }
1390}
1391
1392void ScriptingObjects::ScriptDownloadObject::progress(URL::DownloadTask*, int64 bytesDownloaded, int64 totalLength)
1393{

Callers 1

runMethod · 0.80

Calls 6

ignoreUnusedFunction · 0.85
FileClass · 0.85
existsAsFileMethod · 0.45
writeFromInputStreamMethod · 0.45
flushMethod · 0.45
deleteFileMethod · 0.45

Tested by

no test coverage detected