Delete unused code in stringutils.h.
Bug: webrtc:6424 Change-Id: Id201b85002c2c821b015c1f70ed93425058aa467 Reviewed-on: https://webrtc-review.googlesource.com/33009 Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org> Commit-Queue: Niels Moller <nisse@webrtc.org> Cr-Commit-Position: refs/heads/master@{#21322}
This commit is contained in:
@ -41,9 +41,6 @@
|
||||
|
||||
namespace rtc {
|
||||
|
||||
// Complement to memset. Verifies memory consists of count bytes of value c.
|
||||
bool memory_check(const void* memory, int c, size_t count);
|
||||
|
||||
// Determines whether the simple wildcard pattern matches target.
|
||||
// Alpha characters in pattern match case-insensitively.
|
||||
// Asterisks in pattern match 0 or more characters.
|
||||
@ -53,53 +50,19 @@ bool string_match(const char* target, const char* pattern);
|
||||
} // namespace rtc
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Rename a bunch of common string functions so they are consistent across
|
||||
// platforms and between char and wchar_t variants.
|
||||
// Here is the full list of functions that are unified:
|
||||
// strlen, strcmp, stricmp, strncmp, strnicmp
|
||||
// strchr, vsnprintf, strtoul, tolowercase
|
||||
// Rename a few common string functions so they are consistent across platforms.
|
||||
// tolowercase is like tolower, but not compatible with end-of-file value
|
||||
//
|
||||
// It's not clear if we will ever use wchar_t strings on unix. In theory,
|
||||
// all strings should be Utf8 all the time, except when interfacing with Win32
|
||||
// APIs that require Utf16.
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
inline char tolowercase(char c) {
|
||||
return static_cast<char>(tolower(c));
|
||||
}
|
||||
|
||||
#if defined(WEBRTC_WIN)
|
||||
|
||||
inline size_t strlen(const wchar_t* s) {
|
||||
return wcslen(s);
|
||||
}
|
||||
inline int strcmp(const wchar_t* s1, const wchar_t* s2) {
|
||||
return wcscmp(s1, s2);
|
||||
}
|
||||
inline int stricmp(const wchar_t* s1, const wchar_t* s2) {
|
||||
return _wcsicmp(s1, s2);
|
||||
}
|
||||
inline int strncmp(const wchar_t* s1, const wchar_t* s2, size_t n) {
|
||||
return wcsncmp(s1, s2, n);
|
||||
}
|
||||
inline int strnicmp(const wchar_t* s1, const wchar_t* s2, size_t n) {
|
||||
return _wcsnicmp(s1, s2, n);
|
||||
}
|
||||
inline const wchar_t* strchr(const wchar_t* s, wchar_t c) {
|
||||
return wcschr(s, c);
|
||||
}
|
||||
inline const wchar_t* strstr(const wchar_t* haystack, const wchar_t* needle) {
|
||||
return wcsstr(haystack, needle);
|
||||
}
|
||||
#ifndef vsnprintf
|
||||
inline int vsnprintf(wchar_t* buf, size_t n, const wchar_t* fmt, va_list args) {
|
||||
return _vsnwprintf(buf, n, fmt, args);
|
||||
}
|
||||
#endif // !vsnprintf
|
||||
inline unsigned long strtoul(const wchar_t* snum, wchar_t** end, int base) {
|
||||
return wcstoul(snum, end, base);
|
||||
}
|
||||
inline wchar_t tolowercase(wchar_t c) {
|
||||
return static_cast<wchar_t>(towlower(c));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user