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


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

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


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

示例1: notifyFinished

void HTMLTokenizer::notifyFinished(CachedObject *finishedObj)
{
    if (view && finishedObj == cachedScript) {
#ifdef TOKEN_DEBUG
        kdDebug( 6036 ) << "Finished loading an external script" << endl;
#endif
        loadingExtScript = false;
        DOMString scriptSource = cachedScript->script();
#ifdef TOKEN_DEBUG
        kdDebug( 6036 ) << "External script is:" << endl << scriptSource.string() << endl;
#endif
        cachedScript->deref(this);
        cachedScript = 0;
        executingScript = true;
        view->part()->executeScript(scriptSource.string());
        executingScript = false;

        // 'script' is true when we are called synchronously from
        // parseScript(). In that case parseScript() will take care
        // of 'scriptOutput'.
        if (!script)
        {
           QString rest = scriptOutput+pendingSrc;
           scriptOutput = pendingSrc = "";
           write(rest);
        }
    }
}
开发者ID:BackupTheBerlios,项目名称:nirvana-svn,代码行数:28,代码来源:htmltokenizer.cpp

示例2: parseString

bool CSSStyleSheetImpl::parseString(const DOMString &string, bool strict)
{
    strictParsing = strict;
    const QString preprocessed = preprocess(string.string());

#ifdef CSS_STYLESHEET_DEBUG
    kdDebug( 6080 ) << "parsing sheet, len=" << string.length() << ", sheet is " << string.string() << endl;
#endif

    const QChar *curP = preprocessed.unicode();
    const QChar *endP = preprocessed.unicode() + preprocessed.length();

#ifdef CSS_STYLESHEET_DEBUG
    kdDebug( 6080 ) << "preprocessed sheet, len=" << preprocessed.length() << ", sheet is " << preprocessed << endl;
#endif

    while (curP && (curP < endP))
    {
        CSSRuleImpl *rule = parseRule(curP, endP);
        if(rule)
        {
           m_lstChildren->append(rule);
           rule->setParent(this);
//           rule->init();
        }
    }
    return true;
}
开发者ID:crutchwalkfactory,项目名称:motocakerteam,代码行数:28,代码来源:css_stylesheetimpl.cpp

示例3: initKeyboardEvent

void KeyboardEventImpl::initKeyboardEvent(const DOMString &typeArg, bool canBubbleArg, bool cancelableArg, const AbstractView &viewArg,
        const DOMString &keyIdentifierArg, unsigned long keyLocationArg, const DOMString &modifiersList)
{
    unsigned keyVal = 0;
    unsigned virtKeyVal = 0;

    m_keyLocation = keyLocationArg;

    // Figure out the code information from the key identifier.
    if(keyIdentifierArg.length() == 1)
    {
        // Likely to be normal unicode id, unless it's one of the few
        // special values.
        unsigned short code = keyIdentifierArg.unicode()[0];
        if(code > 0x20 && code != 0x7F)
            keyVal = code;
    }

    if(!keyVal) // One of special keys, likely.
        virtKeyVal = keyIdentifiersToVirtKeys()->toRight(keyIdentifierArg.string().latin1());

    // Process modifier list.
    QStringList mods = QStringList::split(' ', modifiersList.string().stripWhiteSpace().simplifyWhiteSpace());

    unsigned modifiers = 0;
    for(QStringList::Iterator i = mods.begin(); i != mods.end(); ++i)
        if(unsigned mask = keyModifiersToCode()->toRight((*i).latin1()))
            modifiers |= mask;

    initKeyBaseEvent(typeArg, canBubbleArg, cancelableArg, viewArg, keyVal, virtKeyVal, modifiers);
}
开发者ID:,项目名称:,代码行数:31,代码来源:

示例4: setProperty

void CSSStyleDeclarationImpl::setProperty( const DOMString &propName, const DOMString &value, const DOMString &priority )
{
    int id = getPropertyID(propName.string().lower().ascii(), propName.length());
    if (!id) return;

    bool important = false;
    QString str = priority.string().lower();
    if(str.contains("important"))
	important = true;

    setProperty(id, value, important);
}
开发者ID:BackupTheBerlios,项目名称:nirvana-svn,代码行数:12,代码来源:css_valueimpl.cpp

示例5: setProperty

void CSSStyleDeclaration::setProperty( const DOMString &propName, const DOMString &value, const DOMString &priority )
{
    if(!impl) return;
    int id = getPropertyID(propName.string().lower().ascii(), propName.length());
    if (!id) return;
    bool important = false;
    QString str = priority.string();
    if (str.find("important", 0, false) != -1)
        important = true;

    static_cast<CSSStyleDeclarationImpl *>(impl)->setProperty( id, value, important );
}
开发者ID:crutchwalkfactory,项目名称:motocakerteam,代码行数:12,代码来源:css_value.cpp

示例6: setProperty

void CSSStyleDeclarationImpl::setProperty ( const DOMString &propertyString)
{
    DOMString ppPropertyString = preprocess(propertyString.string(),true);
    QPtrList<CSSProperty> *props = parseProperties(ppPropertyString.unicode(),
						ppPropertyString.unicode()+ppPropertyString.length());
    if(!props || !props->count())
	return;

    props->setAutoDelete(false);

    if(!m_lstValues) {
	m_lstValues = new QPtrList<CSSProperty>;
	m_lstValues->setAutoDelete( true );
    }

    CSSProperty *prop = props->first();
    while( prop ) {
	removeProperty(prop->m_id, false);
	m_lstValues->append(prop);
 	prop = props->next();
    }

    delete props;
    setChanged();
}
开发者ID:crutchwalkfactory,项目名称:motocakerteam,代码行数:25,代码来源:css_valueimpl.cpp

示例7: parseClassAttribute

void HTMLNamedAttrMapImpl::parseClassAttribute(const DOMString& classStr)
{
    m_classList.clear();
    if (!element->hasClass())
        return;
    
    DOMString classAttr = element->getDocument()->inCompatMode() ? 
        (classStr.implementation()->isLower() ? classStr : DOMString(classStr.implementation()->lower())) :
        classStr;
    
    if (classAttr.find(' ') == -1)
        m_classList.setString(AtomicString(classAttr));
    else {
        QString val = classAttr.string();
        QStringList list = QStringList::split(' ', val);
        
        AtomicStringList* curr = 0;
        for (QStringList::Iterator it = list.begin(); it != list.end(); ++it)
        {
            const QString& singleClass = *it;
            if (!singleClass.isEmpty()) {
                if (curr) {
                    curr->setNext(new AtomicStringList(AtomicString(singleClass)));
                    curr = curr->next();
                }
                else {
                    m_classList.setString(AtomicString(singleClass));
                    curr = &m_classList;
                }
            }
        }
    }
}
开发者ID:BackupTheBerlios,项目名称:nirvana-svn,代码行数:33,代码来源:html_elementimpl.cpp

示例8: getPropertyPriority

DOMString CSSStyleDeclarationImpl::getPropertyPriority( const DOMString &propertyName )
{
    int id = getPropertyID(propertyName.string().ascii(), propertyName.length());
    if(getPropertyPriority(id))
	return DOMString("important");
    return DOMString();
}
开发者ID:BackupTheBerlios,项目名称:nirvana-svn,代码行数:7,代码来源:css_valueimpl.cpp

示例9: formatForDebugger

void ElementImpl::formatForDebugger(char *buffer, unsigned length) const
{
    DOMString result;
    DOMString s;
    
    s = nodeName();
    if (s.length() > 0) {
        result += s;
    }
          
    s = getAttribute(ATTR_ID);
    if (s.length() > 0) {
        if (result.length() > 0)
            result += "; ";
        result += "id=";
        result += s;
    }
          
    s = getAttribute(ATTR_CLASS);
    if (s.length() > 0) {
        if (result.length() > 0)
            result += "; ";
        result += "class=";
        result += s;
    }
          
    strncpy(buffer, result.string().latin1(), length - 1);
}
开发者ID:BackupTheBerlios,项目名称:wxwebcore-svn,代码行数:28,代码来源:dom_elementimpl.cpp

示例10: getPropertyCSSValue

CSSValue CSSStyleDeclaration::getPropertyCSSValue( const DOMString &propertyName ) const
{
    if(!impl) return 0;
    int id = getPropertyID(propertyName.string().ascii(), propertyName.length());
    if (!id) return 0;
    return static_cast<CSSStyleDeclarationImpl *>(impl)->getPropertyCSSValue(id);
}
开发者ID:crutchwalkfactory,项目名称:motocakerteam,代码行数:7,代码来源:css_value.cpp

示例11: initTextEvent

void TextEvent::initTextEvent(const DOMString &typeArg,
        bool canBubbleArg,
        bool cancelableArg,
        const AbstractView &viewArg,
        long /*detailArg*/,
        const DOMString &outputStringArg,
        unsigned long keyValArg,
        unsigned long virtKeyValArg,
        bool /*inputGeneratedArg*/,
        bool numPadArg)
{
    if (!impl)
	throw DOMException(DOMException::INVALID_STATE_ERR);

    if (impl->isTextInputEvent()) {
        //Initialize based on the outputStringArg or virtKeyValArg.
        QString text = outputStringArg.string();
        if (outputStringArg.length() == 0 && virtKeyValArg) {
            text += QChar((unsigned short)virtKeyValArg);
        }

        TextEventImpl* tImpl = static_cast<TextEventImpl*>(impl);
        tImpl->initTextEvent(typeArg, canBubbleArg, cancelableArg, viewArg, text);
    } else {
        KeyboardEventImpl* kbImpl = static_cast<KeyboardEventImpl*>(impl);
        kbImpl->initKeyboardEvent(typeArg, canBubbleArg, cancelableArg, viewArg,
            keyValArg, virtKeyValArg, 0, numPadArg ?
                KeyboardEventImpl::DOM_KEY_LOCATION_NUMPAD : KeyboardEventImpl::DOM_KEY_LOCATION_STANDARD);
    }
}
开发者ID:,项目名称:,代码行数:30,代码来源:

示例12: removeProperty

DOMString CSSStyleDeclaration::removeProperty(const DOMString &property)
{
    int id = getPropertyID(property.string().ascii(), property.length());
    if(!impl || !id)
        return DOMString();
    return static_cast< CSSStyleDeclarationImpl * >(impl)->removeProperty(id);
}
开发者ID:,项目名称:,代码行数:7,代码来源:

示例13: getNamespaceID

int XmlNamespaceTable::getNamespaceID(const DOMString& uri, bool readonly)
{
    if (uri == XHTML_NAMESPACE)
        return xhtmlNamespace;
    
    if (uri.isEmpty())
        return noNamespace;
    
    QString uriStr = uri.string();

    if (!gNamespaceTable) {
        gNamespaceTable = new QDict<XmlNamespaceEntry>;
        gNamespaceTable->insert(XHTML_NAMESPACE, new XmlNamespaceEntry(xhtmlNamespace, XHTML_NAMESPACE));
    }
    
    XmlNamespaceEntry* ns = gNamespaceTable->find(uriStr);
    if (ns) return ns->m_id;
    
    if (!readonly) {
        static int id = xhtmlNamespace+1;
        ns = new XmlNamespaceEntry(id++, uri);
        gNamespaceTable->insert(uriStr, ns);
        return ns->m_id;
    }
    
    return -1;
}
开发者ID:BackupTheBerlios,项目名称:wxwebcore-svn,代码行数:27,代码来源:xml_namespace_table.cpp

示例14: attach

void HTMLAppletElementImpl::attach()
{
    KHTMLView* w = getDocument()->view();

#ifndef Q_WS_QWS // FIXME?
    DOMString codeBase = getAttribute( ATTR_CODEBASE );
    DOMString code = getAttribute( ATTR_CODE );
    if ( !codeBase.isEmpty() )
        url = codeBase.string();
    if ( !code.isEmpty() )
        url = code.string();

    if (!w || !w->part()->javaEnabled())
#endif
        m_renderAlternative = true;

    HTMLObjectBaseElementImpl::attach();
}
开发者ID:,项目名称:,代码行数:18,代码来源:

示例15: notifyFinished

void XMLTokenizer::notifyFinished(CachedObject *finishedObj)
{
    if (finishedObj == m_cachedScript) {
        DOMString scriptSource = m_cachedScript->script();
        m_cachedScript->deref(this);
        m_cachedScript = 0;
        m_view->part()->executeScript(scriptSource.string());
	executeScripts();
    }
}
开发者ID:BackupTheBerlios,项目名称:nirvana-svn,代码行数:10,代码来源:xml_tokenizer.cpp


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