mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2024-12-23 09:18:55 +00:00
Merge pull request #676 from gaul/sstream
Move str definition from header to implementation
This commit is contained in:
commit
e1928288fe
@ -36,6 +36,7 @@
|
|||||||
#include <libxml/tree.h>
|
#include <libxml/tree.h>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
#include <sstream>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
@ -4141,8 +4142,8 @@ string prepare_url(const char* url)
|
|||||||
string uri;
|
string uri;
|
||||||
string host;
|
string host;
|
||||||
string path;
|
string path;
|
||||||
string url_str = str(url);
|
string url_str = string(url);
|
||||||
string token = str("/" + bucket);
|
string token = string("/") + bucket;
|
||||||
int bucket_pos = url_str.find(token);
|
int bucket_pos = url_str.find(token);
|
||||||
int bucket_length = token.size();
|
int bucket_length = token.size();
|
||||||
int uri_length = 0;
|
int uri_length = 0;
|
||||||
@ -4170,7 +4171,7 @@ string prepare_url(const char* url)
|
|||||||
|
|
||||||
S3FS_PRN_INFO3("URL changed is %s", url_str.c_str());
|
S3FS_PRN_INFO3("URL changed is %s", url_str.c_str());
|
||||||
|
|
||||||
return str(url_str);
|
return url_str;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -32,6 +32,21 @@
|
|||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
template <class T> 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";
|
static const char hexAlphabet[] = "0123456789ABCDEF";
|
||||||
|
|
||||||
off_t s3fs_strtoofft(const char* str, bool is_base_16)
|
off_t s3fs_strtoofft(const char* str, bool is_base_16)
|
||||||
|
@ -28,17 +28,12 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <sstream>
|
|
||||||
|
|
||||||
static const std::string SPACES = " \t\r\n";
|
static const std::string SPACES = " \t\r\n";
|
||||||
|
|
||||||
static inline int STR2NCMP(const char *str1, const char *str2) { return strncmp(str1, str2, strlen(str2)); }
|
static inline int STR2NCMP(const char *str1, const char *str2) { return strncmp(str1, str2, strlen(str2)); }
|
||||||
|
|
||||||
template<typename T> std::string str(T value) {
|
template <class T> std::string str(T value);
|
||||||
std::stringstream s;
|
|
||||||
s << value;
|
|
||||||
return s.str();
|
|
||||||
}
|
|
||||||
|
|
||||||
off_t s3fs_strtoofft(const char* str, bool is_base_16 = false);
|
off_t s3fs_strtoofft(const char* str, bool is_base_16 = false);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user