utility: removed templates from utilityString functions to use std::deque by default

This commit is contained in:
Eberhard Graether
2014-09-11 17:37:18 +02:00
parent fec7abbc9b
commit 95ece9ef2e
9 changed files with 172 additions and 194 deletions
+5 -5
View File
@@ -400,17 +400,17 @@ SearchIndex::SearchNode* SearchIndex::getNode(const std::string& fullName) const
std::vector<SearchIndex::SearchMatch> SearchIndex::findFuzzyMatches(const std::string& query) const
{
std::vector<std::string> names = utility::split<std::vector<std::string>>(query, '\"');
std::deque<std::string> names = utility::split(query, '\"');
if (names.size() == 3 && names[0].size() == 0)
if (names.size() == 3 && names.at(0).size() == 0)
{
SearchNode* node = getNode(names[1]);
SearchNode* node = getNode(names.at(1));
if (!node)
{
LOG_ERROR_STREAM(<< "Couldn't find node with name " << names[1] << " in the SearchIndex.");
LOG_ERROR_STREAM(<< "Couldn't find node with name " << names.at(1) << " in the SearchIndex.");
}
return node->findFuzzyMatches(names[2]);
return node->findFuzzyMatches(names.at(2));
}
return m_root.findFuzzyMatches(query);
@@ -57,7 +57,7 @@ std::shared_ptr<TokenComponent> TokenComponentNameCached::copy() const
const std::string& TokenComponentNameCached::getName() const
{
return utility::split<std::deque<std::string>>(m_fullName, SearchIndex::DELIMITER).back();
return utility::split(m_fullName, SearchIndex::DELIMITER).back();
}
std::string TokenComponentNameCached::getFullName() const
+1 -1
View File
@@ -6,7 +6,7 @@
QueryToken::QueryToken(const std::string& name)
{
std::deque<std::string> names = utility::split<std::deque<std::string>>(name, DELIMITER);
std::deque<std::string> names = utility::split(name, DELIMITER);
m_tokenName = names.front();
names.pop_front();
+3 -4
View File
@@ -8,12 +8,11 @@
std::deque<std::string> QueryTree::tokenizeQuery(const std::string& query)
{
std::deque<std::string> tokensTmp =
utility::split<std::deque<std::string>>(query, QueryOperator::getOperator(QueryOperator::OPERATOR_NONE));
std::deque<std::string> tokensTmp = utility::split(query, QueryOperator::getOperator(QueryOperator::OPERATOR_NONE));
for (const std::pair<char, QueryOperator::OperatorType>& p : QueryOperator::getOperatorTypeMap())
{
tokensTmp = utility::tokenize<std::deque<std::string>>(tokensTmp, p.first);
tokensTmp = utility::tokenize(tokensTmp, p.first);
}
char operatorToken = QueryOperator::getOperator(QueryOperator::OPERATOR_TOKEN);
@@ -49,7 +48,7 @@ QueryTree::QueryTree(const std::string& query)
{
std::deque<std::string> tokens = tokenizeQuery(query);
m_query = utility::join<std::deque<std::string>>(tokens, ' ');
m_query = utility::join(tokens, ' ');
m_root = buildTree(tokens, nullptr);
}