feat: RemoveQuote

This commit is contained in:
msojocs 2023-08-06 20:15:07 +08:00
parent 349ff43767
commit 8b3abd9b86
2 changed files with 19 additions and 3 deletions

View File

@ -3,9 +3,25 @@
namespace WXSS namespace WXSS
{ {
std::string RemoveQuote(std::string const&) std::string RemoveQuote(std::string const& a2)
{ {
throw "not implement"; std::string a1;
if (a2.length() <= 2)
{
a1 = "";
}
else
{
if (a2[0] == '\'' || a2[0] == '"')
{
a1 = a2.substr(1, a2.length() - 2);
}
else
{
a1 = a2;
}
}
return a1;
} }
int LintAndParseCSSList(std::map<std::string,std::string> const&, std::string&, std::string&, std::string&, int, bool, bool, bool, std::string const&) int LintAndParseCSSList(std::map<std::string,std::string> const&, std::string&, std::string&, std::string&, int, bool, bool, bool, std::string const&)
{ {

View File

@ -7662,7 +7662,7 @@ char *__cdecl WXSS::RemoveQuote(char *a1, char **a2)
else else
{ {
v3 = **a2; v3 = **a2;
if ( v3 == 39 || v3 == 34 ) if ( v3 == '\''/*39*/ || v3 == '"'/*34*/ )
std::string::substr(a1, a2, 1u, (unsigned int)(v2 - 2)); std::string::substr(a1, a2, 1u, (unsigned int)(v2 - 2));
else else
std::string::basic_string(a1, (int)a2); std::string::basic_string(a1, (int)a2);