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


C++ DOMString::remove方法代码示例

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


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

示例1: toString

DOMString TextImpl::toString(long long startOffset, long long endOffset) const
{
    DOMString str = nodeValue();
    if(endOffset >=0 || startOffset >0)
	str = str.copy(); //we are going to modify this, so make a copy.  I hope I'm doing this right.
    if(endOffset >= 0)
        str.truncate(endOffset);
    if(startOffset > 0)    //note the order of these 2 'if' statements so that it works right when n==m_startContainer==m_endContainer
        str.remove(0, startOffset);
    return textNeedsEscaping( this ) ? escapeHTML( str ) : str;
}
开发者ID:vasi,项目名称:kdelibs,代码行数:11,代码来源:dom_textimpl.cpp

示例2: toString

DOMString TextImpl::toString(long long startOffset, long long endOffset) const
{
    // FIXME: substitute entity references as needed!

    DOMString str = nodeValue();
    if(endOffset >=0 || startOffset >0)
	str = str.copy(); //we are going to modify this, so make a copy.  I hope I'm doing this right.
    if(endOffset >= 0)
        str.truncate(endOffset);
    if(startOffset > 0)    //note the order of these 2 'if' statements so that it works right when n==m_startContainer==m_endContainer
        str.remove(0, startOffset);
    return escapeHTML( str );
}
开发者ID:,项目名称:,代码行数:13,代码来源:

示例3: setDomain

void HTMLDocumentImpl::setDomain(const DOMString &newDomain)
{
    if ( m_domain.isEmpty() ) // not set yet (we set it on demand to save time and space)
        m_domain = KURL(URL()).host().lower(); // Initially set to the host

    if ( m_domain.isEmpty() /*&& view() && view()->part()->openedByJS()*/ )
        m_domain = newDomain.lower();

    // Both NS and IE specify that changing the domain is only allowed when
    // the new domain is a suffix of the old domain.
    int oldLength = m_domain.length();
    int newLength = newDomain.length();
    if ( newLength < oldLength ) // e.g. newDomain=kde.org (7) and m_domain=www.kde.org (11)
    {
        DOMString test = m_domain.copy();
        DOMString reference = newDomain.lower();
        if ( test[oldLength - newLength - 1] == '.' ) // Check that it's a subdomain, not e.g. "de.org"
        {
            test.remove( 0, oldLength - newLength ); // now test is "kde.org" from m_domain
            if ( test == reference )                 // and we check that it's the same thing as newDomain
                m_domain = reference;
        }
    }
}
开发者ID:crutchwalkfactory,项目名称:motocakerteam,代码行数:24,代码来源:html_documentimpl.cpp


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