mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-08 15:37:30 -06:00
Merge remote-tracking branch 'remote/master' into SoftFever
This commit is contained in:
commit
4fd174175c
298 changed files with 13879 additions and 6228 deletions
|
@ -1182,6 +1182,42 @@ std::string xml_escape(std::string text, bool is_marked/* = false*/)
|
|||
return text;
|
||||
}
|
||||
|
||||
std::string xml_unescape(std::string s)
|
||||
{
|
||||
std::string ret;
|
||||
std::string::size_type i = 0;
|
||||
std::string::size_type pos = 0;
|
||||
while (i < s.size()) {
|
||||
std::string rep;
|
||||
if (s[i] == '&') {
|
||||
if (s.substr(i, 4) == "<") {
|
||||
ret += s.substr(pos, i - pos) + "<";
|
||||
i += 4;
|
||||
pos = i;
|
||||
}
|
||||
else if (s.substr(i, 4) == ">") {
|
||||
ret += s.substr(pos, i - pos) + ">";
|
||||
i += 4;
|
||||
pos = i;
|
||||
}
|
||||
else if (s.substr(i, 5) == "&") {
|
||||
ret += s.substr(pos, i - pos) + "&";
|
||||
i += 5;
|
||||
pos = i;
|
||||
}
|
||||
else {
|
||||
++i;
|
||||
}
|
||||
}
|
||||
else {
|
||||
++i;
|
||||
}
|
||||
}
|
||||
|
||||
ret += s.substr(pos);
|
||||
return ret;
|
||||
}
|
||||
|
||||
std::string format_memsize_MB(size_t n)
|
||||
{
|
||||
std::string out;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue