Пример #1
0
	/* get namespace list */
	NamespaceList Repository::getNamespaces () const
	{
		NamespaceList list;
		NamespaceMap::const_iterator iter;
		
		/* add all namespace names */
		for (iter = mNamespaces.begin(); iter != mNamespaces.end(); ++iter)
		{
			if (iter->first != "")
				list.push_back (iter->second);
		}
		
		return list;
	}
Пример #2
0
static void typedefMap( QMap<QString, QString> & map, NamespaceDom ns )
{
	const TypeAliasList aliasList = ns->typeAliasList();
	for( TypeAliasList::ConstIterator it=aliasList.begin(); it!=aliasList.end(); ++it )
		map[ ( *it )->name() ] = ( *it )->type();
	
	const NamespaceList namespaceList = ns->namespaceList();
	for( NamespaceList::ConstIterator it=namespaceList.begin(); it!=namespaceList.end(); ++it )
		typedefMap( map, *it );
	
	const ClassList classList = ns->classList();
	for( ClassList::ConstIterator it=classList.begin(); it!=classList.end(); ++it )
		typedefMap( map, *it );
}
Пример #3
0
void refreshNamespaces(ClassViewPart *part, KComboView *view)
{
    view->clear();

    NamespaceItem *global_item = new NamespaceItem( part, view->listView(), i18n("(Global Namespace)"), part->codeModel()->globalNamespace() );
    view->addItem(global_item);
    global_item->setPixmap( 0, UserIcon("CVnamespace", KIcon::DefaultState, part->instance()) );
    NamespaceList namespaces = part->codeModel()->globalNamespace()->namespaceList();
    for (NamespaceList::const_iterator it = namespaces.begin(); it != namespaces.end(); ++it)
    {
        NamespaceItem *item = new NamespaceItem(part, view->listView(), part->languageSupport()->formatModelItem(*it), *it);
        view->addItem(item);
        item->setOpen(true);
    }
    view->setCurrentActiveItem(global_item);
}
Пример #4
0
static void typeNameList( QStringList& path, QStringList & lst, NamespaceDom ns )
{
	if( !ns->isFile() )
		path.push_back( ns->name() );
	
	const NamespaceList namespaceList = ns->namespaceList();
	for( NamespaceList::ConstIterator it=namespaceList.begin(); it!=namespaceList.end(); ++it )
		typeNameList( path, lst, *it );
	
	const ClassList classList = ns->classList();
	for( ClassList::ConstIterator it=classList.begin(); it!=classList.end(); ++it )
		typeNameList( path, lst, *it );
	
	if( !ns->isFile() )
		path.pop_back();
}
Пример #5
0
NamespaceDom ViewCombosOp::namespaceByName( NamespaceDom dom, QString name )
{
    NamespaceDom result;

    result = dom->namespaceByName(name);
    if (!result)
    {
        NamespaceList nslist = dom->namespaceList();
        for (NamespaceList::const_iterator it = nslist.begin(); it != nslist.end(); ++it)
        {
            result = namespaceByName(*it, name);
            if (result)
                break;
        }
    }
    return result;
}
Пример #6
0
NamespaceList Node::NamespacesInScope() const
{
    NamespaceList result;
    xmlNsPtr *pNamespaces = xmlGetNsList(_xml->doc, _xml);
    if ( pNamespaces == nullptr )
        return result;
    
    for ( int i = 0; pNamespaces[i] != nullptr; i++ )
    {
        xmlNsPtr xmlNs = pNamespaces[i];
        result.push_back(Wrapped<class Namespace, _xmlNs>(xmlNs));
    }
    
    xmlMemFree(pNamespaces);
    
    return result;
}