本文整理汇总了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;
};
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例10:
bool
CSP_IsKeyword(const nsAString& aValue, enum CSPKeyword aKey)
{
return aValue.LowerCaseEqualsASCII(CSP_EnumToKeyword(aKey));
}
示例11:
bool
CSP_IsDirective(const nsAString& aValue, CSPDirective aDir)
{
return aValue.LowerCaseEqualsASCII(CSP_CSPDirectiveToString(aDir));
}