Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
testing::internal::String Class Reference

#include <gtest-string.h>

Static Public Member Functions

static const char * CloneCString (const char *c_str)
 
static bool CStringEquals (const char *lhs, const char *rhs)
 
static std::string ShowWideCString (const wchar_t *wide_c_str)
 
static bool WideCStringEquals (const wchar_t *lhs, const wchar_t *rhs)
 
static bool CaseInsensitiveCStringEquals (const char *lhs, const char *rhs)
 
static bool CaseInsensitiveWideCStringEquals (const wchar_t *lhs, const wchar_t *rhs)
 
static bool EndsWithCaseInsensitive (const std::string &str, const std::string &suffix)
 
static std::string FormatIntWidth2 (int value)
 
static std::string FormatHexInt (int value)
 
static std::string FormatByte (unsigned char value)
 

Detailed Description

Definition at line 58 of file gtest-string.h.

Member Function Documentation

◆ CaseInsensitiveCStringEquals()

bool testing::internal::String::CaseInsensitiveCStringEquals ( const char * lhs,
const char * rhs )
static

Definition at line 1920 of file gtest.cc.

1920 {
1921 if (lhs == NULL)
1922 return rhs == NULL;
1923 if (rhs == NULL)
1924 return false;
1925 return posix::StrCaseCmp(lhs, rhs) == 0;
1926}
int StrCaseCmp(const char *s1, const char *s2)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CaseInsensitiveWideCStringEquals()

bool testing::internal::String::CaseInsensitiveWideCStringEquals ( const wchar_t * lhs,
const wchar_t * rhs )
static

Definition at line 1940 of file gtest.cc.

1941 {
1942 if (lhs == NULL) return rhs == NULL;
1943
1944 if (rhs == NULL) return false;
1945
1946#if GTEST_OS_WINDOWS
1947 return _wcsicmp(lhs, rhs) == 0;
1948#elif GTEST_OS_LINUX && !GTEST_OS_LINUX_ANDROID
1949 return wcscasecmp(lhs, rhs) == 0;
1950#else
1951 // Android, Mac OS X and Cygwin don't define wcscasecmp.
1952 // Other unknown OSes may not define it either.
1953 wint_t left, right;
1954 do {
1955 left = towlower(*lhs++);
1956 right = towlower(*rhs++);
1957 } while (left && left == right);
1958 return left == right;
1959#endif // OS selector
1960}
Here is the caller graph for this function:

◆ CloneCString()

static const char * testing::internal::String::CloneCString ( const char * c_str)
static
Here is the call graph for this function:

◆ CStringEquals()

bool testing::internal::String::CStringEquals ( const char * lhs,
const char * rhs )
static

Definition at line 908 of file gtest.cc.

908 {
909 if ( lhs == NULL ) return rhs == NULL;
910
911 if ( rhs == NULL ) return false;
912
913 return strcmp(lhs, rhs) == 0;
914}
Here is the caller graph for this function:

◆ EndsWithCaseInsensitive()

bool testing::internal::String::EndsWithCaseInsensitive ( const std::string & str,
const std::string & suffix )
static

Definition at line 1964 of file gtest.cc.

1965 {
1966 const size_t str_len = str.length();
1967 const size_t suffix_len = suffix.length();
1968 return (str_len >= suffix_len) &&
1969 CaseInsensitiveCStringEquals(str.c_str() + str_len - suffix_len,
1970 suffix.c_str());
1971}
static bool CaseInsensitiveCStringEquals(const char *lhs, const char *rhs)
Definition gtest.cc:1920
return str
Definition CLI11.hpp:1359
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FormatByte()

std::string testing::internal::String::FormatByte ( unsigned char value)
static

Definition at line 1988 of file gtest.cc.

1988 {
1989 std::stringstream ss;
1990 ss << std::setfill('0') << std::setw(2) << std::hex << std::uppercase
1991 << static_cast<unsigned int>(value);
1992 return ss.str();
1993}
static const Segment ss(Segment::ss)
#define value
Definition pkcs11.h:157

◆ FormatHexInt()

std::string testing::internal::String::FormatHexInt ( int value)
static

Definition at line 1981 of file gtest.cc.

1981 {
1982 std::stringstream ss;
1983 ss << std::hex << std::uppercase << value;
1984 return ss.str();
1985}
Here is the caller graph for this function:

◆ FormatIntWidth2()

std::string testing::internal::String::FormatIntWidth2 ( int value)
static

Definition at line 1974 of file gtest.cc.

1974 {
1975 std::stringstream ss;
1976 ss << std::setfill('0') << std::setw(2) << value;
1977 return ss.str();
1978}
Here is the caller graph for this function:

◆ ShowWideCString()

std::string testing::internal::String::ShowWideCString ( const wchar_t * wide_c_str)
static

Definition at line 1863 of file gtest.cc.

1863 {
1864 if (wide_c_str == NULL) return "(null)";
1865
1866 return internal::WideStringToUtf8(wide_c_str, -1);
1867}
GTEST_API_ std::string WideStringToUtf8(const wchar_t *str, int num_chars)
Definition gtest.cc:1838
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WideCStringEquals()

bool testing::internal::String::WideCStringEquals ( const wchar_t * lhs,
const wchar_t * rhs )
static

Definition at line 1875 of file gtest.cc.

1875 {
1876 if (lhs == NULL) return rhs == NULL;
1877
1878 if (rhs == NULL) return false;
1879
1880 return wcscmp(lhs, rhs) == 0;
1881}
Here is the caller graph for this function:

The documentation for this class was generated from the following files: