OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::GUI::anonymous_namespace{TerminalDialog.cpp} Namespace Reference

Functions

bool consume_command_prefix (const std::string &command, const std::string &prefix, std::string &remainder)
std::string quote_command_line_arg (const std::string &value)

Function Documentation

◆ consume_command_prefix()

bool Slic3r::GUI::anonymous_namespace{TerminalDialog.cpp}::consume_command_prefix ( const std::string & command,
const std::string & prefix,
std::string & remainder )
28{
29 size_t pos = 0;
30 while (pos < command.size() && std::isspace(static_cast<unsigned char>(command[pos])))
31 ++pos;
32
33 if (command.compare(pos, prefix.size(), prefix) != 0)
34 return false;
35
36 pos += prefix.size();
37 if (pos < command.size() && !std::isspace(static_cast<unsigned char>(command[pos])))
38 return false;
39
40 while (pos < command.size() && std::isspace(static_cast<unsigned char>(command[pos])))
41 ++pos;
42
43 remainder = command.substr(pos);
44 return true;
45}

References consume_command_prefix().

Referenced by consume_command_prefix().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ quote_command_line_arg()

std::string Slic3r::GUI::anonymous_namespace{TerminalDialog.cpp}::quote_command_line_arg ( const std::string & value)
48{
49 std::string quoted = "\"";
50 for (const char ch : value) {
51 if (ch == '"')
52 quoted += "\\\"";
53 else
54 quoted += ch;
55 }
56 quoted += "\"";
57 return quoted;
58}

References quote_command_line_arg().

Referenced by quote_command_line_arg().

Here is the call graph for this function:
Here is the caller graph for this function: