diff --git a/src/curl.cpp b/src/curl.cpp
index 5737360..1e0a8c7 100644
--- a/src/curl.cpp
+++ b/src/curl.cpp
@@ -2768,8 +2768,8 @@ int S3fsCurl::CompleteMultipartPostRequest(const char* tpath, string& upload_id,
return -1;
}
postContent += "\n";
- postContent += " " + IntToStr(cnt + 1) + "\n";
- postContent += " \"" + parts[cnt] + "\"\n";
+ postContent += " " + str(cnt + 1) + "\n";
+ postContent += " \"" + parts[cnt] + "\"\n";
postContent += "\n";
}
postContent += "\n";
@@ -2983,7 +2983,7 @@ int S3fsCurl::UploadMultipartPostSetup(const char* tpath, int part_num, string&
}
// make request
- string request_uri = "partNumber=" + IntToStr(part_num) + "&uploadId=" + upload_id;
+ string request_uri = "partNumber=" + str(part_num) + "&uploadId=" + upload_id;
string urlargs = "?" + request_uri;
string resource;
string turl;
@@ -3070,7 +3070,7 @@ int S3fsCurl::CopyMultipartPostRequest(const char* from, const char* to, int par
if(!CreateCurlHandle(true)){
return -1;
}
- string urlargs = "?partNumber=" + IntToStr(part_num) + "&uploadId=" + upload_id;
+ string urlargs = "?partNumber=" + str(part_num) + "&uploadId=" + upload_id;
string resource;
string turl;
MakeUrlResource(get_realpath(to).c_str(), resource, turl);
diff --git a/src/string_util.cpp b/src/string_util.cpp
index 6ce5238..1f5d845 100644
--- a/src/string_util.cpp
+++ b/src/string_util.cpp
@@ -85,13 +85,6 @@ string lower(string s)
return s;
}
-string IntToStr(int n)
-{
- stringstream result;
- result << n;
- return result.str();
-}
-
string trim_left(const string &s, const string &t /* = SPACES */)
{
string d(s);
diff --git a/src/string_util.h b/src/string_util.h
index 003b48f..c61141c 100644
--- a/src/string_util.h
+++ b/src/string_util.h
@@ -45,7 +45,6 @@ std::string trim_left(const std::string &s, const std::string &t = SPACES);
std::string trim_right(const std::string &s, const std::string &t = SPACES);
std::string trim(const std::string &s, const std::string &t = SPACES);
std::string lower(std::string s);
-std::string IntToStr(int);
std::string get_date_rfc850(void);
void get_date_sigv3(std::string& date, std::string& date8601);
std::string get_date_string(time_t tm);
diff --git a/src/test_string_util.cpp b/src/test_string_util.cpp
index 9aab04e..593a083 100644
--- a/src/test_string_util.cpp
+++ b/src/test_string_util.cpp
@@ -18,6 +18,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+#include
+#include
#include
#include "string_util.h"
@@ -40,5 +42,13 @@ int main(int argc, char *argv[])
ASSERT_EQUALS(std::string(" 1234"), trim_right(" 1234"));
ASSERT_EQUALS(std::string("1234"), trim_right("1234"));
+ ASSERT_EQUALS(std::string("0"), str(0));
+ ASSERT_EQUALS(std::string("1"), str(1));
+ ASSERT_EQUALS(std::string("-1"), str(-1));
+ ASSERT_EQUALS(std::string("9223372036854775807"), str(std::numeric_limits::max()));
+ ASSERT_EQUALS(std::string("-9223372036854775808"), str(std::numeric_limits::min()));
+ ASSERT_EQUALS(std::string("0"), str(std::numeric_limits::min()));
+ ASSERT_EQUALS(std::string("18446744073709551615"), str(std::numeric_limits::max()));
+
return 0;
}