Go to the documentation of this file.
23 std::vector<GCodeCommand>
parseFile(
const std::string &filename)
25 std::ifstream file(filename);
26 std::vector<GCodeCommand> commands;
31 while (std::getline(file, line))
37 commands.push_back(command);
44 std::cerr <<
"Unable to open file: " << filename << std::endl;
57 size_t pos = line.find(
';');
58 if (pos != std::string::npos)
72 std::istringstream iss(line);
82 char letter = token[0];
83 std::string value = token.substr(1);
The GCodeCommand class represents a single G-code command.
void setCode(const std::string code)
Set the G-code command.
void addParameter(char letter, const std::string &value)
Method to add a parameter to the G-code command.
The GCodeParser class is used to parse G-code files.
std::vector< GCodeCommand > parseFile(const std::string &filename)
Parses a file and returns a vector of GCodeCommand objects.
GCodeCommand parseLine(const std::string &line)
Parses a line of G-code and returns a GCodeCommand object.
void removeComments(std::string &line)
Removes comments from a line of G-code.
This page is part of the
OOFEM-3.0 documentation. Copyright Copyright (C) 1994-2025 Borek Patzak
Bořek Patzák
Project e-mail:
oofem@fsv.cvut.cz
Generated at for OOFEM by
doxygen
1.15.0 written by Dimitri van Heesch,
© 1997-2011