Browse Source

Merge pull request #947 from AtomicGameEngine/JME-ATOMIC-STRINGUPDATE

Backing out string concat API
JoshEngebretson 9 years ago
parent
commit
4209a61e6f

+ 11 - 80
Source/Atomic/Container/Str.h

@@ -202,28 +202,28 @@ public:
         return *this;
     }
 
-    /// Add-assign an integer.
+    /// Add-assign (concatenate as string) an integer.
     String& operator +=(int rhs);
-    /// Add-assign a short integer.
+    /// Add-assign (concatenate as string) a short integer.
     String& operator +=(short rhs);
-    /// Add-assign a long integer.
+    /// Add-assign (concatenate as string) a long integer.
     String& operator +=(long rhs);
-    /// Add-assign a long long integer.
+    /// Add-assign (concatenate as string) a long long integer.
     String& operator +=(long long rhs);
-    /// Add-assign an unsigned integer.
+    /// Add-assign (concatenate as string) an unsigned integer.
     String& operator +=(unsigned rhs);
-    /// Add-assign a short unsigned integer.
+    /// Add-assign (concatenate as string) a short unsigned integer.
     String& operator +=(unsigned short rhs);
-    /// Add-assign a long unsigned integer.
+    /// Add-assign (concatenate as string) a long unsigned integer.
     String& operator +=(unsigned long rhs);
-    /// Add-assign a long long unsigned integer.
+    /// Add-assign (concatenate as string) a long long unsigned integer.
     String& operator +=(unsigned long long rhs);
-    /// Add-assign a float.
+    /// Add-assign (concatenate as string) a float.
     String& operator +=(float rhs);
-    /// Add-assign a bool.
+    /// Add-assign (concatenate as string) a bool.
     String& operator +=(bool rhs);
 
-    /// Add-assign an arbitraty type.
+    /// Add-assign (concatenate as string) an arbitrary type.
     template <class T> String operator +=(const T& rhs) { return *this += rhs.ToString(); }
 
     /// Add a string.
@@ -249,75 +249,6 @@ public:
         return ret;
     }
 
-    /// Add a character.
-    String operator +(char rhs) const
-    {
-        String ret(*this);
-        ret += rhs;
-
-        return ret;
-    }
-
-    /// Add an integer.
-    String operator +(int rhs) const
-    {
-        return *this + String(rhs);
-    }
-
-    /// Add a short integer.
-    String operator +(short rhs) const
-    {
-        return *this + String(rhs);
-    }
-
-    /// Add a long integer.
-    String operator +(long rhs) const
-    {
-        return *this + String(rhs);
-    }
-
-    /// Add a long long integer.
-    String operator +(long long rhs) const
-    {
-        return *this + String(rhs);
-    }
-
-    /// Add an unsigned integer.
-    String operator +(unsigned rhs) const
-    {
-        return *this + String(rhs);
-    }
-
-    /// Add a short unsigned integer.
-    String operator +(unsigned short rhs) const
-    {
-        return *this + String(rhs);
-    }
-
-    /// Add a long unsigned integer.
-    String operator +(unsigned long rhs) const
-    {
-        return *this + String(rhs);
-    }
-
-    /// Add a long long unsigned integer.
-    String operator +(unsigned long long rhs) const
-    {
-        return *this + String(rhs);
-    }
-
-    /// Add a float.
-    String operator +(float rhs) const
-    {
-        return *this + String(rhs);
-    }
-
-    /// Add a bool.
-    String operator +(bool rhs) const
-    {
-        return *this + String(rhs);
-    }
-
     /// Test for equality with another string.
     bool operator ==(const String& rhs) const { return strcmp(CString(), rhs.CString()) == 0; }
 

+ 1 - 1
Source/Atomic/Core/ProcessUtils.cpp

@@ -230,7 +230,7 @@ void PrintUnicode(const String& str, bool error)
 
 void PrintUnicodeLine(const String& str, bool error)
 {
-    PrintUnicode(str + '\n', error);
+    PrintUnicode(str + "\n", error);
 }
 
 void PrintLine(const String& str, bool error)

+ 1 - 1
Source/Atomic/IO/FileSystem.cpp

@@ -640,7 +640,7 @@ bool FileSystem::DirExists(const String& pathName) const
     if (ATOMIC_IS_ASSET(fixedName))
     {
         // Split the pathname into two components: the longest parent directory path and the last name component
-        String assetPath(ATOMIC_ASSET((fixedName + '/')));
+        String assetPath(ATOMIC_ASSET((fixedName + "/")));
         String parentPath;
         unsigned pos = assetPath.FindLast('/', assetPath.Length() - 2);
         if (pos != String::NPOS)

+ 1 - 1
Source/Atomic/Network/MasterServerClient.cpp

@@ -133,7 +133,7 @@ void MasterServerClient::SendMessageToMasterServer(const String& msg)
 {
     if (masterTCPConnection_)
     {
-        String netString = String(msg.Length()) + ':' + msg;
+        String netString = String(msg.Length()) + ":" + msg;
         masterTCPConnection_->Send(netString.CString(), netString.Length());
     }
     else

+ 1 - 1
Source/Atomic/Scene/Scene.cpp

@@ -1084,7 +1084,7 @@ String Scene::GetVarNamesAttr() const
     if (!varNames_.Empty())
     {
         for (HashMap<StringHash, String>::ConstIterator i = varNames_.Begin(); i != varNames_.End(); ++i)
-            ret += i->second_ + ';';
+            ret += i->second_ + ";";
 
         ret.Resize(ret.Length() - 1);
     }

+ 1 - 1
Source/ToolCore/Build/ResourcePackager.cpp

@@ -133,7 +133,7 @@ bool ResourcePackager::WritePackageFile(const String& destFilePath)
             unsigned packedSize = LZ4_compressHC((const char*)&buffer[pos], (char*)compressBuffer.Get(), unpackedSize);
             if (!packedSize)
             {
-                buildBase_->FailBuild("LZ4 compression failed for file " + entry->absolutePath_ + " at offset " + pos);
+                buildBase_->FailBuild(ToString("LZ4 compression failed for file %s at offset %u", entry->absolutePath_.CString(), pos));
                 return false;
             }
 

+ 1 - 1
Source/Tools/PackageTool/PackageTool.cpp

@@ -229,7 +229,7 @@ void WritePackageFile(const String& fileName, const String& rootDir)
                 
                 unsigned packedSize = LZ4_compressHC((const char*)&buffer[pos], (char*)compressBuffer.Get(), unpackedSize);
                 if (!packedSize)
-                    ErrorExit("LZ4 compression failed for file " + entries_[i].name_ + " at offset " + pos);
+                    ErrorExit("LZ4 compression failed for file " + entries_[i].name_ + " at offset " + String(pos));
                 
                 dest.WriteUShort(unpackedSize);
                 dest.WriteUShort(packedSize);