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

Method DmkFluxSource

lib/fluxsource/dmkfluxsource.cc:58–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56{
57public:
58 DmkFluxSource(const DmkFluxSourceProto& config): _path(config.directory())
59 {
60 std::vector<CylinderHead> chs;
61 for (const auto& di : std::filesystem::directory_iterator(_path))
62 {
63 static const std::regex FILENAME_REGEX(
64 "C_S([0-9]+)T([0-9]+)\\.[0-9]+");
65
66 std::string filename = di.path().filename().string();
67 std::smatch dmatch;
68 if (std::regex_match(filename, dmatch, FILENAME_REGEX))
69 chs.push_back(CylinderHead{(unsigned)std::stoi(dmatch[2]),
70 (unsigned)std::stoi(dmatch[1])});
71 }
72 _extraConfig.mutable_drive()->set_tracks(
73 convertCylinderHeadsToString(chs));
74 }
75
76public:
77 std::unique_ptr<FluxSourceIterator> readFlux(int track, int side) override

Callers

nothing calls this directly

Calls 2

push_backMethod · 0.45

Tested by

no test coverage detected