Skip to content

Commit

Permalink
[cstdstring] remove unused StringUtils::JoinString
Browse files Browse the repository at this point in the history
  • Loading branch information
night199uk committed Feb 18, 2014
1 parent b4cabaf commit e16af6c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 21 deletions.
24 changes: 5 additions & 19 deletions xbmc/utils/StringUtils.cpp
Expand Up @@ -476,32 +476,18 @@ bool StringUtils::EndsWithNoCase(const std::string &str1, const char *s2)
return true;
}

void StringUtils::JoinString(const CStdStringArray &strings, const CStdString& delimiter, CStdString& result)
CStdString StringUtils::Join(const vector<string> &strings, const CStdString& delimiter)
{
result = "";
for(CStdStringArray::const_iterator it = strings.begin(); it != strings.end(); it++ )
result += (*it) + delimiter;

CStdString result = "";
for(vector<string>::const_iterator it = strings.begin(); it != strings.end(); it++ )
result += (*it) + (std::string) delimiter;
if(result != "")
result.erase(result.size()-delimiter.size(), delimiter.size());
}

CStdString StringUtils::JoinString(const CStdStringArray &strings, const CStdString& delimiter)
{
CStdString result;
JoinString(strings, delimiter, result);
return result;
}

CStdString StringUtils::Join(const vector<string> &strings, const CStdString& delimiter)
{
CStdStringArray strArray;
for (unsigned int index = 0; index < strings.size(); index++)
strArray.push_back(strings.at(index));

return JoinString(strArray, delimiter);
}

// Splits the string input into pieces delimited by delimiter.
// if 2 delimiters are in a row, it will include the empty string between them.
// added MaxStrings parameter to restrict the number of returned substrings (like perl and python)
Expand Down
2 changes: 0 additions & 2 deletions xbmc/utils/StringUtils.h
Expand Up @@ -89,8 +89,6 @@ class StringUtils
static bool EndsWithNoCase(const std::string &str1, const std::string &str2);
static bool EndsWithNoCase(const std::string &str1, const char *s2);

static void JoinString(const CStdStringArray &strings, const CStdString& delimiter, CStdString& result);
static CStdString JoinString(const CStdStringArray &strings, const CStdString& delimiter);
static CStdString Join(const std::vector<std::string> &strings, const CStdString& delimiter);
static std::vector<std::string> Split(const std::string& input, const std::string& delimiter, unsigned int iMaxStrings = 0);
static int FindNumber(const CStdString& strInput, const CStdString &strFind);
Expand Down

0 comments on commit e16af6c

Please sign in to comment.