Пример #1
0
FX_WCHAR* FXSYS_wcslwr(FX_WCHAR* str) {
  if (str == NULL) {
    return NULL;
  }
  FX_WCHAR* s = str;
  while (*str) {
    *str = FXSYS_tolower(*str);
    str++;
  }
  return s;
}
Пример #2
0
char* FXSYS_strlwr(char* str) {
  if (str == NULL) {
    return NULL;
  }
  char* s = str;
  while (*str) {
    *str = FXSYS_tolower(*str);
    str++;
  }
  return s;
}
Пример #3
0
static uint32_t FPF_SKIANormalizeFontName(const CFX_ByteStringC& bsfamily) {
  uint32_t dwHash = 0;
  int32_t iLength = bsfamily.GetLength();
  const FX_CHAR* pBuffer = bsfamily.c_str();
  for (int32_t i = 0; i < iLength; i++) {
    FX_CHAR ch = pBuffer[i];
    if (ch == ' ' || ch == '-' || ch == ',') {
      continue;
    }
    dwHash = 31 * dwHash + FXSYS_tolower(ch);
  }
  return dwHash;
}
static FX_DWORD FPF_SKIANormalizeFontName(FX_BSTR bsfamily)
{
    FX_DWORD dwHash = 0;
    FX_INT32 iLength = bsfamily.GetLength();
    FX_LPCSTR pBuffer = bsfamily.GetCStr();
    for (FX_INT32 i = 0; i < iLength; i++) {
        FX_CHAR ch = pBuffer[i];
        if (ch == ' ' || ch == '-' || ch == ',') {
            continue;
        }
        dwHash = 31 * dwHash + FXSYS_tolower(ch);
    }
    return dwHash;
}
static FX_UINT32 FPF_GetHashCode_StringA(FX_LPCSTR pStr, FX_INT32 iLength, FX_BOOL bIgnoreCase = FALSE)
{
    if (!pStr) {
        return 0;
    }
    if (iLength < 0) {
        iLength = FXSYS_strlen(pStr);
    }
    FX_LPCSTR pStrEnd = pStr + iLength;
    FX_UINT32 uHashCode = 0;
    if (bIgnoreCase) {
        while (pStr < pStrEnd) {
            uHashCode = 31 * uHashCode + FXSYS_tolower(*pStr++);
        }
    } else {
        while (pStr < pStrEnd) {
            uHashCode = 31 * uHashCode + *pStr ++;
        }
    }
    return uHashCode;
}
Пример #6
0
static uint32_t FPF_GetHashCode_StringA(const FX_CHAR* pStr,
                                        int32_t iLength,
                                        FX_BOOL bIgnoreCase = FALSE) {
  if (!pStr) {
    return 0;
  }
  if (iLength < 0) {
    iLength = FXSYS_strlen(pStr);
  }
  const FX_CHAR* pStrEnd = pStr + iLength;
  uint32_t uHashCode = 0;
  if (bIgnoreCase) {
    while (pStr < pStrEnd) {
      uHashCode = 31 * uHashCode + FXSYS_tolower(*pStr++);
    }
  } else {
    while (pStr < pStrEnd) {
      uHashCode = 31 * uHashCode + *pStr++;
    }
  }
  return uHashCode;
}