本文整理汇总了C++中DOMDocumentImpl::cloneString方法的典型用法代码示例。如果您正苦于以下问题:C++ DOMDocumentImpl::cloneString方法的具体用法?C++ DOMDocumentImpl::cloneString怎么用?C++ DOMDocumentImpl::cloneString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DOMDocumentImpl
的用法示例。
在下文中一共展示了DOMDocumentImpl::cloneString方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setOwnerDocument
/**
* NON-DOM
* set the ownerDocument of this node and its children
*/
void DOMDocumentTypeImpl::setOwnerDocument(DOMDocument *doc) {
if (castToNodeImpl(this)->getOwnerDocument()) {
fNode.setOwnerDocument(doc);
fParent.setOwnerDocument(doc);
}
else {
if (doc) {
DOMDocumentImpl *docImpl = (DOMDocumentImpl *)doc;
fPublicId = docImpl->cloneString(fPublicId);
fSystemId = docImpl->cloneString(fSystemId);
fInternalSubset = docImpl->cloneString(fInternalSubset);
fName = docImpl->getPooledString(fName);
fNode.setOwnerDocument(doc);
fParent.setOwnerDocument(doc);
DOMNamedNodeMapImpl* entitiesTemp = fEntities->cloneMap(this);
DOMNamedNodeMapImpl* notationsTemp = fNotations->cloneMap(this);
DOMNamedNodeMapImpl* elementsTemp = fElements->cloneMap(this);
fEntities = entitiesTemp;
fNotations = notationsTemp;
fElements = elementsTemp;
}
}
}
示例2: setInternalSubset
void DOMDocumentTypeImpl::setInternalSubset(const XMLCh *value)
{
DOMDocumentImpl* doc = (DOMDocumentImpl *)castToNodeImpl(this)->getOwnerDocument();
if (doc != 0)
fInternalSubset = doc->cloneString(value);
else {
XMLMutexLock lock(sDocumentMutex);
fInternalSubset = ((DOMDocumentImpl *)sDocument)->cloneString(value);
}
}
示例3: setPublicId
void DOMDocumentTypeImpl::setPublicId(const XMLCh *value)
{
// revist. Why shouldn't 0 be assigned like any other value?
if (value == 0)
return;
DOMDocumentImpl* doc = (DOMDocumentImpl *)castToNodeImpl(this)->getOwnerDocument();
if (doc != 0)
fPublicId = doc->cloneString(value);
else {
XMLMutexLock lock(sDocumentMutex);
fPublicId = ((DOMDocumentImpl *)sDocument)->cloneString(value);
}
}
示例4: getBaseURI
const XMLCh* DOMElementImpl::getBaseURI() const
{
const XMLCh* baseURI = fNode.fOwnerNode->getBaseURI();
if (fAttributes) {
const XMLCh baseString[] =
{
chLatin_b, chLatin_a, chLatin_s, chLatin_e, chNull
};
DOMNode* attrNode = fAttributes->getNamedItemNS(DOMNodeImpl::getXmlURIString(), baseString);
if (attrNode==NULL) {
const XMLCh xmlBaseString[] =
{
chLatin_x, chLatin_m, chLatin_l, chColon, chLatin_b, chLatin_a, chLatin_s, chLatin_e, chNull
};
attrNode = fAttributes->getNamedItem(xmlBaseString);
}
if (attrNode) {
const XMLCh* uri = attrNode->getNodeValue();
if (uri && *uri) {// attribute value is always empty string
// if there is a base URI for the parent node, use it to resolve relative URI
if(baseURI)
{
try {
DOMDocumentImpl* doc = (DOMDocumentImpl *)fParent.fOwnerDocument;
XMLUri temp(baseURI, doc->getMemoryManager());
XMLUri temp2(&temp, uri, doc->getMemoryManager());
uri = doc->cloneString(temp2.getUriText());
}
catch(const OutOfMemoryException&)
{
throw;
}
catch (...){
// REVISIT: what should happen in this case?
return 0;
}
}
return uri;
}
}
}
return baseURI;
}
示例5: DOMException
//Introduced in DOM Level 2
DOMDocumentTypeImpl::DOMDocumentTypeImpl(DOMDocument *ownerDoc,
const XMLCh *qualifiedName,
const XMLCh *pubId,
const XMLCh *sysId,
bool heap)
: fNode(ownerDoc),
fParent(ownerDoc),
fName(0),
fEntities(0),
fNotations(0),
fElements(0),
fPublicId(0),
fSystemId(0),
fInternalSubset(0),
fIntSubsetReading(false),
fIsCreatedFromHeap(heap)
{
int index = DOMDocumentImpl::indexofQualifiedName(qualifiedName);
if (index < 0)
throw DOMException(DOMException::NAMESPACE_ERR, 0, GetDOMNodeMemoryManager);
else if (index > 0)
{
// we have to make sure the qualifiedName has correct prefix and localName
// although we don't really to store them separately
XMLCh* newName;
XMLCh temp[4000];
if (index >= 3999)
newName = (XMLCh*) XMLPlatformUtils::fgMemoryManager->allocate
(
(XMLString::stringLen(qualifiedName)+1) * sizeof(XMLCh)
);//new XMLCh[XMLString::stringLen(qualifiedName)+1];
else
newName = temp;
XMLString::copyNString(newName, qualifiedName, index);
newName[index] = chNull;
// Before we carry on, we should check if the prefix or localName are valid XMLName
if (ownerDoc) {
if (!((DOMDocumentImpl*)ownerDoc)->isXMLName(newName) || !((DOMDocumentImpl*)ownerDoc)->isXMLName(qualifiedName+index+1))
throw DOMException(DOMException::NAMESPACE_ERR, 0, GetDOMNodeMemoryManager);
}
else {
// document is not there yet, so assume XML 1.0
if (!XMLChar1_0::isValidName(newName) || !XMLChar1_0::isValidName(qualifiedName+index+1))
throw DOMException(DOMException::NAMESPACE_ERR, 0, GetDOMNodeMemoryManager);
}
if (index >= 3999)
XMLPlatformUtils::fgMemoryManager->deallocate(newName);//delete[] newName;
}
if (ownerDoc) {
DOMDocumentImpl *docImpl = (DOMDocumentImpl *)ownerDoc;
fPublicId = docImpl->cloneString(pubId);
fSystemId = docImpl->cloneString(sysId);
fName = ((DOMDocumentImpl *)ownerDoc)->getPooledString(qualifiedName);
fEntities = new (ownerDoc) DOMNamedNodeMapImpl(this);
fNotations= new (ownerDoc) DOMNamedNodeMapImpl(this);
fElements = new (ownerDoc) DOMNamedNodeMapImpl(this);
}
else {
DOMDocument* doc = &gDocTypeDocument();
fPublicId = ((DOMDocumentImpl*) doc)->cloneString(pubId);
fSystemId = ((DOMDocumentImpl*) doc)->cloneString(sysId);
fName = ((DOMDocumentImpl*) doc)->getPooledString(qualifiedName);
fEntities = new (doc) DOMNamedNodeMapImpl(this);
fNotations= new (doc) DOMNamedNodeMapImpl(this);
fElements = new (doc) DOMNamedNodeMapImpl(this);
}
}
示例6: setVersion
void DOMEntityImpl::setVersion(const XMLCh* version){
DOMDocumentImpl *doc = (DOMDocumentImpl *)this->getOwnerDocument();
fVersion = doc->cloneString(version);
}
示例7: setEncoding
void DOMEntityImpl::setEncoding(const XMLCh* encoding){
DOMDocumentImpl *doc = (DOMDocumentImpl *)this->getOwnerDocument();
fEncoding = doc->cloneString(encoding);
}
示例8: setSystemId
void DOMEntityImpl::setSystemId(const XMLCh *arg)
{
DOMDocumentImpl *doc = (DOMDocumentImpl *)this->getOwnerDocument();
fSystemId = doc->cloneString(arg);
}
示例9: setNotationName
void DOMEntityImpl::setNotationName(const XMLCh *arg)
{
DOMDocumentImpl *doc = (DOMDocumentImpl *)this->getOwnerDocument();
fNotationName = doc->cloneString(arg);
}