From 7bfc38a39b5b094dfa44af65a1bca227eea8bac2 Mon Sep 17 00:00:00 2001 From: David Crocker Date: Wed, 21 Jul 2021 11:34:50 +0100 Subject: Added .nc to the list of file extensions that we try to parse --- src/Storage/FileInfoParser.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/Storage/FileInfoParser.cpp') diff --git a/src/Storage/FileInfoParser.cpp b/src/Storage/FileInfoParser.cpp index 8dc1a96e..56681ab0 100644 --- a/src/Storage/FileInfoParser.cpp +++ b/src/Storage/FileInfoParser.cpp @@ -79,8 +79,18 @@ GCodeResult FileInfoParser::GetFileInfo(const char *filePath, GCodeFileInfo& inf } // If the file is empty or not a G-Code file, we don't need to parse anything - if (fileBeingParsed->Length() == 0 || (!StringEndsWithIgnoreCase(filePath, ".gcode") && !StringEndsWithIgnoreCase(filePath, ".g") - && !StringEndsWithIgnoreCase(filePath, ".gco") && !StringEndsWithIgnoreCase(filePath, ".gc"))) + constexpr const char *GcodeFileExtensions[] = { ".gcode", ".g", ".gco", ".gc", ".nc" }; + bool isGcodeFile = false; + for (const char *ext : GcodeFileExtensions) + { + if (StringEndsWithIgnoreCase(filePath, ext)) + { + isGcodeFile = true; + break; + } + } + + if (fileBeingParsed->Length() == 0 || !isGcodeFile) { fileBeingParsed->Close(); parsedFileInfo.incomplete = false; -- cgit v1.2.3