libcopp
2.2.0
|
字符串相关操作 Licensed under the MIT licenses. More...
#include <stdint.h>
#include <algorithm>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <ostream>
Go to the source code of this file.
Namespaces | |
util | |
util::string | |
Macros | |
#define | UTIL_STRFUNC_STRCASE_CMP(l, r) strcasecmp(l, r) |
#define | UTIL_STRFUNC_STRNCASE_CMP(l, r, s) strncasecmp(l, r, s) |
#define | UTIL_STRFUNC_STRCMP(l, r) strcmp(l, r) |
#define | UTIL_STRFUNC_STRNCMP(l, r, s) strncmp(l, r, s) |
#define | UTIL_STRFUNC_SSCANF(...) sscanf(__VA_ARGS__) |
#define | UTIL_STRFUNC_SNPRINTF(...) snprintf(__VA_ARGS__) |
#define | UTIL_STRFUNC_VSNPRINTF(buffer, bufsz, fmt, arg) vsnprintf(buffer, static_cast<int>(bufsz), fmt, arg) |
Functions | |
template<typename TCH = char> | |
static TCH | util::string::tolower (TCH c) |
字符转小写 More... | |
template<typename TCH = char> | |
static TCH | util::string::toupper (TCH c) |
字符转大写 More... | |
template<typename T > | |
void | util::string::str2int (T &out, const char *str) |
字符串转整数 More... | |
template<typename T > | |
T | util::string::to_int (const char *str) |
字符串转整数 More... | |
template<typename TStr , typename TCh > | |
void | util::string::hex (TStr *out, TCh c, bool upper_case=false) |
字符转十六进制表示 More... | |
template<typename TStr , typename TCh > | |
void | util::string::oct (TStr *out, TCh c) |
字符转8进制表示 More... | |
template<typename TCh > | |
void | util::string::serialization (const void *src, size_t ss, TCh *out, size_t &os) |
字符转8进制表示 More... | |
template<typename Elem , typename Traits > | |
void | util::string::serialization (const void *src, size_t ss, std::basic_ostream< Elem, Traits > &out) |
字符转8进制表示 More... | |
template<typename TCh > | |
void | util::string::dumphex (const void *src, size_t ss, TCh *out, bool upper_case=false) |
字符转16进制表示 More... | |
template<typename Elem , typename Traits > | |
void | util::string::dumphex (const void *src, size_t ss, std::basic_ostream< Elem, Traits > &out, bool upper_case=false) |
字符转16进制表示 More... | |
字符串相关操作 Licensed under the MIT licenses.
@history
Definition in file string_oprs.h.
#define UTIL_STRFUNC_SNPRINTF | ( | ... | ) | snprintf(__VA_ARGS__) |
Definition at line 57 of file string_oprs.h.
#define UTIL_STRFUNC_SSCANF | ( | ... | ) | sscanf(__VA_ARGS__) |
Definition at line 56 of file string_oprs.h.
#define UTIL_STRFUNC_STRCASE_CMP | ( | l, | |
r | |||
) | strcasecmp(l, r) |
Definition at line 35 of file string_oprs.h.
#define UTIL_STRFUNC_STRCMP | ( | l, | |
r | |||
) | strcmp(l, r) |
Definition at line 37 of file string_oprs.h.
#define UTIL_STRFUNC_STRNCASE_CMP | ( | l, | |
r, | |||
s | |||
) | strncasecmp(l, r, s) |
Definition at line 36 of file string_oprs.h.
#define UTIL_STRFUNC_STRNCMP | ( | l, | |
r, | |||
s | |||
) | strncmp(l, r, s) |
Definition at line 38 of file string_oprs.h.
#define UTIL_STRFUNC_VSNPRINTF | ( | buffer, | |
bufsz, | |||
fmt, | |||
arg | |||
) | vsnprintf(buffer, static_cast<int>(bufsz), fmt, arg) |
Definition at line 58 of file string_oprs.h.