当前位置: 首页>>代码示例>>C++>>正文


C++ ToLowerCase函数代码示例

本文整理汇总了C++中ToLowerCase函数的典型用法代码示例。如果您正苦于以下问题:C++ ToLowerCase函数的具体用法?C++ ToLowerCase怎么用?C++ ToLowerCase使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了ToLowerCase函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ToSentenceCase

void ToSentenceCase(std::wstring& str)
{
	if (!str.empty())
	{
		ToLowerCase(str);
		bool isCapped = false;

		for (size_t i = 0; i < str.length(); ++i)
		{
			if (IsEOSPunct(str[i])) isCapped = false;

			if (!isCapped && iswalpha(str[i]) != 0)
			{
				WCHAR* srcAndDest = &str[i];
				LCMapString(LOCALE_USER_DEFAULT, LCMAP_UPPERCASE, srcAndDest, 1, srcAndDest, 1);
				isCapped = true;
			}
		}
	}
}
开发者ID:NighthawkSLO,项目名称:rainmeter,代码行数:20,代码来源:StringUtil.cpp

示例2: ToLowerCase

void
InternalHeaders::Get(const nsACString& aName, nsCString& aValue, ErrorResult& aRv) const
{
    nsAutoCString lowerName;
    ToLowerCase(aName, lowerName);

    if (IsInvalidName(lowerName, aRv)) {
        return;
    }

    for (uint32_t i = 0; i < mList.Length(); ++i) {
        if (lowerName == mList[i].mName) {
            aValue = mList[i].mValue;
            return;
        }
    }

    // No value found, so return null to content
    aValue.SetIsVoid(true);
}
开发者ID:emilio,项目名称:gecko-dev,代码行数:20,代码来源:InternalHeaders.cpp

示例3: ToSentenceCase

void ToSentenceCase(std::wstring& str)
{
	auto to_upper = [](wchar_t& ch) { ch = std::use_facet<std::ctype<wchar_t>>(std::locale()).toupper(ch); };

	if (!str.empty())
	{
		ToLowerCase(str);
		bool isCapped = false;

		for (size_t i = 0; i < str.length(); ++i)
		{
			if (IsEOSPunct(str[i])) isCapped = false;

			if (!isCapped && iswalpha(str[i]) != 0)
			{
				to_upper(str[i]);
				isCapped = true;
			}
		}
	}
}
开发者ID:funagi,项目名称:rainmeter,代码行数:21,代码来源:StringUtil.cpp

示例4: NS_ASSERTION

void nsColorNames::AddRefTable(void) 
{
  NS_ASSERTION(!gColorTable, "pre existing array!");
  if (!gColorTable) {
    gColorTable = new nsStaticCaseInsensitiveNameTable();
    if (gColorTable) {
#ifdef DEBUG
    {
      // let's verify the table...
      for (PRUint32 index = 0; index < eColorName_COUNT; ++index) {
        nsCAutoString temp1(kColorNames[index]);
        nsCAutoString temp2(kColorNames[index]);
        ToLowerCase(temp1);
        NS_ASSERTION(temp1.Equals(temp2), "upper case char in table");
      }
    }
#endif      
      gColorTable->Init(kColorNames, eColorName_COUNT); 
    }
  }
}
开发者ID:Akin-Net,项目名称:mozilla-central,代码行数:21,代码来源:nsColor.cpp

示例5: CSP_IsQuotelessKeyword

bool
CSP_IsQuotelessKeyword(const nsAString& aKey)
{
  nsString lowerKey = PromiseFlatString(aKey);
  ToLowerCase(lowerKey);

  static_assert(CSP_LAST_KEYWORD_VALUE ==
                (sizeof(CSPStrKeywords) / sizeof(CSPStrKeywords[0])),
                "CSP_LAST_KEYWORD_VALUE does not match length of CSPStrKeywords");

  nsAutoString keyword;
  for (uint32_t i = 0; i < CSP_LAST_KEYWORD_VALUE; i++) {
    // skipping the leading ' and trimming the trailing '
    keyword.AssignASCII(CSPStrKeywords[i] + 1);
    keyword.Trim("'", false, true);
    if (lowerKey.Equals(keyword)) {
      return true;
    }
  }
  return false;
}
开发者ID:CodeSpeaker,项目名称:gecko-dev,代码行数:21,代码来源:nsCSPUtils.cpp

示例6: LOG

nsresult
HttpBaseChannel::ApplyContentConversions()
{
  if (!mResponseHead)
    return NS_OK;

  LOG(("HttpBaseChannel::ApplyContentConversions [this=%p]\n", this));

  if (!mApplyConversion) {
    LOG(("not applying conversion per mApplyConversion\n"));
    return NS_OK;
  }

  const char *val = mResponseHead->PeekHeader(nsHttp::Content_Encoding);
  if (gHttpHandler->IsAcceptableEncoding(val)) {
    nsCOMPtr<nsIStreamConverterService> serv;
    nsresult rv = gHttpHandler->
            GetStreamConverterService(getter_AddRefs(serv));
    // we won't fail to load the page just because we couldn't load the
    // stream converter service.. carry on..
    if (NS_SUCCEEDED(rv)) {
      nsCOMPtr<nsIStreamListener> converter;
      nsCAutoString from(val);
      ToLowerCase(from);
      rv = serv->AsyncConvertData(from.get(),
                                  "uncompressed",
                                  mListener,
                                  mListenerContext,
                                  getter_AddRefs(converter));
      if (NS_SUCCEEDED(rv)) {
        LOG(("converter installed from \'%s\' to \'uncompressed\'\n", val));
        mListener = converter;
      }
    }
  } else if (val != nsnull) {
    LOG(("Unknown content encoding '%s', ignoring\n", val));
  }

  return NS_OK;
}
开发者ID:moussa1,项目名称:mozilla-central,代码行数:40,代码来源:HttpBaseChannel.cpp

示例7: while

void CISpellAffix::Strip ( char * szText )
{
	char * szIterator1 = szText;
	char * szIterator2 = szText;
	while ( *szIterator1 )
	{
		if ( !isspace ( (unsigned char) *szIterator1 ) && *szIterator1!='-' )
		{
			*szIterator2 = *szIterator1;
			++szIterator2;
		}
		++szIterator1;
	}

	*szIterator2 = '\0';

	while ( *szText )
	{
		*szText = ToLowerCase ( *szText );
		++szText;
	}
}
开发者ID:dandanlee,项目名称:coreseek-1,代码行数:22,代码来源:spelldump.cpp

示例8: Reset

/**
 *  Sets a new search, if there's already a search taking place, it's reset.
 *  @param  schTree     Vdf tree to look into.
 *  @param  search      Search string.
 *  @param  flags       Default search is for key case sensitive,
 *                      might be changed by setting:<br><code>
 *                      VDF_MATCH_VALUE </code><br>and<code>
 *                      VDF_IGNORE_CASE</code>
 *  @param  level       Level in which search will be valid. When -1 (default)
 *                      all levels match.
 */
void VDFSearch::SetSearch(VDFTree *schTree, char *search, UINT flags, int level)
{
    Reset();
    searchLevel =   level;
    searchFlags =   flags;
    searchTree  =   schTree;

    const UINT startAnchors = 6;

    searchStr = new char[strlen(search) + 1];

    if(flags & VDF_IGNORE_CASE)
        ToLowerCase(search, searchStr);
    else
        strcpy(searchStr, search);

    // start with 6 levels to avoid unnecessary grows
    levelCount = startAnchors;
    levelAnchor = new VDFNode*[startAnchors];
    memset(levelAnchor, 0, startAnchors * sizeof(VDFNode*));

}
开发者ID:Yepoleb,项目名称:vdfparser,代码行数:33,代码来源:vdfparser.cpp

示例9: NS_ENSURE_ARG_POINTER

NS_IMETHODIMP
nsCollation::AllocateRawSortKey(int32_t strength,
                                const nsAString& stringIn,
                                uint8_t** key, uint32_t* outLen)
{
  NS_ENSURE_ARG_POINTER(key);
  NS_ENSURE_ARG_POINTER(outLen);

  nsAutoString stringNormalized(stringIn);
  if (strength != kCollationCaseSensitive) {
    ToLowerCase(stringNormalized);
  }

  NS_ConvertUTF16toUTF8 str(stringNormalized);
  size_t len = str.Length() + 1;
  void *buffer = PR_Malloc(len);
  memcpy(buffer, str.get(), len);
  *key = (uint8_t *)buffer;
  *outLen = len;

  return NS_OK;
}
开发者ID:Wafflespeanut,项目名称:gecko-dev,代码行数:22,代码来源:nsCollationAndroid.cpp

示例10: ToLowerCase

bool
nsChannelClassifier::IsHostnameWhitelisted(nsIURI *aUri,
                                           const nsACString &aWhitelisted)
{
  nsAutoCString host;
  nsresult rv = aUri->GetHost(host);
  if (NS_FAILED(rv) || host.IsEmpty()) {
    return false;
  }
  ToLowerCase(host);

  nsCCharSeparatedTokenizer tokenizer(aWhitelisted, ',');
  while (tokenizer.hasMoreTokens()) {
    const nsCSubstring& token = tokenizer.nextToken();
    if (token.Equals(host)) {
      LOG(("nsChannelClassifier[%p]:StartInternal skipping %s (whitelisted)",
           this, host.get()));
      return true;
    }
  }

  return false;
}
开发者ID:MichaelKohler,项目名称:gecko-dev,代码行数:23,代码来源:nsChannelClassifier.cpp

示例11: ToUpperCase

mozEnglishWordUtils::myspCapitalization
mozEnglishWordUtils::captype(const nsString &word)
{
  char16_t* lword=ToNewUnicode(word);
  ToUpperCase(lword,lword,word.Length());
  if(word.Equals(lword)){
    free(lword);
    return AllCap;
  }

  ToLowerCase(lword,lword,word.Length());
  if(word.Equals(lword)){
    free(lword);
    return NoCap;
  }
  int32_t length=word.Length();
  if(Substring(word,1,length-1).Equals(lword+1)){
    free(lword);
    return InitCap;
  }
  free(lword);
  return HuhCap;
}
开发者ID:heiher,项目名称:gecko-dev,代码行数:23,代码来源:mozEnglishWordUtils.cpp

示例12: m_noRepeatActiv

/*******************************
 * Constructors and Destructors
 ******************************/
TimedKey::TimedKey( std::string &keyString, bool repeat, float delay )
  :m_activated( false ), 
   m_noRepeatActiv( false ),
   m_pressed( false ),
   m_repeat( repeat ), 
   m_delay( delay ) {
  std::string lwrKey = ToLowerCase( keyString );

  // Single character keys can easily be casted
  if ( lwrKey.size() == 1 ) {
    m_kCode = static_cast<sf::Key::Code>( keyString[0] );

  } else {
    keyMap_type::iterator keyPair = m_extraKeys.find( lwrKey );
    
    if ( keyPair != m_extraKeys.end() ) {
      m_kCode = keyPair->second;
    } else {
      // No key found so associate with Count, which doesn't match any key
      m_kCode = sf::Key::Count;
    }
  }
}
开发者ID:jashank,项目名称:NT-Engine,代码行数:26,代码来源:TimedKey.cpp

示例13: do_GetService

nsIAtom*
nsLanguageAtomService::GetLocaleLanguage(nsresult *aError)
{
  nsresult res = NS_OK;

  do {
    if (!mLocaleLanguage) {
      nsCOMPtr<nsILocaleService> localeService;
      localeService = do_GetService(NS_LOCALESERVICE_CONTRACTID);
      if (!localeService) {
        res = NS_ERROR_FAILURE;
        break;
      }

      nsCOMPtr<nsILocale> locale;
      res = localeService->GetApplicationLocale(getter_AddRefs(locale));
      if (NS_FAILED(res))
        break;

      nsAutoString category;
      category.AssignWithConversion(NSILOCALE_MESSAGE);
      nsAutoString loc;
      res = locale->GetCategory(category, loc);
      if (NS_FAILED(res))
        break;

      ToLowerCase(loc); // use lowercase for all language atoms
      mLocaleLanguage = do_GetAtom(loc);
    }
  } while (0);

  if (aError)
    *aError = res;

  return mLocaleLanguage;
}
开发者ID:LittleForker,项目名称:mozilla-central,代码行数:36,代码来源:nsLanguageAtomService.cpp

示例14: NS_WARNING

bool
GMPInfoFileParser::Init(nsIFile* aInfoFile)
{
  nsTArray<nsCString> lines;
  static const size_t MAX_GMP_INFO_FILE_LENGTH = 5 * 1024;

  nsAutoCString info;
  if (!ReadIntoString(aInfoFile, info, MAX_GMP_INFO_FILE_LENGTH)) {
    NS_WARNING("Failed to read info file in GMP process.");
    return false;
  }

  // Note: we pass "\r\n" to SplitAt so that we'll split lines delimited
  // by \n (Unix), \r\n (Windows) and \r (old MacOSX).
  SplitAt("\r\n", info, lines);

  for (nsCString line : lines) {
    // Field name is the string up to but not including the first ':'
    // character on the line.
    int32_t colon = line.FindChar(':');
    if (colon <= 0) {
      // Not allowed to be the first character.
      // Info field name must be at least one character.
      continue;
    }
    nsAutoCString key(Substring(line, 0, colon));
    ToLowerCase(key);
    key.Trim(" ");

    nsCString* value = new nsCString(Substring(line, colon + 1));
    value->Trim(" ");
    mValues.Put(key, value); // Hashtable assumes ownership of value.
  }

  return true;
}
开发者ID:alphan102,项目名称:gecko-dev,代码行数:36,代码来源:GMPUtils.cpp

示例15: lower

// Helper routine used in tracking app lists. Converts path
// entries to lower case and stores them in the trackList array.
void nsMIMEInfoWin::ProcessPath(nsCOMPtr<nsIMutableArray>& appList,
                                nsTArray<nsString>& trackList,
                                const nsAString& appFilesystemCommand)
{
  nsAutoString lower(appFilesystemCommand);
  ToLowerCase(lower);

  // Don't include firefox.exe in the list
  WCHAR exe[MAX_PATH+1];
  PRUint32 len = GetModuleFileNameW(NULL, exe, MAX_PATH);
  if (len < MAX_PATH && len != 0) {
    PRUint32 index = lower.Find(exe);
    if (index != -1)
      return;
  }

  nsCOMPtr<nsILocalHandlerApp> aApp;
  if (!GetLocalHandlerApp(appFilesystemCommand, aApp))
    return;

  // Save in our main tracking arrays
  appList->AppendElement(aApp, false);
  trackList.AppendElement(lower);
}
开发者ID:Anachid,项目名称:mozilla-central,代码行数:26,代码来源:nsMIMEInfoWin.cpp


注:本文中的ToLowerCase函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。