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


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

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


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

示例1: ChildNode

//Introduced in DOM Level 2
XMLDeclImpl::XMLDeclImpl(DocumentImpl *ownerDoc, const DOMString &ver,
                         const DOMString &enc, const DOMString &isStd)
	: ChildNode(ownerDoc),
    version ( ver.clone() ),
    encoding ( enc.clone() ),
    standalone ( isStd.clone() )
{
}
开发者ID:ksmyth,项目名称:xerces-c,代码行数:9,代码来源:XMLDeclImpl.cpp

示例2: ChildNode

XERCES_CPP_NAMESPACE_BEGIN


ProcessingInstructionImpl::ProcessingInstructionImpl(DocumentImpl *ownerDoc,
                                                     const DOMString &targt,
                                                     const DOMString &dat)
    : ChildNode(ownerDoc)
{
    this->target = targt.clone();
    this->data = dat.clone();
};
开发者ID:gitrider,项目名称:wxsj2,代码行数:11,代码来源:ProcessingInstructionImpl.cpp

示例3: NodeImpl

XERCES_CPP_NAMESPACE_BEGIN


/**
* Notations are how the Document Type Description (DTD) records hints
* about the format of an XML "unparsed entity" -- in other words,
* non-XML data bound to this document type, which some applications
* may wish to consult when manipulating the document. A Notation
* represents a name-value pair, with its nodeName being set to the
* declared name of the notation.
* <P>
* Notations are also used to formally declare the "targets" of
* Processing Instructions.
* <P>
* Note that the Notation's data is non-DOM information; the DOM only
* records what and where it is.
* <P>
* See the XML 1.0 spec, sections 4.7 and 2.6, for more info.
* <P>
* Level 1 of the DOM does not support editing Notation contents.
*
* @author Rania Y. Khalaf
* @author Joseph Kesselman
* @since  PR-DOM-Level-1-19980818.
*/

NotationImpl::NotationImpl(DocumentImpl *ownerDoc, const DOMString &nName)
    : NodeImpl(ownerDoc)
{
    name = nName.clone();
}
开发者ID:brock7,项目名称:TianLong,代码行数:31,代码来源:NotationImpl.cpp

示例4: setNodeValue

void ProcessingInstructionImpl::setNodeValue(const DOMString &value)
{
    if (isReadOnly())
        throw DOM_DOMException(DOM_DOMException::NO_MODIFICATION_ALLOWED_ERR,
                               null);
    data = value.clone();
};
开发者ID:gitrider,项目名称:wxsj2,代码行数:7,代码来源:ProcessingInstructionImpl.cpp

示例5: DOM_DOMException

//Introduced in DOM Level 2
AttrNSImpl::AttrNSImpl(DocumentImpl *ownerDoc,
                       const DOMString &fNamespaceURI,
                       const DOMString &qualifiedName) :
    AttrImpl(ownerDoc, qualifiedName)
{
    DOMString xmlns = NodeImpl::getXmlnsString();
    DOMString xmlnsURI = NodeImpl::getXmlnsURIString();
    this->name = qualifiedName.clone();

    int index = DocumentImpl::indexofQualifiedName(qualifiedName);
    DOMString prefix;
    if (index < 0)
	throw DOM_DOMException(DOM_DOMException::NAMESPACE_ERR, null);
    bool xmlnsAlone = false;	//true if attribute name is "xmlns"
    if (index == 0) {	//qualifiedName contains no ':'
        if (this->name.equals(xmlns)) {
	    if (!fNamespaceURI.equals(xmlnsURI))
		throw DOM_DOMException(DOM_DOMException::NAMESPACE_ERR, null);
	    xmlnsAlone = true;
	}
	prefix = null;
	this -> localName = this -> name;
    } else {	//0 < index < this->name.length()-1
	prefix = this->name.substringData(0, index);
	this -> localName =
            this->name.substringData(index+1, this->name.length()-index-1);
    }

    const DOMString& URI = xmlnsAlone ?
        xmlnsURI : mapPrefix(prefix, fNamespaceURI, DOM_Node::ATTRIBUTE_NODE);
    this -> namespaceURI = URI == null ? DOMString(null) : URI.clone();
};
开发者ID:syoutetu,项目名称:ColladaViewer_VC8,代码行数:33,代码来源:AttrNSImpl.cpp

示例6: ParentNode

XERCES_CPP_NAMESPACE_BEGIN


EntityReferenceImpl::EntityReferenceImpl(DocumentImpl *ownerDoc,
                                         const DOMString &entityName)
    : ParentNode(ownerDoc)
{
    name = entityName.clone();
    // EntityReference behaves as a read-only node, since its contents
    // reflect the Entity it refers to -- but see setNodeName().

    //retrieve the corresponding entity content
    if (ownerDoc) {
        if (ownerDoc->getDoctype()) {
            if (ownerDoc->getDoctype()->getEntities()) {
                EntityImpl* entity = (EntityImpl*)ownerDoc->getDoctype()->getEntities()->getNamedItem(entityName);
                if (entity) {
                    EntityReferenceImpl* refEntity = entity->getEntityRef();
                    if (refEntity)
                        cloneChildren(*refEntity);
                }
            }
        }
    }

    setReadOnly(true, true);
}
开发者ID:js422,项目名称:PERL,代码行数:27,代码来源:EntityReferenceImpl.cpp

示例7: NodeImpl

XERCES_CPP_NAMESPACE_BEGIN


/*
 * The handling of the value field being either the first child node (a
 * ChildNode*) or directly the value (a DOMString) is rather tricky. In the
 * DOMString case we need to get the field in the right type so that the
 * compiler is happy and the appropriate operator gets called. This is
 * essential for the reference counts of the DOMStrings involved to be updated
 * as due.
 * This is consistently achieved by taking the address of the value field and
 * changing it into a DOMString*, and then dereferencing it to get a DOMString.
 * The typical piece of code is:
 * DOMString *x = (DomString *)&value;
 *  ... use of *x which is the DOMString ...
 * This was amended by neilg after memory management was
 * introduced.  Now a union exists which is either a 
 * DOMString * or a ChildNode *.  This will be less efficient
 * (one more dereference per access) but actually works on all the
 * compilers we support.
 */

AttrImpl::AttrImpl(DocumentImpl *ownerDoc, const DOMString &aName)
    : NodeImpl (ownerDoc)
{
    name = aName.clone();
    isSpecified(true);
    hasStringValue(true);
    value.child = null;
};
开发者ID:js422,项目名称:PERL,代码行数:30,代码来源:AttrImpl.cpp

示例8: setData

void CharacterDataImpl::setData(const DOMString &arg)
{
    if (isReadOnly())
        throw DOM_DOMException(DOM_DOMException::NO_MODIFICATION_ALLOWED_ERR,
                               null);
    data = arg.clone();
};
开发者ID:syoutetu,项目名称:ColladaViewer_VC8,代码行数:7,代码来源:CharacterDataImpl.cpp

示例9: insertData

void DOMString::insertData(unsigned int offset, const DOMString &src)
{
    unsigned int origStrLength = this->length();
    if (offset > origStrLength)
        throw DOM_DOMException(DOM_DOMException::INDEX_SIZE_ERR, 0);

    if (fHandle == 0)
    {
        *this = src.clone();
        return;
    }

    if (src.fHandle == 0 || src.fHandle->fLength == 0)
        return;

    XMLCh *srcP = src.fHandle->fDSData->fData;
    unsigned int srcLength = src.fHandle->fLength;
    unsigned int newLength = fHandle->fLength + srcLength;
    if (newLength >= fHandle->fDSData->fBufferLength ||
            fHandle->fDSData->fRefCount > 1  || fHandle == src.fHandle )
    {
        // We can't stick the data to be added into the
        //  existing string, either because there is not space in
        //  the buffer, or because the buffer is being shared with
        //  some other string.
        //  So, make a new buffer.

        DOMStringData *newBuf = DOMStringData::allocateBuffer(newLength+1);
        XMLCh *newP  = newBuf->fData;
        XMLCh *oldP   = fHandle->fDSData->fData;
        unsigned int i;
        for (i=0; i<offset; ++i)
            newP[i] = oldP[i];

        for (i=0; i<srcLength; i++)
            newP[i+offset] = srcP[i];

        for (i=offset; i<origStrLength; i++)
            newP[i+srcLength] = oldP[i];

        fHandle->fDSData->removeRef();
        fHandle->fDSData = newBuf;
    }
    else
    {
        // There is room in the already-existing buffer to hold
        //  the data to be inserted.  Insert it.
        //
        XMLCh *destP = fHandle->fDSData->fData;
        int i;
        for (i=(int)origStrLength-1; i>=(int)offset; i--)
            destP[i+srcLength] = destP[i];

        unsigned int j;
        for (j=0; j<srcLength; j++)
            destP[j+offset] = srcP[j];
    }

    fHandle->fLength += srcLength;
}
开发者ID:mydw,项目名称:mydw,代码行数:60,代码来源:DOMString.cpp

示例10: setData

/**
* Change the data content of this PI.
* Note that setNodeValue is aliased to setData
* @see getData().
* @throws DOMException(NO_MODIFICATION_ALLOWED_ERR) if node is read-only.
*/
void ProcessingInstructionImpl::setData(const DOMString &arg)
{
    if (isReadOnly())
        throw DOM_DOMException(DOM_DOMException::NO_MODIFICATION_ALLOWED_ERR,
                               null);
    data = arg.clone();
};
开发者ID:gitrider,项目名称:wxsj2,代码行数:13,代码来源:ProcessingInstructionImpl.cpp

示例11: setSystemId

void NotationImpl::setSystemId(const DOMString &arg)
{
    if(isReadOnly())
        throw DOM_DOMException(
        DOM_DOMException::NO_MODIFICATION_ALLOWED_ERR,null);

    systemId = arg.clone();
}
开发者ID:brock7,项目名称:TianLong,代码行数:8,代码来源:NotationImpl.cpp

示例12: ParentNode

XERCES_CPP_NAMESPACE_BEGIN


EntityImpl::EntityImpl(DocumentImpl *ownerDoc, const DOMString &eName)
   : ParentNode(ownerDoc)
{
    name        = eName.clone();
    setReadOnly(true, true);
}
开发者ID:mydw,项目名称:mydw,代码行数:9,代码来源:EntityImpl.cpp

示例13: ChildNode

XERCES_CPP_NAMESPACE_BEGIN


CharacterDataImpl::CharacterDataImpl(DocumentImpl *ownerDoc,
                                     const DOMString &dat)
    : ChildNode(ownerDoc)
{
    this->data = dat.clone();
};
开发者ID:syoutetu,项目名称:ColladaViewer_VC8,代码行数:9,代码来源:CharacterDataImpl.cpp

示例14: NodeImpl

XERCES_CPP_NAMESPACE_BEGIN



ElementDefinitionImpl::ElementDefinitionImpl(DocumentImpl *ownerDoc,
                                             const DOMString &nam)
    : NodeImpl(ownerDoc)
{
    name = nam.clone();
    attributes = 0;
};
开发者ID:ksmyth,项目名称:xerces-c,代码行数:11,代码来源:ElementDefinitionImpl.cpp

示例15: ParentNode

XERCES_CPP_NAMESPACE_BEGIN


EntityImpl::EntityImpl(DocumentImpl *ownerDoc, const DOMString &eName)
   : ParentNode(ownerDoc),
	refEntity(0)

{
    name        = eName.clone();
    setReadOnly(true, true);
}   /* SPEC_CPU: removed extra ';' for C++98 standards compliance -- yag */
开发者ID:,项目名称:,代码行数:11,代码来源:


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