本文整理汇总了C++中StringView::toInt方法的典型用法代码示例。如果您正苦于以下问题:C++ StringView::toInt方法的具体用法?C++ StringView::toInt怎么用?C++ StringView::toInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringView
的用法示例。
在下文中一共展示了StringView::toInt方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setWindowFeature
static void setWindowFeature(WindowFeatures& features, StringView key, StringView value)
{
// Listing a key with no value is shorthand for key=yes
int numericValue;
if (value.isEmpty() || equalLettersIgnoringASCIICase(value, "yes"))
numericValue = 1;
else
numericValue = value.toInt();
// We treat key of "resizable" here as an additional feature rather than setting resizeable to true.
// This is consistent with Firefox, but could also be handled at another level.
if (equalLettersIgnoringASCIICase(key, "left") || equalLettersIgnoringASCIICase(key, "screenx"))
features.x = numericValue;
else if (equalLettersIgnoringASCIICase(key, "top") || equalLettersIgnoringASCIICase(key, "screeny"))
features.y = numericValue;
else if (equalLettersIgnoringASCIICase(key, "width") || equalLettersIgnoringASCIICase(key, "innerwidth"))
features.width = numericValue;
else if (equalLettersIgnoringASCIICase(key, "height") || equalLettersIgnoringASCIICase(key, "innerheight"))
features.height = numericValue;
else if (equalLettersIgnoringASCIICase(key, "menubar"))
features.menuBarVisible = numericValue;
else if (equalLettersIgnoringASCIICase(key, "toolbar"))
features.toolBarVisible = numericValue;
else if (equalLettersIgnoringASCIICase(key, "location"))
features.locationBarVisible = numericValue;
else if (equalLettersIgnoringASCIICase(key, "status"))
features.statusBarVisible = numericValue;
else if (equalLettersIgnoringASCIICase(key, "fullscreen"))
features.fullscreen = numericValue;
else if (equalLettersIgnoringASCIICase(key, "scrollbars"))
features.scrollbarsVisible = numericValue;
else if (numericValue == 1)
features.additionalFeatures.append(key.toString());
}