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

Function mainWrite

src/fe-write.cc:46–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44 });
45
46int mainWrite(int argc, const char* argv[])
47{
48 if (argc == 1)
49 showProfiles("write", formats);
50 globalConfig().setFluxSink("drive:0");
51 globalConfig().setVerificationFluxSource("drive:0");
52
53 flags.parseFlagsWithConfigFiles(argc, argv, formats);
54
55 auto reader = ImageReader::create(globalConfig());
56 std::shared_ptr<Image> image = reader->readImage();
57 globalConfig().overrides()->MergeFrom(reader->getExtraConfig());
58
59 auto diskLayout = createDiskLayout();
60 auto encoder = Arch::createEncoder(globalConfig());
61 auto fluxSinkFactory = FluxSinkFactory::create(globalConfig());
62
63 std::shared_ptr<Decoder> decoder;
64 std::shared_ptr<FluxSource> verificationFluxSource;
65 if (globalConfig().hasDecoder() && fluxSinkFactory->isHardware() && verify)
66 {
67 decoder = Arch::createDecoder(globalConfig());
68 verificationFluxSource =
69 FluxSource::create(globalConfig().getVerificationFluxSourceProto());
70 }
71
72 writeDiskCommand(*diskLayout,
73 *image,
74 *encoder,
75 *fluxSinkFactory,
76 decoder.get(),
77 verificationFluxSource.get());
78
79 return 0;
80}

Callers

nothing calls this directly

Calls 11

showProfilesFunction · 0.85
createDiskLayoutFunction · 0.85
writeDiskCommandFunction · 0.85
setFluxSinkMethod · 0.80
overridesMethod · 0.80
hasDecoderMethod · 0.80
readImageMethod · 0.45
isHardwareMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected