[cstdstring] remove GetAt()
authorJonathan Marshall <jmarshall@xbmc.org>
Sun, 27 Oct 2013 05:12:03 +0000 (18:12 +1300)
committerJonathan Marshall <jmarshall@xbmc.org>
Wed, 13 Nov 2013 21:53:03 +0000 (10:53 +1300)
xbmc/FileItem.cpp
xbmc/Util.cpp
xbmc/network/linux/NetworkLinux.cpp
xbmc/utils/StdString.h

index 7f8ea59..99ac881 100644 (file)
@@ -3051,7 +3051,7 @@ bool CFileItem::LoadMusicTag()
     if (iTrack >= 1)
     {
       CStdString strText = g_localizeStrings.Get(554); // "Track"
-      if (strText.GetAt(strText.size() - 1) != ' ')
+      if (!strText.empty() && strText[strText.size() - 1] != ' ')
         strText += " ";
       CStdString strTrack = StringUtils::Format(strText + "%i", iTrack);
       GetMusicInfoTag()->SetTitle(strTrack);
index 1ca8b5b..576f740 100644 (file)
@@ -283,16 +283,16 @@ void CUtil::CleanString(const CStdString& strFileName, CStdString& strTitle, CSt
     bool initialDots = true;
     bool alreadyContainsSpace = (strTitleAndYear.find(' ') != std::string::npos);
 
-    for (int i = 0; i < (int)strTitleAndYear.size(); i++)
+    for (size_t i = 0; i < strTitleAndYear.size(); i++)
     {
-      char c = strTitleAndYear.GetAt(i);
+      char c = strTitleAndYear[i];
 
       if (c != '.')
         initialDots = false;
 
       if ((c == '_') || ((!alreadyContainsSpace) && !initialDots && (c == '.')))
       {
-        strTitleAndYear.SetAt(i, ' ');
+        strTitleAndYear[i] = ' ';
       }
     }
   }
index 9e54915..9c4a8d6 100644 (file)
@@ -920,7 +920,7 @@ void CNetworkInterfaceLinux::GetSettings(NetworkAssignment& assignment, CStdStri
       StringUtils::TrimRight(s," \n");
 
       // skip comments
-      if (s.length() == 0 || s.GetAt(0) == '#')
+      if (s.empty() || s[0] == '#')
          continue;
 
       // look for "iface <interface name> inet"
@@ -1006,7 +1006,7 @@ void CNetworkInterfaceLinux::SetSettings(NetworkAssignment& assignment, CStdStri
       StringUtils::TrimRight(s," \n");
 
       // skip comments
-      if (!foundInterface && (s.length() == 0 || s.GetAt(0) == '#'))
+      if (!foundInterface && (s.empty() || s[0] == '#'))
       {
         fprintf(fw, "%s", line);
         continue;
index 3c6e662..662cdca 100644 (file)
@@ -2611,11 +2611,6 @@ public:
   // -------------------------------------------------------------------------
   // GetXXXX -- Direct access to character buffer
   // -------------------------------------------------------------------------
-  CT GetAt(int nIdx) const
-  {
-    return this->at(static_cast<MYSIZE>(nIdx));
-  }
-
   CT* GetBuffer(int nMinLen=-1)
   {
     return GetBuf(nMinLen);
@@ -2643,12 +2638,6 @@ public:
     RelBuf(nNewLen);
   }
 
-  void SetAt(int nIndex, CT ch)
-  {
-    ASSERT(this->size() > static_cast<MYSIZE>(nIndex));
-    this->at(static_cast<MYSIZE>(nIndex))    = ch;
-  }
-
 #ifndef SS_ANSI
   BSTR SetSysString(BSTR* pbstr) const
   {