本文整理汇总了C++中nsCString::LowerCaseEqualsLiteral方法的典型用法代码示例。如果您正苦于以下问题:C++ nsCString::LowerCaseEqualsLiteral方法的具体用法?C++ nsCString::LowerCaseEqualsLiteral怎么用?C++ nsCString::LowerCaseEqualsLiteral使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nsCString
的用法示例。
在下文中一共展示了nsCString::LowerCaseEqualsLiteral方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetIsRemovable
void
Volume::SetConfig(const nsCString& aConfigName, const nsCString& aConfigValue)
{
if (aConfigName.LowerCaseEqualsLiteral("removable")) {
bool value = false;
if (BoolConfigValue(aConfigValue, value)) {
SetIsRemovable(value);
} else {
ERR("Volume %s: invalid value '%s' for configuration '%s'",
NameStr(), aConfigValue.get(), aConfigName.get());
}
return;
}
if (aConfigName.LowerCaseEqualsLiteral("hotswappable")) {
bool value = false;
if (BoolConfigValue(aConfigValue, value)) {
SetIsHotSwappable(value);
} else {
ERR("Volume %s: invalid value '%s' for configuration '%s'",
NameStr(), aConfigValue.get(), aConfigName.get());
}
return;
}
ERR("Volume %s: invalid config '%s'", NameStr(), aConfigName.get());
}
示例2:
bool
Volume::BoolConfigValue(const nsCString& aConfigValue, bool& aBoolValue)
{
if (aConfigValue.EqualsLiteral("1") ||
aConfigValue.LowerCaseEqualsLiteral("true")) {
aBoolValue = true;
return true;
}
if (aConfigValue.EqualsLiteral("0") ||
aConfigValue.LowerCaseEqualsLiteral("false")) {
aBoolValue = false;
return true;
}
return false;
}
示例3: if
nsresult
XRemoteService::XfeDoCommand(nsCString &aArgument,
nsIDOMWindow *aParent)
{
nsresult rv = NS_OK;
// see if there are any arguments on the end
nsCString restArgument;
PRUint32 index;
FindRestInList(aArgument, restArgument, &index);
if (!restArgument.IsEmpty())
aArgument.Truncate(index);
nsCOMPtr<nsISupportsString> arg;
arg = do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID, &rv);
if (NS_FAILED(rv))
return rv;
// pass the second argument as parameter
arg->SetData(NS_ConvertUTF8toUTF16(restArgument));
// someone requested opening mail/news
if (aArgument.LowerCaseEqualsLiteral("openinbox")) {
// check to see if it's already running
nsCOMPtr<nsIDOMWindowInternal> domWindow;
rv = FindWindow(NS_LITERAL_STRING("mail:3pane").get(),
getter_AddRefs(domWindow));
if (NS_FAILED(rv))
return rv;
// focus the window if it was found
if (domWindow) {
domWindow->Focus();
}
// otherwise open a new mail/news window
else {
// get the mail chrome location
nsXPIDLCString mailLocation;
GetMailLocation(getter_Copies(mailLocation));
if (!mailLocation)
return NS_ERROR_FAILURE;
nsCOMPtr<nsIDOMWindow> newWindow;
rv = OpenChromeWindow(0, mailLocation, "chrome,all,dialog=no",
arg, getter_AddRefs(newWindow));
}
}
// open a new browser window
else if (aArgument.LowerCaseEqualsLiteral("openbrowser")) {
// Get the browser URL and the default start page URL.
nsCOMPtr<nsICmdLineHandler> browserHandler =
do_GetService("@mozilla.org/commandlinehandler/general-startup;1?type=browser");
if (!browserHandler)
return NS_ERROR_FAILURE;
nsXPIDLCString browserLocation;
browserHandler->GetChromeUrlForTask(getter_Copies(browserLocation));
nsXPIDLString startPage;
browserHandler->GetDefaultArgs(getter_Copies(startPage));
arg->SetData(startPage);
nsCOMPtr<nsIDOMWindow> newWindow;
rv = OpenChromeWindow(0, browserLocation, "chrome,all,dialog=no",
arg, getter_AddRefs(newWindow));
}
// open a new compose window
else if (aArgument.LowerCaseEqualsLiteral("composemessage")) {
/*
* Here we change to OpenChromeWindow instead of OpenURL so as to
* pass argument values to the compose window, especially attachments
*/
const char * composeLocation;
rv = GetComposeLocation(&composeLocation);
if (rv != NS_OK)
return NS_ERROR_FAILURE;
nsCOMPtr<nsIDOMWindow> newWindow;
rv = OpenChromeWindow(0, composeLocation, "chrome,all,dialog=no",
arg, getter_AddRefs(newWindow));
}
// open a new calendar window
else if (aArgument.LowerCaseEqualsLiteral("opencalendar")) {
// check to see if it's already running
nsCOMPtr<nsIDOMWindowInternal> aWindow;
rv = FindWindow(NS_LITERAL_STRING("calendarMainWindow").get(),
getter_AddRefs(aWindow));
//.........这里部分代码省略.........