本文整理汇总了C++中DOMString::appendData方法的典型用法代码示例。如果您正苦于以下问题:C++ DOMString::appendData方法的具体用法?C++ DOMString::appendData怎么用?C++ DOMString::appendData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DOMString
的用法示例。
在下文中一共展示了DOMString::appendData方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: toString
DOMString AttrImpl::toString()
{
DOMString retString;
retString.appendData(name);
retString.appendData(DOMString("=\""));
retString.appendData(getValue());
retString.appendData(DOMString("\""));
return retString;
}
示例2: getValue
DOMString AttrImpl::getValue()
{
if (value.child == null) {
return 0; // return "";
}
if (hasStringValue()) {
// change value into a DOMString*
DOMString *x = (value.str == null
?(value.str = new (getOwnerDocument()->getMemoryManager()) DOMString())
:value.str
);
// return the DOMString it points to
return *x;
}
ChildNode *firstChild = value.child;
ChildNode *node = firstChild->nextSibling;
if (node == null) {
return firstChild->getNodeValue().clone();
}
int length = 0;
for (node = firstChild; node != null; node = node->nextSibling)
length += node->getNodeValue().length();
DOMString retString;
retString.reserve(length);
for (node = firstChild; node != null; node = node->nextSibling)
{
retString.appendData(node->getNodeValue());
};
return retString;
};
示例3:
DOMString operator + (XMLCh lhs, const DOMString& rhs)
{
DOMString retString;
retString.appendData(lhs);
retString.appendData(rhs);
return retString;
}
示例4: toString
DOMString RangeImpl::toString() const
{
if( fDetached) {
throw DOM_DOMException(
DOM_DOMException::INVALID_STATE_ERR, null);
}
DOM_Node node = fStartContainer;
DOM_Node stopNode = fEndContainer;
DOMString tempString;
if ( (fStartContainer.getNodeType() == DOM_Node::TEXT_NODE)
|| (fStartContainer.getNodeType() == DOM_Node::CDATA_SECTION_NODE) ) {
if (fStartContainer == fEndContainer) {
tempString.appendData(fStartContainer.getNodeValue().substringData(fStartOffset, fEndOffset-fStartOffset));
return tempString;
} else {
int length = fStartContainer.getNodeValue().length();
tempString.appendData(fStartContainer.getNodeValue().substringData(fStartOffset, length - fStartOffset));
node = nextNode(node, true);
}
} else { //fStartContainer is not a TextNode
node=node.getFirstChild();
if (fStartOffset>0) { //find a first node within a range, specified by fStartOffset
unsigned int counter = 0;
while (counter<fStartOffset && node!=null) {
node=node.getNextSibling();
counter++;
}
}
if (node == null) {
node = nextNode(fStartContainer,false);
}
}
if ( fEndContainer.getNodeType()!= DOM_Node::TEXT_NODE &&
fEndContainer.getNodeType()!= DOM_Node::CDATA_SECTION_NODE ) {
int i=fEndOffset;
stopNode = fEndContainer.getFirstChild();
while( i>0 && stopNode!=null ) {
--i;
stopNode = stopNode.getNextSibling();
}
if ( stopNode == null )
stopNode = nextNode( fEndContainer, false );
}
while (node != stopNode) { //look into all kids of the Range
if (node == null) break;
if (node.getNodeType() == DOM_Node::TEXT_NODE
|| node.getNodeType() == DOM_Node::CDATA_SECTION_NODE) {
tempString.appendData(node.getNodeValue());
}
node = nextNode(node, true);
}
if (fEndContainer.getNodeType() == DOM_Node::TEXT_NODE
|| fEndContainer.getNodeType() == DOM_Node::CDATA_SECTION_NODE) {
tempString.appendData(fEndContainer.getNodeValue().substringData(0,fEndOffset));
}
return tempString;
}
示例5: DOMString
DOMString operator + (const XMLCh* lhs, const DOMString& rhs)
{
DOMString retString = DOMString(lhs);
retString.appendData(rhs);
return retString;
}