diff --git a/src/curl.cpp b/src/curl.cpp index 8733c55..6bfb7b5 100644 --- a/src/curl.cpp +++ b/src/curl.cpp @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -4130,8 +4131,8 @@ string prepare_url(const char* url) string uri; string host; string path; - string url_str = str(url); - string token = str("/" + bucket); + string url_str = string(url); + string token = string("/") + bucket; int bucket_pos = url_str.find(token); int bucket_length = token.size(); int uri_length = 0; @@ -4159,7 +4160,7 @@ string prepare_url(const char* url) S3FS_PRN_INFO3("URL changed is %s", url_str.c_str()); - return str(url_str); + return url_str; } /* diff --git a/src/string_util.cpp b/src/string_util.cpp index cd897ed..cb5b6ef 100644 --- a/src/string_util.cpp +++ b/src/string_util.cpp @@ -32,6 +32,21 @@ using namespace std; +template std::string str(T value) { + std::stringstream s; + s << value; + return s.str(); +} + +template std::string str(short value); +template std::string str(unsigned short value); +template std::string str(int value); +template std::string str(unsigned int value); +template std::string str(long value); +template std::string str(unsigned long value); +template std::string str(long long value); +template std::string str(unsigned long long value); + static const char hexAlphabet[] = "0123456789ABCDEF"; off_t s3fs_strtoofft(const char* str, bool is_base_16) diff --git a/src/string_util.h b/src/string_util.h index 5557a38..5011772 100644 --- a/src/string_util.h +++ b/src/string_util.h @@ -28,16 +28,11 @@ #include #include -#include #define SPACES " \t\r\n" #define STR2NCMP(str1, str2) strncmp(str1, str2, strlen(str2)) -template std::string str(T value) { - std::stringstream s; - s << value; - return s.str(); -} +template std::string str(T value); off_t s3fs_strtoofft(const char* str, bool is_base_16 = false);