本文整理汇总了C++中nsString::LowerCaseEqualsLiteral方法的典型用法代码示例。如果您正苦于以下问题:C++ nsString::LowerCaseEqualsLiteral方法的具体用法?C++ nsString::LowerCaseEqualsLiteral怎么用?C++ nsString::LowerCaseEqualsLiteral使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nsString
的用法示例。
在下文中一共展示了nsString::LowerCaseEqualsLiteral方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetGenericID
/*static*/
void nsFont::GetGenericID(const nsString& aGeneric, uint8_t* aID)
{
*aID = kGenericFont_NONE;
if (aGeneric.LowerCaseEqualsLiteral("-moz-fixed")) *aID = kGenericFont_moz_fixed;
else if (aGeneric.LowerCaseEqualsLiteral("serif")) *aID = kGenericFont_serif;
else if (aGeneric.LowerCaseEqualsLiteral("sans-serif")) *aID = kGenericFont_sans_serif;
else if (aGeneric.LowerCaseEqualsLiteral("cursive")) *aID = kGenericFont_cursive;
else if (aGeneric.LowerCaseEqualsLiteral("fantasy")) *aID = kGenericFont_fantasy;
else if (aGeneric.LowerCaseEqualsLiteral("monospace")) *aID = kGenericFont_monospace;
}
示例2: InitByLangGroup
//--------------------------------------------------------------------------
void nsUnicodeFontMappingMac::InitByLangGroup(const nsString& aLangGroup)
{
// do not continue if there are no difference to look at the document Charset
if( ScriptMapInitComplete() )
return;
if(aLangGroup.LowerCaseEqualsLiteral("x-western"))
{
FillVarBlockToScript(smRoman, mPrivBlockToScript);
} else if(aLangGroup.LowerCaseEqualsLiteral("zh-cn"))
{
FillVarBlockToScript(smSimpChinese, mPrivBlockToScript);
} else if(aLangGroup.LowerCaseEqualsLiteral("ko"))
{
FillVarBlockToScript(smKorean, mPrivBlockToScript);
} else if(aLangGroup.LowerCaseEqualsLiteral("zh-tw") ||
aLangGroup.LowerCaseEqualsLiteral("zh-hk"))
{
FillVarBlockToScript(smTradChinese, mPrivBlockToScript);
} else if(aLangGroup.LowerCaseEqualsLiteral("ja"))
{
FillVarBlockToScript(smJapanese, mPrivBlockToScript);
}
}
示例3: StringEndsWith
static PRBool
nsShouldIgnoreFile(nsString& name)
{
PRUnichar firstChar=name.CharAt(0);
if (firstChar == '.' || firstChar == '#' || name.CharAt(name.Length() - 1) == '~')
return PR_TRUE;
if (name.LowerCaseEqualsLiteral("rules.dat") || name.LowerCaseEqualsLiteral("rulesbackup.dat"))
return PR_TRUE;
// don't add summary files to the list of folders;
// don't add popstate files to the list either, or rules (sort.dat).
if (StringEndsWith(name, NS_LITERAL_STRING(".snm")) ||
name.LowerCaseEqualsLiteral("popstate.dat") ||
name.LowerCaseEqualsLiteral("sort.dat") ||
name.LowerCaseEqualsLiteral("mailfilt.log") ||
name.LowerCaseEqualsLiteral("filters.js") ||
StringEndsWith(name, NS_LITERAL_STRING(".toc")) ||
StringEndsWith(name, NS_LITERAL_STRING(".sbd")))
return PR_TRUE;
return PR_FALSE;
}
示例4: arena
nsresult
nsKeygenFormProcessor::GetPublicKey(const nsAString& aValue,
const nsAString& aChallenge,
const nsString& aKeyType,
nsAString& aOutPublicKey,
const nsAString& aKeyParams)
{
nsresult rv = NS_ERROR_FAILURE;
nsAutoCString keystring;
char *keyparamsString = nullptr;
uint32_t keyGenMechanism;
PK11SlotInfo *slot = nullptr;
PK11RSAGenParams rsaParams;
mozilla::UniqueSECItem ecParams;
SECOidTag algTag;
int keysize = 0;
void *params = nullptr; // Non-owning.
SECKEYPrivateKey *privateKey = nullptr;
SECKEYPublicKey *publicKey = nullptr;
CERTSubjectPublicKeyInfo *spkInfo = nullptr;
SECStatus srv = SECFailure;
SECItem spkiItem;
SECItem pkacItem;
SECItem signedItem;
nsDependentCSubstring signedItemStr;
CERTPublicKeyAndChallenge pkac;
pkac.challenge.data = nullptr;
nsCOMPtr<nsIGeneratingKeypairInfoDialogs> dialogs;
nsKeygenThread *KeygenRunnable = 0;
nsCOMPtr<nsIKeygenThread> runnable;
// permanent and sensitive flags for keygen
PK11AttrFlags attrFlags = PK11_ATTR_TOKEN | PK11_ATTR_SENSITIVE | PK11_ATTR_PRIVATE;
UniquePLArenaPool arena(PORT_NewArena(DER_DEFAULT_CHUNKSIZE));
if (!arena) {
goto loser;
}
// Get the key size //
for (size_t i = 0; i < number_of_key_size_choices; ++i) {
if (aValue.Equals(mSECKeySizeChoiceList[i].name)) {
keysize = mSECKeySizeChoiceList[i].size;
break;
}
}
if (!keysize) {
goto loser;
}
// Set the keygen mechanism
if (aKeyType.IsEmpty() || aKeyType.LowerCaseEqualsLiteral("rsa")) {
keyGenMechanism = CKM_RSA_PKCS_KEY_PAIR_GEN;
} else if (aKeyType.LowerCaseEqualsLiteral("ec")) {
keyparamsString = ToNewCString(aKeyParams);
if (!keyparamsString) {
rv = NS_ERROR_OUT_OF_MEMORY;
goto loser;
}
keyGenMechanism = CKM_EC_KEY_PAIR_GEN;
/* ecParams are initialized later */
} else {
goto loser;
}
// Get the slot
rv = GetSlot(keyGenMechanism, &slot);
if (NS_FAILED(rv)) {
goto loser;
}
switch (keyGenMechanism) {
case CKM_RSA_PKCS_KEY_PAIR_GEN:
rsaParams.keySizeInBits = keysize;
rsaParams.pe = DEFAULT_RSA_KEYGEN_PE;
algTag = DEFAULT_RSA_KEYGEN_ALG;
params = &rsaParams;
break;
case CKM_EC_KEY_PAIR_GEN:
/* XXX We ought to rethink how the KEYGEN tag is
* displayed. The pulldown selections presented
* to the user must depend on the keytype.
* The displayed selection could be picked
* from the keyparams attribute (this is currently called
* the pqg attribute).
* For now, we pick ecparams from the keyparams field
* if it specifies a valid supported curve, or else
* we pick one of secp384r1, secp256r1 or secp192r1
* respectively depending on the user's selection
* (High, Medium, Low).
* (RSA uses RSA-2048, RSA-1024 and RSA-512 for historical
* reasons, while ECC choices represent a stronger mapping)
* NOTE: The user's selection
* is silently ignored when a valid curve is presented
* in keyparams.
*/
ecParams = DecodeECParams(keyparamsString);
if (!ecParams) {
/* The keyparams attribute did not specify a valid
* curve name so use a curve based on the keysize.
//.........这里部分代码省略.........