本文整理汇总了C++中Doc::url方法的典型用法代码示例。如果您正苦于以下问题:C++ Doc::url方法的具体用法?C++ Doc::url怎么用?C++ Doc::url使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Doc
的用法示例。
在下文中一共展示了Doc::url方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: readPROTO
VrmlNodeType* VrmlScene::readPROTO( VrmlMFString *urls, Doc *relative )
{
// This is a problem. The nodeType of the EXTERNPROTO has a namespace
// that refers back to this namespace (protos), which will be invalid
// after we exit this function. I guess it needs to be allocated and
// ref counted too...
VrmlNamespace protos;
Doc urlDoc;
VrmlNodeType* def = 0;
int i, n = urls->size();
theSystem->debug("readPROTO\n");
for (i=0; i<n; ++i)
{
//theSystem->debug("Trying to read url '%s'\n", urls->get(i));
urlDoc.seturl( urls->get(i), relative );
VrmlMFNode *kids = VrmlScene::readWrl( &urlDoc, &protos );
if ( kids ) delete kids;
// Grab the specified PROTO, or the first one.
const char *whichProto = urlDoc.urlModifier();
if (*whichProto)
def = (VrmlNodeType*) protos.findType( whichProto+1 );
else
def = (VrmlNodeType*) protos.firstType();
if (def)
{
def->setActualUrl( urlDoc.url() );
break;
}
else if (i < n-1 && strncmp(urls->get(i),"urn:",4))
theSystem->warn("Couldn't read EXTERNPROTO url '%s': %s\n",
urls->get(i), strerror( errno));
}
return def;
}