2 #include "../acl_cpp_define.hpp" 30 string(
size_t n,
bool bin);
53 string(
const void* s,
size_t n);
55 #if defined(_WIN32) || defined(_WIN64) 62 string(
void* fd,
size_t max,
size_t n);
64 string(
int fd,
size_t max,
size_t n);
77 string& set_bin(
bool bin);
84 string& set_max(
int max);
96 int get_max(
void)
const;
105 char operator[](
size_t n)
const;
114 char operator[](
int n)
const;
122 char& operator[](
size_t n);
130 char& operator[](
int n);
137 string& operator=(
const char* s);
144 string& operator=(
const string& s);
151 string& operator=(
const string* s);
158 string& operator=(
const std::string& s);
165 string& operator=(
const std::string* s);
167 #if defined(_WIN32) || defined(_WIN64) 176 string& operator=(__int64 n);
186 string& operator=(
unsigned __int64);
188 string& operator=(
long long int);
189 string& operator=(
unsigned long long int);
199 string& operator=(
char n);
208 string& operator=(
unsigned char n);
217 string& operator=(
long n);
226 string& operator=(
unsigned long n);
235 string& operator=(
int n);
244 string& operator=(
unsigned int n);
253 string& operator=(
short n);
262 string& operator=(
unsigned short n);
269 string& operator+=(
const char* s);
276 string& operator+=(
const string& s);
283 string& operator+=(
const string* s);
290 string& operator+=(
const std::string& s);
297 string& operator+=(
const std::string* s);
299 #if defined(_WIN32) || defined(_WIN64) 306 string& operator+=(__int64 n);
314 string& operator+=(
unsigned __int64 n);
316 string& operator+=(
long long int n);
317 string& operator+=(
unsigned long long int n);
326 string& operator+=(
long n);
334 string& operator+=(
unsigned long n);
342 string& operator+=(
int n);
350 string& operator+=(
unsigned int n);
358 string& operator+=(
short n);
366 string& operator+=(
unsigned short n);
374 string& operator+=(
char n);
382 string& operator+=(
unsigned char n);
389 string& operator<<(
const string& s);
396 string& operator<<(
const string* s);
403 string& operator<<(
const std::string& s);
410 string& operator<<(
const std::string* s);
417 string& operator<<(
const char* s);
418 #if defined(_WIN32) || defined(_WIN64) 425 string& operator<<(__int64 n);
433 string& operator<<(
unsigned __int64 n);
435 string& operator<<(
long long int n);
436 string& operator<<(
unsigned long long int n);
445 string& operator<<(
long n);
453 string& operator<<(
unsigned long n);
461 string& operator<<(
int n);
469 string& operator<<(
unsigned int n);
477 string& operator<<(
short n);
485 string& operator<<(
unsigned short n);
493 string& operator<<(
char n);
501 string& operator<<(
unsigned char n);
508 size_t operator>>(
string* s);
515 size_t operator>>(
string& s);
522 size_t operator>>(std::string* s);
529 size_t operator>>(std::string& s);
531 #if defined(_WIN32) || defined(_WIN64) 537 size_t operator>>(__int64& n);
544 size_t operator>>(
unsigned __int64& n);
546 size_t operator>>(
long long int&);
547 size_t operator>>(
unsigned long long int&);
555 size_t operator>>(
int& n);
562 size_t operator>>(
unsigned int& n);
569 size_t operator>>(
short& n);
576 size_t operator>>(
unsigned short& n);
583 size_t operator>>(
char& n);
590 size_t operator>>(
unsigned char& n);
597 bool operator==(
const string& s)
const;
604 bool operator==(
const string* s)
const;
611 bool operator==(
const char* s)
const;
618 bool operator!=(
const string& s)
const;
625 bool operator!=(
const string* s)
const;
632 bool operator!=(
const char* s)
const;
640 bool operator<(
const string& s)
const;
648 bool operator>(
const string& s)
const;
654 operator const char*()
const;
660 operator const void*()
const;
667 string& push_back(
char ch);
675 bool equal(
const string& s,
bool case_sensitive =
true)
const;
683 bool begin_with(
const char* s,
bool case_sensitive =
true)
const;
684 bool begin_with(
const char* s,
size_t len,
bool case_sensitive =
true)
const;
685 bool begin_with(
const string& s,
bool case_sensitive =
true)
const;
686 bool begin_with(
const void* v,
size_t len)
const;
694 bool end_with(
const char* s,
bool case_sensitive =
true)
const;
695 bool end_with(
const char* s,
size_t len,
bool case_sensitive =
true)
const;
696 bool end_with(
const string& s,
bool case_sensitive =
true)
const;
697 bool end_with(
const void* v,
size_t len)
const;
705 int compare(
const string& s)
const;
713 int compare(
const string* s)
const;
722 int compare(
const char* s,
bool case_sensitive =
true)
const;
733 int compare(
const void* ptr,
size_t len)
const;
743 int ncompare(
const char* s,
size_t len,
bool case_sensitive =
true)
const;
755 int rncompare(
const char* s,
size_t len,
bool case_sensitive =
true)
const;
768 int find_blank_line(
int* left_count = NULL,
string* buf = NULL);
775 string& find_reset(
void);
782 int find(
char n)
const;
790 char* find(
const char* needle,
bool case_sensitive=
true)
const;
798 char* rfind(
const char* needle,
bool case_sensitive=
true)
const;
807 string left(
size_t n);
816 string right(
size_t n);
826 size_t scan_buf(
void* buf,
size_t size,
bool move =
false);
841 bool scan_line(
string& out,
bool nonl =
true,
size_t* n = NULL,
873 size_t length()
const;
885 size_t capacity()
const;
905 string& set_offset(
size_t n);
912 string& space(
size_t n);
922 std::list<string>& split(
const char* sep,
bool quoted =
false);
932 std::vector<string>& split2(
const char* sep,
bool quoted =
false);
941 std::pair<string, string>& split_nameval(
void);
948 string& copy(
const char* ptr);
956 string& copy(
const void* ptr,
size_t len);
964 string& memmove(
const char* src);
973 string& memmove(
const char* src,
size_t len);
980 string& append(
const string& s);
987 string& append(
const string* s);
994 string& append(
const char* s);
1002 string& append(
const void* ptr,
size_t len);
1009 string& prepend(
const char* s);
1017 string& prepend(
const void* ptr,
size_t len);
1026 string& insert(
size_t start,
const void* ptr,
size_t len);
1042 string& vformat(
const char*
fmt, va_list ap);
1058 string& vformat_append(
const char*
fmt, va_list ap);
1066 string& replace(
char from,
char to);
1074 string& truncate(
size_t n);
1088 string& strip(
const char* needle,
bool each =
false);
1094 string& trim_left_space();
1100 string& trim_right_space();
1106 string& trim_space();
1112 string& trim_left_line();
1118 string& trim_right_line();
1124 string& trim_line();
1136 string& lower(
void);
1142 string& upper(
void);
1153 size_t substr(
string& out,
size_t p = 0,
size_t len = 0)
const;
1159 string& base64_encode(
void);
1167 string& base64_encode(
const void* ptr,
size_t len);
1175 string& base64_decode(
void);
1183 string& base64_decode(
const char* s);
1192 string& base64_decode(
const void* ptr,
size_t len);
1202 string& url_encode(
const char* s,
dbuf_pool* dbuf = NULL);
1211 string& url_decode(
const char* s,
dbuf_pool* dbuf = NULL);
1219 string& hex_encode(
const void* s,
size_t len);
1227 string& hex_decode(
const char* s,
size_t len);
1234 string& basename(
const char* path);
1241 string& dirname(
const char* path);
1248 static string& parse_int(
int n);
1255 static string& parse_int(
unsigned int n);
1256 #if defined(_WIN32) || defined(_WIN64) 1257 static string& parse_int64(__int64 n);
1258 static string& parse_int64(
unsigned __int64 n);
1265 static string& parse_int64(
long long int n);
1272 static string& parse_int64(
unsigned long long int n);
1281 template<
typename T>
1292 std::list<string>* list_tmp_;
1293 std::vector<string>* vector_tmp_;
1294 std::pair<string, string>* pair_tmp_;
1296 int line_state_offset_;
1299 void init(
size_t len);
1308 template<
typename T>
#define ACL_CPP_PRINTF(format_idx, arg_idx)
ACL_API ACL_VSTRING const char * format
string operator+(T v, const string &rhs)
ACL_API void const char * fmt