[cstdstring] removal of Trim/TrimLeft/TrimRight
[vuplus_xbmc] / xbmc / utils / LangCodeExpander.cpp
index 3d99afd..a550e91 100644 (file)
@@ -147,9 +147,8 @@ bool CLangCodeExpander::ConvertTwoToThreeCharCode(CStdString& strThreeCharCode,
   if ( strTwoCharCode.length() == 2 )
   {
     CStdString strTwoCharCodeLower( strTwoCharCode );
-    strTwoCharCodeLower.MakeLower();
-    strTwoCharCodeLower.TrimLeft();
-    strTwoCharCodeLower.TrimRight();
+    StringUtils::ToLower(strTwoCharCodeLower);
+    StringUtils::Trim(strTwoCharCodeLower);
 
     for (unsigned int index = 0; index < sizeof(CharCode2To3) / sizeof(CharCode2To3[0]); ++index)
     {
@@ -226,9 +225,8 @@ bool CLangCodeExpander::ConvertLinuxToWindowsRegionCodes(const CStdString& strTw
     return false;
 
   CStdString strLower( strTwoCharCode );
-  strLower.MakeLower();
-  strLower.TrimLeft();
-  strLower.TrimRight();
+  StringUtils::ToLower(strLower);
+  StringUtils::Trim(strLower);
   for (unsigned int index = 0; index < sizeof(RegionCode2To3) / sizeof(RegionCode2To3[0]); ++index)
   {
     if (strLower.Equals(RegionCode2To3[index].old))
@@ -327,7 +325,7 @@ bool CLangCodeExpander::ReverseLookup(const CStdString& desc, CStdString& code)
     return false;
 
   CStdString descTmp(desc);
-  descTmp.Trim();
+  StringUtils::Trim(descTmp);
   STRINGLOOKUPTABLE::iterator it;
   for (it = m_mapUser.begin(); it != m_mapUser.end() ; it++)
   {
@@ -364,9 +362,9 @@ bool CLangCodeExpander::LookupInMap(CStdString& desc, const CStdString& code)
   STRINGLOOKUPTABLE::iterator it;
   //Make sure we convert to lowercase before trying to find it
   CStdString sCode(code);
-  sCode.MakeLower();
-  sCode.TrimLeft();
-  sCode.TrimRight();
+  StringUtils::ToLower(sCode);
+  StringUtils::Trim(sCode);
+
   it = m_mapUser.find(sCode);
   if (it != m_mapUser.end())
   {
@@ -383,9 +381,9 @@ bool CLangCodeExpander::LookupInDb(CStdString& desc, const CStdString& code)
 
   long longcode;
   CStdString sCode(code);
-  sCode.MakeLower();
-  sCode.TrimLeft();
-  sCode.TrimRight();
+  StringUtils::ToLower(sCode);
+  StringUtils::Trim(sCode);
+
   if(sCode.length() == 2)
   {
     longcode = MAKECODE('\0', '\0', sCode[0], sCode[1]);