diff options
author | David Crocker <dcrocker@eschertech.com> | 2021-07-21 13:34:50 +0300 |
---|---|---|
committer | David Crocker <dcrocker@eschertech.com> | 2021-07-21 13:34:50 +0300 |
commit | 7bfc38a39b5b094dfa44af65a1bca227eea8bac2 (patch) | |
tree | f3d2613bb1d3391db17322158c4ee346456d6db8 /src/Storage/FileInfoParser.cpp | |
parent | a6414fd98fc8e5d5523b430e1a11b93eadc2f7cc (diff) |
Added .nc to the list of file extensions that we try to parse
Diffstat (limited to 'src/Storage/FileInfoParser.cpp')
-rw-r--r-- | src/Storage/FileInfoParser.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
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; |