Exemple #1
0
 internal unsafe EntityReference(Library.CXIdxEntityRefInfo handle, ITranslationUnitItemFactory itemFactory)
 {
     _handle = handle;
     _itemFactory = itemFactory;
     if (_handle.referencedEntity != (Library.CXIdxEntityInfo*)IntPtr.Zero)
         _refedEntity = new EntityInfo(*_handle.referencedEntity, _itemFactory);
     if (_handle.parentEntity != (Library.CXIdxEntityInfo*)IntPtr.Zero)
         _parentEntity = new EntityInfo(*_handle.parentEntity, _itemFactory);
     if(_handle.container != (Library.CXIdxContainerInfo*)IntPtr.Zero)
         _container = _itemFactory.CreateCursor(_handle.container->cursor);
 }
Exemple #2
0
        internal unsafe DeclInfo(Library.CXIdxDeclInfo handle, ITranslationUnitItemFactory itemFactory)
        {
            _handle = handle;
            _itemFactory = itemFactory;

            _entityInfo = new EntityInfo(*_handle.entityInfo, itemFactory);

            if (handle.semanticContainer != (Library.CXIdxContainerInfo*)IntPtr.Zero)
                _semanticContainer = _itemFactory.CreateCursor(handle.semanticContainer->cursor);

            if(handle.lexicalContainer != (Library.CXIdxContainerInfo*)IntPtr.Zero)
                _lexicalContainer = _itemFactory.CreateCursor(handle.lexicalContainer->cursor);

            if(handle.declAsContainer != (Library.CXIdxContainerInfo*)IntPtr.Zero)
                _declAsContainer = _itemFactory.CreateCursor(handle.declAsContainer->cursor);

           // Debug.Assert(Location == Cursor.Location);            
        }