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


C++ nsAutoString::IsEmpty方法代码示例

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


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

示例1: acceptLangs

bool
SVGTests::PassesConditionalProcessingTests(const nsString *aAcceptLangs) const
{
    // Required Features
    if (mStringListAttributes[FEATURES].IsExplicitlySet()) {
        if (mStringListAttributes[FEATURES].IsEmpty()) {
            return false;
        }
        nsCOMPtr<nsIContent> content(
            do_QueryInterface(const_cast<SVGTests*>(this)));

        for (uint32_t i = 0; i < mStringListAttributes[FEATURES].Length(); i++) {
            if (!nsSVGFeatures::HasFeature(content, mStringListAttributes[FEATURES][i])) {
                return false;
            }
        }
    }

    // Required Extensions
    //
    // The requiredExtensions  attribute defines a list of required language
    // extensions. Language extensions are capabilities within a user agent that
    // go beyond the feature set defined in the SVG specification.
    // Each extension is identified by a URI reference.
    // For now, claim that mozilla's SVG implementation supports XHTML and MathML.
    if (mStringListAttributes[EXTENSIONS].IsExplicitlySet()) {
        if (mStringListAttributes[EXTENSIONS].IsEmpty()) {
            return false;
        }
        for (uint32_t i = 0; i < mStringListAttributes[EXTENSIONS].Length(); i++) {
            if (!nsSVGFeatures::HasExtension(mStringListAttributes[EXTENSIONS][i])) {
                return false;
            }
        }
    }

    if (aAcceptLangs == kIgnoreSystemLanguage) {
        return true;
    }

    // systemLanguage
    //
    // Evaluates to "true" if one of the languages indicated by user preferences
    // exactly equals one of the languages given in the value of this parameter,
    // or if one of the languages indicated by user preferences exactly equals a
    // prefix of one of the languages given in the value of this parameter such
    // that the first tag character following the prefix is "-".
    if (mStringListAttributes[LANGUAGE].IsExplicitlySet()) {
        if (mStringListAttributes[LANGUAGE].IsEmpty()) {
            return false;
        }

        // Get our language preferences
        const nsAutoString acceptLangs(aAcceptLangs ? *aAcceptLangs :
                                       Preferences::GetLocalizedString("intl.accept_languages"));

        if (acceptLangs.IsEmpty()) {
            NS_WARNING("no default language specified for systemLanguage conditional test");
            return false;
        }

        const nsDefaultStringComparator defaultComparator;

        for (uint32_t i = 0; i < mStringListAttributes[LANGUAGE].Length(); i++) {
            nsCharSeparatedTokenizer languageTokenizer(acceptLangs, ',');
            while (languageTokenizer.hasMoreTokens()) {
                if (nsStyleUtil::DashMatchCompare(mStringListAttributes[LANGUAGE][i],
                                                  languageTokenizer.nextToken(),
                                                  defaultComparator)) {
                    return true;
                }
            }
        }
        return false;
    }

    return true;
}
开发者ID:carriercomm,项目名称:gecko-dev,代码行数:78,代码来源:SVGTests.cpp


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