本文整理汇总了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;
}
示例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 );
}
示例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;
}
}
}