mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2025-01-11 00:21:45 +00:00
Move str definition from header to implementation
Also clean up some char * to std::string conversions.
This commit is contained in:
parent
259f028490
commit
bbad76bb71
@ -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>
|
||||||
@ -4130,8 +4131,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;
|
||||||
@ -4159,7 +4160,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,16 +28,11 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <sstream>
|
|
||||||
|
|
||||||
#define SPACES " \t\r\n"
|
#define SPACES " \t\r\n"
|
||||||
#define STR2NCMP(str1, str2) strncmp(str1, str2, strlen(str2))
|
#define STR2NCMP(str1, str2) 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