Esempio n. 1
0
 public CXSourceLocation GetLocation(CXTranslationUnit translationUnit) => clang.getTokenLocation(translationUnit, this);
Esempio n. 2
0
 public CXString GetSpelling(CXTranslationUnit translationUnit) => clang.getTokenSpelling(translationUnit, this);
Esempio n. 3
0
 public CXSourceRange GetExtent(CXTranslationUnit translationUnit) => clang.getTokenExtent(translationUnit, this);
Esempio n. 4
0
 public bool TryIndexTranslationUnit(CXClientData clientData, ReadOnlySpan <IndexerCallbacks> indexCallbacks, CXIndexOptFlags indexOptions, CXTranslationUnit tu)
 {
     fixed(IndexerCallbacks *pIndexCallbacks = indexCallbacks)
     {
         return(clang.indexTranslationUnit(this, clientData, pIndexCallbacks, (uint)indexCallbacks.Length, (uint)indexOptions, tu) == 0);
     }
 }
Esempio n. 5
0
        public bool TryIndexSourceFileFullArgv(CXClientData clientData, ReadOnlySpan <IndexerCallbacks> indexCallbacks, CXIndexOptFlags indexOptions, string sourceFilename, ReadOnlySpan <string> commandLineArgs, ReadOnlySpan <CXUnsavedFile> unsavedFiles, out CXTranslationUnit tu, CXTranslationUnit_Flags tuOptions)
        {
            using var marshaledSourceFilename  = new MarshaledString(sourceFilename);
            using var marshaledCommandLineArgs = new MarshaledStringArray(commandLineArgs);

            fixed(IndexerCallbacks *pIndexCallbacks = indexCallbacks)
            fixed(CXUnsavedFile * pUnsavedFiles = unsavedFiles)
            fixed(CXTranslationUnit * pTU       = &tu)
            {
                var pCommandLineArgs = stackalloc sbyte *[commandLineArgs.Length];

                marshaledCommandLineArgs.Fill(pCommandLineArgs);
                return(clang.indexSourceFileFullArgv(this, clientData, pIndexCallbacks, (uint)indexCallbacks.Length, (uint)indexOptions, marshaledSourceFilename, pCommandLineArgs, commandLineArgs.Length, pUnsavedFiles, (uint)unsavedFiles.Length, (CXTranslationUnitImpl **)pTU, (uint)tuOptions) == 0);
            }
        }
Esempio n. 6
0
 public CXFile GetTopLevelHeader(CXTranslationUnit translationUnit, uint index) => (CXFile)clang.Module_getTopLevelHeader(translationUnit, this, index);
Esempio n. 7
0
 public uint GetNumTopLevelHeaders(CXTranslationUnit translationUnit) => clang.Module_getNumTopLevelHeaders(translationUnit, this);