MCPcopy Create free account
hub / github.com/davidgiven/fluxengine / writeFluxFile

Method writeFluxFile

src/gui2/datastore.cc:733–767  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

731}
732
733void Datastore::writeFluxFile(const std::fs::path& path)
734{
735 Events::OperationStart::post("fluxengine.view.status.writeFlux"_lang);
736 Datastore::runOnWorkerThread(
737 [=]
738 {
739 busy = true;
740 failed = false;
741 DEFER(wtOperationStop());
742
743 try
744 {
745 wtRebuildConfiguration(true);
746 wtWaitForUiThreadToCatchUp();
747
748 if (!disk || !disk->image)
749 error("no loaded image");
750 if (disk->image->getGeometry().totalBytes !=
751 diskLayout->totalBytes)
752 error(
753 "loaded image is not the right size for this "
754 "format");
755
756 globalConfig().setFluxSink(path.string());
757 auto fluxSource = FluxSource::createMemoryFluxSource(*disk);
758 auto fluxSinkFactory = FluxSinkFactory::create(globalConfig());
759 writeRawDiskCommand(*diskLayout, *fluxSource, *fluxSinkFactory);
760 }
761 catch (...)
762 {
763 failed = true;
764 throw;
765 }
766 });
767}
768
769void Datastore::createBlankImage()
770{

Callers

nothing calls this directly

Calls 7

runOnWorkerThreadFunction · 0.85
wtOperationStopFunction · 0.85
wtRebuildConfigurationFunction · 0.85
errorFunction · 0.85
writeRawDiskCommandFunction · 0.85
setFluxSinkMethod · 0.80

Tested by

no test coverage detected