mirror of
https://git.mirrors.martin98.com/https://github.com/SoftFever/OrcaSlicer.git
synced 2025-08-15 18:15:53 +08:00
parent
7a0e0179c7
commit
4011a0d748
@ -43,7 +43,7 @@ namespace Slic3r {
|
|||||||
//static const std::string CONFIG_INHERITS_KEY = "inherits";
|
//static const std::string CONFIG_INHERITS_KEY = "inherits";
|
||||||
//static const std::string CONFIG_INSTANT_KEY = "instantiation";
|
//static const std::string CONFIG_INSTANT_KEY = "instantiation";
|
||||||
|
|
||||||
// Escape \n, \r and backslash
|
// Escape double quotes, \n, \r and backslash
|
||||||
std::string escape_string_cstyle(const std::string &str)
|
std::string escape_string_cstyle(const std::string &str)
|
||||||
{
|
{
|
||||||
// Allocate a buffer twice the input string length,
|
// Allocate a buffer twice the input string length,
|
||||||
@ -58,9 +58,9 @@ std::string escape_string_cstyle(const std::string &str)
|
|||||||
} else if (c == '\n') {
|
} else if (c == '\n') {
|
||||||
(*outptr ++) = '\\';
|
(*outptr ++) = '\\';
|
||||||
(*outptr ++) = 'n';
|
(*outptr ++) = 'n';
|
||||||
} else if (c == '\\') {
|
} else if (c == '\\' || c == '"') {
|
||||||
(*outptr ++) = '\\';
|
(*outptr++) = '\\';
|
||||||
(*outptr ++) = '\\';
|
(*outptr++) = c;
|
||||||
} else
|
} else
|
||||||
(*outptr ++) = c;
|
(*outptr ++) = c;
|
||||||
}
|
}
|
||||||
@ -117,7 +117,7 @@ std::string escape_strings_cstyle(const std::vector<std::string> &strs)
|
|||||||
return std::string(out.data(), outptr - out.data());
|
return std::string(out.data(), outptr - out.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unescape \n, \r and backslash
|
// Unescape double quotes, \n, \r and backslash
|
||||||
bool unescape_string_cstyle(const std::string &str, std::string &str_out)
|
bool unescape_string_cstyle(const std::string &str, std::string &str_out)
|
||||||
{
|
{
|
||||||
std::vector<char> out(str.size(), 0);
|
std::vector<char> out(str.size(), 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user