query-parser: support phrase queries

This commit is contained in:
djcb
2017-10-26 21:31:22 +03:00
parent e4b3174ed8
commit 7cd7d118e2
5 changed files with 73 additions and 22 deletions

View File

@ -110,6 +110,20 @@ Mux::utf8_flatten (const std::string& str)
}
std::vector<std::string>
Mux::split (const std::string& str, const std::string& sepa)
{
char **parts = g_strsplit(str.c_str(), sepa.c_str(), -1);
std::vector<std::string> vec;
for (auto part = parts; part && *part; ++part)
vec.push_back (*part);
g_strfreev(parts);
return vec;
}
std::string
Mux::quote (const std::string& str)
{