public CXCodeCompleteResults *CodeCompleteAt(string completeFilename, uint completeLine, uint completeColumn, ReadOnlySpan <CXUnsavedFile> unsavedFiles, CXCodeComplete_Flags options)
        {
            using var marshaledCompleteFilename = new MarshaledString(completeFilename);

            fixed(CXUnsavedFile *pUnsavedFiles = unsavedFiles)
            {
                return(clang.codeCompleteAt(this, marshaledCompleteFilename, completeLine, completeColumn, pUnsavedFiles, (uint)unsavedFiles.Length, (uint)options));
            }
        }
        public static CXErrorCode Create(CXIndex index, string astFileName, out CXTranslationUnit translationUnit)
        {
            using var marshaledAstFileName = new MarshaledString(astFileName);

            fixed(CXTranslationUnit *pTranslationUnit = &translationUnit)
            {
                return(clang.createTranslationUnit2(index, marshaledAstFileName, (CXTranslationUnitImpl **)pTranslationUnit));
            }
        }
Esempio n. 3
0
        public static CXCompilationDatabase FromDirectory(string buildDir, out CXCompilationDatabase_Error errorCode)
        {
            using var marshaledBuildDir = new MarshaledString(buildDir);

            fixed(CXCompilationDatabase_Error *pErrorCode = &errorCode)
            {
                return((CXCompilationDatabase)clang.CompilationDatabase_fromDirectory(marshaledBuildDir, pErrorCode));
            }
        }
Esempio n. 4
0
        public static CXDiagnosticSet Load(string file, out CXLoadDiag_Error error, out CXString errorString)
        {
            using var marshaledFile = new MarshaledString(file);

            fixed(CXLoadDiag_Error *pError = &error)
            fixed(CXString * pErrorString = &errorString)
            {
                return((CXDiagnosticSet)clang.loadDiagnostics(marshaledFile, pError, pErrorString));
            }
        }
        public static CXTranslationUnit Parse(CXIndex index, string sourceFileName, ReadOnlySpan <string> commandLineArgs, ReadOnlySpan <CXUnsavedFile> unsavedFiles, CXTranslationUnit_Flags options)
        {
            using var marshaledSourceFileName  = new MarshaledString(sourceFileName);
            using var marshaledCommandLineArgs = new MarshaledStringArray(commandLineArgs);

            fixed(CXUnsavedFile *pUnsavedFiles = unsavedFiles)
            {
                var pCommandLineArgs = stackalloc sbyte *[commandLineArgs.Length];

                marshaledCommandLineArgs.Fill(pCommandLineArgs);
                return(clang.parseTranslationUnit(index, marshaledSourceFileName, pCommandLineArgs, commandLineArgs.Length, pUnsavedFiles, (uint)unsavedFiles.Length, (uint)options));
            }
        }
Esempio n. 6
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. 7
0
        public MarshaledStringArray(ReadOnlySpan <string> inputs)
        {
            if (inputs.Length == 0)
            {
                _values = null;
            }
            else
            {
                _values = new MarshaledString[inputs.Length];

                for (var i = 0; i < inputs.Length; i++)
                {
                    _values[i] = new MarshaledString(inputs[i]);
                }
            }
        }
Esempio n. 8
0
 public static CXString ConstructUsr_ObjCProperty(string property, CXString classUsr)
 {
     using var marshaledProperty = new MarshaledString(property);
     return(clang.constructUSR_ObjCProperty(marshaledProperty, classUsr));
 }
        public CXErrorCode SetFrameworkModuleName(string name)
        {
            var marshaledName = new MarshaledString(name);

            return(clang.ModuleMapDescriptor_setFrameworkModuleName(this, marshaledName));
        }
Esempio n. 10
0
 public CXCompileCommands GetCompileCommands(string completeFileName)
 {
     using var marshaledCompleteFileName = new MarshaledString(completeFileName);
     return((CXCompileCommands)clang.CompilationDatabase_getCompileCommands(this, marshaledCompleteFileName));
 }
 public CXSaveError Save(string fileName, CXSaveTranslationUnit_Flags options)
 {
     using var marshaledFileName = new MarshaledString(fileName);
     return((CXSaveError)clang.saveTranslationUnit(this, marshaledFileName, (uint)options));
 }
 public static CXTranslationUnit Create(CXIndex index, string astFileName)
 {
     using var marshaledAstFileName = new MarshaledString(astFileName);
     return(clang.createTranslationUnit(index, marshaledAstFileName));
 }
Esempio n. 13
0
 public CXErrorCode SetUmbrellaHeader(string name)
 {
     using var marshaledName = new MarshaledString(name);
     return(clang.ModuleMapDescriptor_setUmbrellaHeader(this, marshaledName));
 }
 public CXFile GetFile(string fileName)
 {
     using var marshaledFileName = new MarshaledString(fileName);
     return(GetFile(marshaledFileName.AsSpan()));
 }
Esempio n. 15
0
 public long GetOffsetOf(string s)
 {
     using var marshaledS = new MarshaledString(s);
     return(clang.Type_getOffsetOf(this, marshaledS));
 }
Esempio n. 16
0
 public CXErrorCode AddFileMapping(string virtualPath, string realPath)
 {
     using var marshaledVirtualPath = new MarshaledString(virtualPath);
     using var marshaledRealPath    = new MarshaledString(realPath);
     return(clang.VirtualFileOverlay_addFileMapping(this, marshaledVirtualPath, marshaledRealPath));
 }
Esempio n. 17
0
 public static CXRemapping GetRemappings(string path)
 {
     using var marshaledPath = new MarshaledString(path);
     return((CXRemapping)clang.getRemappings(marshaledPath));
 }
Esempio n. 18
0
 public static CXString ConstructUsr_ObjCCategory(string className, string categoryName)
 {
     using var marshaledClassName    = new MarshaledString(className);
     using var marshaledCategoryName = new MarshaledString(categoryName);
     return(clang.constructUSR_ObjCCategory(marshaledClassName, marshaledCategoryName));
 }
Esempio n. 19
0
 public static CXString ConstructUsr_ObjCMethod(string name, bool isInstanceMethod, CXString classUsr)
 {
     using var marshaledName = new MarshaledString(name);
     return(clang.constructUSR_ObjCMethod(marshaledName, isInstanceMethod ? 1u : 0u, classUsr));
 }
Esempio n. 20
0
 public static CXString ConstructUsr_ObjCIvar(string name, CXString classUsr)
 {
     using var marshaledName = new MarshaledString(name);
     return(clang.constructUSR_ObjCIvar(marshaledName, classUsr));
 }
Esempio n. 21
0
 public static CXString ConstructUsr_ObjCProtocol(string protocolName)
 {
     using var marshaledProtocolName = new MarshaledString(protocolName);
     return(clang.constructUSR_ObjCProtocol(marshaledProtocolName));
 }
Esempio n. 22
0
 public static CXString ConstructUsr_ObjCClass(string className)
 {
     using var marshaledClassName = new MarshaledString(className);
     return(clang.constructUSR_ObjCClass(marshaledClassName));
 }
Esempio n. 23
0
 public void SetInvocationEmissionPathOption(string Path)
 {
     using var marshaledPath = new MarshaledString(Path);
     clang.CXIndex_setInvocationEmissionPathOption(this, marshaledPath);
 }