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


C++ nsAString::LowerCaseEqualsASCII方法代码示例

本文整理汇总了C++中nsAString::LowerCaseEqualsASCII方法的典型用法代码示例。如果您正苦于以下问题:C++ nsAString::LowerCaseEqualsASCII方法的具体用法?C++ nsAString::LowerCaseEqualsASCII怎么用?C++ nsAString::LowerCaseEqualsASCII使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在nsAString的用法示例。


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

示例1: SchemeInList

 bool SchemeInList(nsAString& scheme, const char** schemes)
 {
   for (; *schemes; schemes++) {
     if (scheme.LowerCaseEqualsASCII(*schemes)) {
       return true;
     }
   }
   return false;
 };
开发者ID:luke-chang,项目名称:gecko-1,代码行数:9,代码来源:AddonContentPolicy.cpp

示例2: sizeof

/* static */ bool
FeaturePolicyUtils::IsSupportedFeature(const nsAString& aFeatureName)
{
  uint32_t numFeatures = (sizeof(sSupportedFeatures) / sizeof(sSupportedFeatures[0]));
  for (uint32_t i = 0; i < numFeatures; ++i) {
    if (aFeatureName.LowerCaseEqualsASCII(sSupportedFeatures[i].mFeatureName)) {
      return true;
    }
  }
  return false;
}
开发者ID:marcoscaceres,项目名称:gecko-dev,代码行数:11,代码来源:FeaturePolicyUtils.cpp

示例3: sizeof

bool
CSP_IsValidDirective(const nsAString& aDir)
{
  uint32_t numDirs = (sizeof(CSPStrDirectives) / sizeof(CSPStrDirectives[0]));

  for (uint32_t i = 0; i < numDirs; i++) {
    if (aDir.LowerCaseEqualsASCII(CSPStrDirectives[i])) {
      return true;
    }
  }
  return false;
}
开发者ID:brendandahl,项目名称:positron,代码行数:12,代码来源:nsCSPUtils.cpp

示例4:

BluetoothAdapterAttribute
BluetoothAdapter::ConvertStringToAdapterAttribute(const nsAString& aString)
{
  using namespace
    mozilla::dom::BluetoothAdapterAttributeValues;

  for (size_t index = 0; index < ArrayLength(strings) - 1; index++) {
    if (aString.LowerCaseEqualsASCII(strings[index].value,
                                     strings[index].length)) {
      return static_cast<BluetoothAdapterAttribute>(index);
    }
  }
  return BluetoothAdapterAttribute::Unknown;
}
开发者ID:LordJZ,项目名称:gecko-dev,代码行数:14,代码来源:BluetoothAdapter.cpp

示例5: sizeof

bool
CSP_IsValidDirective(const nsAString& aDir)
{
  static_assert(CSP_LAST_DIRECTIVE_VALUE ==
                (sizeof(CSPStrDirectives) / sizeof(CSPStrDirectives[0])),
                "CSP_LAST_DIRECTIVE_VALUE does not match length of CSPStrDirectives");

  for (uint32_t i = 0; i < CSP_LAST_DIRECTIVE_VALUE; i++) {
    if (aDir.LowerCaseEqualsASCII(CSPStrDirectives[i])) {
      return true;
    }
  }
  return false;
}
开发者ID:CodeSpeaker,项目名称:gecko-dev,代码行数:14,代码来源:nsCSPUtils.cpp

示例6: ResetIfSet

PRBool
nsAttrValue::ParseEnumValue(const nsAString& aValue,
                            const EnumTable* aTable,
                            PRBool aCaseSensitive,
                            const EnumTable* aDefaultValue)
{
  ResetIfSet();
  const EnumTable* tableEntry = aTable;

  while (tableEntry->tag) {
    if (aCaseSensitive ? aValue.EqualsASCII(tableEntry->tag) :
                         aValue.LowerCaseEqualsASCII(tableEntry->tag)) {
      PRInt32 value = EnumTableEntryToValue(aTable, tableEntry);

      PRBool equals = aCaseSensitive || aValue.EqualsASCII(tableEntry->tag);
      if (!equals) {
        nsAutoString tag;
        tag.AssignASCII(tableEntry->tag);
        ToUpperCase(tag);
        if ((equals = tag.Equals(aValue))) {
          value |= NS_ATTRVALUE_ENUMTABLE_VALUE_NEEDS_TO_UPPER;
        }
      }
      SetIntValueAndType(value, eEnum, equals ? nsnull : &aValue);
      NS_ASSERTION(GetEnumValue() == tableEntry->value,
                   "failed to store enum properly");

      return PR_TRUE;
    }
    tableEntry++;
  }

  if (aDefaultValue) {
    NS_PRECONDITION(aTable <= aDefaultValue && aDefaultValue < tableEntry,
                    "aDefaultValue not inside aTable?");
    SetIntValueAndType(EnumTableEntryToValue(aTable, aDefaultValue),
                       eEnum, &aValue);
    return PR_TRUE;
  }

  return PR_FALSE;
}
开发者ID:Egyptghost1,项目名称:DOMinator,代码行数:42,代码来源:nsAttrValue.cpp

示例7: nsDependentAtomString

bool
nsDOMTokenList::Supports(const nsAString& aToken,
                         ErrorResult& aError)
{
  if (!mSupportedTokens) {
    aError.ThrowTypeError<MSG_TOKENLIST_NO_SUPPORTED_TOKENS>(
      mElement->LocalName(),
      nsDependentAtomString(mAttrAtom));
    return false;
  }

  for (DOMTokenListSupportedToken* supportedToken = mSupportedTokens;
       *supportedToken;
       ++supportedToken) {
    if (aToken.LowerCaseEqualsASCII(*supportedToken)) {
      return true;
    }
  }

  return false;
}
开发者ID:NAndreasson,项目名称:cowl-patches,代码行数:21,代码来源:nsDOMTokenList.cpp

示例8: ResetIfSet

PRBool
nsAttrValue::ParseEnumValue(const nsAString& aValue,
                            const EnumTable* aTable,
                            PRBool aCaseSensitive)
{
  ResetIfSet();
  const EnumTable* tableEntry = aTable;

  while (tableEntry->tag) {
    if (aCaseSensitive ? aValue.EqualsASCII(tableEntry->tag) :
                         aValue.LowerCaseEqualsASCII(tableEntry->tag)) {
      PRInt16 index;
      if (!GetEnumTableIndex(aTable, index)) {
        return PR_FALSE;
      }

      PRInt32 value = (tableEntry->value << NS_ATTRVALUE_ENUMTABLEINDEX_BITS) +
                      index;

      PRBool equals = aCaseSensitive || aValue.EqualsASCII(tableEntry->tag);
      if (!equals) {
        nsAutoString tag;
        tag.AssignASCII(tableEntry->tag);
        ToUpperCase(tag);
        if ((equals = tag.Equals(aValue))) {
          value |= NS_ATTRVALUE_ENUMTABLE_VALUE_NEEDS_TO_UPPER;
        }
      }
      SetIntValueAndType(value, eEnum, equals ? nsnull : &aValue);
      NS_ASSERTION(GetEnumValue() == tableEntry->value,
                   "failed to store enum properly");

      return PR_TRUE;
    }
    tableEntry++;
  }

  return PR_FALSE;
}
开发者ID:Akin-Net,项目名称:mozilla-central,代码行数:39,代码来源:nsAttrValue.cpp

示例9: ResetIfSet

PRBool
nsAttrValue::ParseEnumValue(const nsAString& aValue,
                            const EnumTable* aTable,
                            PRBool aCaseSensitive)
{
  ResetIfSet();

  while (aTable->tag) {
    if (aCaseSensitive ? aValue.EqualsASCII(aTable->tag) :
                         aValue.LowerCaseEqualsASCII(aTable->tag)) {

      // Find index of EnumTable
      PRInt16 index = sEnumTableArray->IndexOf(aTable);
      if (index < 0) {
        index = sEnumTableArray->Length();
        NS_ASSERTION(index <= NS_ATTRVALUE_ENUMTABLEINDEX_MAXVALUE,
                     "too many enum tables");
        if (!sEnumTableArray->AppendElement(aTable)) {
          return PR_FALSE;
        }
      }

      PRInt32 value = (aTable->value << NS_ATTRVALUE_ENUMTABLEINDEX_BITS) +
                      index;

      SetIntValueAndType(value, eEnum);
      NS_ASSERTION(GetEnumValue() == aTable->value,
                   "failed to store enum properly");

      return PR_TRUE;
    }
    aTable++;
  }

  return PR_FALSE;
}
开发者ID:EdgarChen,项目名称:mozilla-cvs-history,代码行数:36,代码来源:nsAttrValue.cpp

示例10:

bool
CSP_IsKeyword(const nsAString& aValue, enum CSPKeyword aKey)
{
  return aValue.LowerCaseEqualsASCII(CSP_EnumToKeyword(aKey));
}
开发者ID:CodeSpeaker,项目名称:gecko-dev,代码行数:5,代码来源:nsCSPUtils.cpp

示例11:

bool
CSP_IsDirective(const nsAString& aValue, CSPDirective aDir)
{
  return aValue.LowerCaseEqualsASCII(CSP_CSPDirectiveToString(aDir));
}
开发者ID:brendandahl,项目名称:positron,代码行数:5,代码来源:nsCSPUtils.cpp


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