MCPcopy Create free account
hub / github.com/Duet3D/RepRapFirmware / ProcessCustomInfo

Method ProcessCustomInfo

src/Storage/FileInfoParser.cpp:892–926  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

890}
891
892void FileInfoParser::ProcessCustomInfo(const char *_ecv_array k, const char *_ecv_array p, const char *_ecv_array lineEnd, int param) noexcept
893{
894 if (vars != nullptr && isAlpha(*p))
895 {
896 const char *_ecv_array kStart = p;
897 do
898 {
899 ++p;
900 } while (isAlnum(*p) || *p == '_');
901 const size_t nameLength = p - kStart;
902
903 while (*p == ' ' || *p == '\t') { ++p; }
904 if (*p == '=')
905 {
906 ++p;
907 ExpressionParser parser(nullptr, p, lineEnd);
908 try
909 {
910 ExpressionValue ev = parser.Parse(true); // may throw
911 auto vset = vars->GetForWriting();
912 if (vset->Lookup(kStart, nameLength, false) == nullptr)
913 {
914 vset->InsertNew(kStart, nameLength, ev, 0); // may throw
915 }
916 }
917 catch (GCodeException& exc)
918 {
919 if (reprap.Debug(Module::PrintMonitor))
920 {
921 exc.DebugPrint();
922 }
923 }
924 }
925 }
926}
927
928#endif
929

Callers

nothing calls this directly

Calls 3

GetForWritingMethod · 0.80
DebugMethod · 0.80
DebugPrintMethod · 0.45

Tested by

no test coverage detected