mirror of
https://github.com/davidgiven/fluxengine.git
synced 2025-10-31 11:17:01 -07:00
Make the new FL2 flux format the default.
This commit is contained in:
@@ -50,6 +50,13 @@ private:
|
||||
|
||||
std::unique_ptr<FluxSource> FluxSource::createFl2FluxSource(const Fl2FluxSourceProto& config)
|
||||
{
|
||||
char buffer[16];
|
||||
std::ifstream(config.filename(), std::ios::in | std::ios::binary).read(buffer, 16);
|
||||
if (strncmp(buffer, "SQLite format 3", 16) == 0)
|
||||
{
|
||||
std::cerr << "Warning: reading a deprecated flux file format; please upgrade it\n";
|
||||
return FluxSource::createSqliteFluxSource(config.filename());
|
||||
}
|
||||
return std::unique_ptr<FluxSource>(new Fl2FluxSource(config));
|
||||
}
|
||||
|
||||
|
||||
@@ -50,12 +50,12 @@ std::unique_ptr<FluxSource> FluxSource::create(const FluxSourceProto& config)
|
||||
|
||||
void FluxSource::updateConfigForFilename(FluxSourceProto* proto, const std::string& filename)
|
||||
{
|
||||
|
||||
static const std::vector<std::pair<std::regex, std::function<void(const std::string&)>>> formats =
|
||||
{
|
||||
{ std::regex("^(.*\\.flux)$"), [&](const auto& s) { proto->set_fluxfile(s); }},
|
||||
{ std::regex("^(.*\\.flux)$"), [&](const auto& s) { proto->mutable_fl2()->set_filename(s); }},
|
||||
{ std::regex("^(.*\\.scp)$"), [&](const auto& s) { proto->mutable_scp()->set_filename(s); }},
|
||||
{ std::regex("^(.*\\.cwf)$"), [&](const auto& s) { proto->mutable_cwf()->set_filename(s); }},
|
||||
{ std::regex("^(.*\\.fl2)$"), [&](const auto& s) { proto->mutable_fl2()->set_filename(s); }},
|
||||
{ std::regex("^erase:$"), [&](const auto& s) { proto->mutable_erase(); }},
|
||||
{ std::regex("^kryoflux:(.*)$"), [&](const auto& s) { proto->mutable_kryoflux()->set_directory(s); }},
|
||||
{ std::regex("^testpattern:(.*)"), [&](const auto& s) { proto->mutable_test_pattern(); }},
|
||||
|
||||
Reference in New Issue
Block a user