#include <gtest-string.h>
Definition at line 59 of file gtest-string.h.
◆ CaseInsensitiveCStringEquals()
bool testing::internal::String::CaseInsensitiveCStringEquals |
( |
const char * |
lhs, |
|
|
const char * |
rhs |
|
) |
| |
|
static |
Definition at line 2079 of file gtest.cc.
2079 {
2080 if (lhs == nullptr) return rhs == nullptr;
2081 if (rhs == nullptr) return false;
2083}
int StrCaseCmp(const char *s1, const char *s2)
◆ CaseInsensitiveWideCStringEquals()
bool testing::internal::String::CaseInsensitiveWideCStringEquals |
( |
const wchar_t * |
lhs, |
|
|
const wchar_t * |
rhs |
|
) |
| |
|
static |
Definition at line 2097 of file gtest.cc.
2098 {
2099 if (lhs == nullptr) return rhs == nullptr;
2100
2101 if (rhs == nullptr) return false;
2102
2103#if GTEST_OS_WINDOWS
2104 return _wcsicmp(lhs, rhs) == 0;
2105#elif GTEST_OS_LINUX && !GTEST_OS_LINUX_ANDROID
2106 return wcscasecmp(lhs, rhs) == 0;
2107#else
2108
2109
2110 wint_t left, right;
2111 do {
2112 left = towlower(static_cast<wint_t>(*lhs++));
2113 right = towlower(static_cast<wint_t>(*rhs++));
2114 } while (left && left == right);
2115 return left == right;
2116#endif
2117}
◆ CloneCString()
static const char * testing::internal::String::CloneCString |
( |
const char * |
c_str | ) |
|
|
static |
◆ CStringEquals()
bool testing::internal::String::CStringEquals |
( |
const char * |
lhs, |
|
|
const char * |
rhs |
|
) |
| |
|
static |
Definition at line 1104 of file gtest.cc.
1104 {
1105 if (lhs == nullptr) return rhs == nullptr;
1106
1107 if (rhs == nullptr) return false;
1108
1109 return strcmp(lhs, rhs) == 0;
1110}
◆ EndsWithCaseInsensitive()
bool testing::internal::String::EndsWithCaseInsensitive |
( |
const std::string & |
str, |
|
|
const std::string & |
suffix |
|
) |
| |
|
static |
Definition at line 2121 of file gtest.cc.
2122 {
2123 const size_t str_len = str.length();
2124 const size_t suffix_len = suffix.length();
2125 return (str_len >= suffix_len) &&
2127 suffix.c_str());
2128}
static bool CaseInsensitiveCStringEquals(const char *lhs, const char *rhs)
◆ FormatByte()
std::string testing::internal::String::FormatByte |
( |
unsigned char |
value | ) |
|
|
static |
Definition at line 2155 of file gtest.cc.
2155 {
2156 std::stringstream ss;
2157 ss << std::setfill('0') << std::setw(2) << std::hex << std::uppercase
2158 <<
static_cast<unsigned int>(
value);
2159 return ss.str();
2160}
◆ FormatHexInt()
std::string testing::internal::String::FormatHexInt |
( |
int |
value | ) |
|
|
static |
Definition at line 2150 of file gtest.cc.
2150 {
2152}
static std::string FormatHexUInt32(uint32_t value)
◆ FormatHexUInt32()
std::string testing::internal::String::FormatHexUInt32 |
( |
uint32_t |
value | ) |
|
|
static |
Definition at line 2143 of file gtest.cc.
2143 {
2144 std::stringstream ss;
2145 ss << std::hex << std::uppercase <<
value;
2146 return ss.str();
2147}
◆ FormatIntWidth2()
std::string testing::internal::String::FormatIntWidth2 |
( |
int |
value | ) |
|
|
static |
Definition at line 2131 of file gtest.cc.
2131 {
2133}
static std::string FormatIntWidthN(int value, int width)
◆ FormatIntWidthN()
std::string testing::internal::String::FormatIntWidthN |
( |
int |
value, |
|
|
int |
width |
|
) |
| |
|
static |
Definition at line 2136 of file gtest.cc.
2136 {
2137 std::stringstream ss;
2138 ss << std::setfill(
'0') << std::setw(width) <<
value;
2139 return ss.str();
2140}
◆ ShowWideCString()
std::string testing::internal::String::ShowWideCString |
( |
const wchar_t * |
wide_c_str | ) |
|
|
static |
Definition at line 2022 of file gtest.cc.
2022 {
2023 if (wide_c_str == nullptr) return "(null)";
2024
2026}
std::string WideStringToUtf8(const wchar_t *str, int num_chars)
◆ WideCStringEquals()
bool testing::internal::String::WideCStringEquals |
( |
const wchar_t * |
lhs, |
|
|
const wchar_t * |
rhs |
|
) |
| |
|
static |
Definition at line 2034 of file gtest.cc.
2034 {
2035 if (lhs == nullptr) return rhs == nullptr;
2036
2037 if (rhs == nullptr) return false;
2038
2039 return wcscmp(lhs, rhs) == 0;
2040}
The documentation for this class was generated from the following files:
- /media/home/debian/src/github/tesseract-ocr/tesseract/unittest/third_party/googletest/googletest/include/gtest/internal/gtest-string.h
- /media/home/debian/src/github/tesseract-ocr/tesseract/unittest/third_party/googletest/googletest/src/gtest.cc