Пример #1
0
 /// <summary>
 /// Visit the set of preprocessor inclusions in a translation unit. The visitor
 /// function is called with the provided data for every included file. This does
 /// not include headers included by the PCH file (unless one is inspecting the
 /// inclusions in the PCH file itself).
 /// </summary>
 /// <param name="visitor">The visiting delegate.</param>
 public void VisitInclusions(InclusionVisitor visitor)
 {
     Interop.InclusionVisitor nativeVisitor = (file, stack, size, data) => {
         var inclusionStack = new SourceLocation[(int)size];
         unsafe {
             var srcPtr = (Interop.SourceLocation *)stack;
             for (uint i = 0; i < size; ++i)
             {
                 inclusionStack[i] = (new SourceLocation(*(srcPtr + i)));
             }
         }
         visitor(new File(file), inclusionStack);
     };
     Interop.clang_getInclusions(Native, nativeVisitor, IntPtr.Zero);
 }