Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:36:18

0001 /*===-- clang-c/Rewrite.h - C CXRewriter   --------------------------*- C -*-===*\
0002 |*                                                                            *|
0003 |* Part of the LLVM Project, under the Apache License v2.0 with LLVM          *|
0004 |* Exceptions.                                                                *|
0005 |* See https://llvm.org/LICENSE.txt for license information.                  *|
0006 |* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception                    *|
0007 |*                                                                            *|
0008 |*===----------------------------------------------------------------------===*/
0009 
0010 #ifndef LLVM_CLANG_C_REWRITE_H
0011 #define LLVM_CLANG_C_REWRITE_H
0012 
0013 #include "clang-c/CXString.h"
0014 #include "clang-c/ExternC.h"
0015 #include "clang-c/Index.h"
0016 #include "clang-c/Platform.h"
0017 
0018 LLVM_CLANG_C_EXTERN_C_BEGIN
0019 
0020 typedef void *CXRewriter;
0021 
0022 /**
0023  * Create CXRewriter.
0024  */
0025 CINDEX_LINKAGE CXRewriter clang_CXRewriter_create(CXTranslationUnit TU);
0026 
0027 /**
0028  * Insert the specified string at the specified location in the original buffer.
0029  */
0030 CINDEX_LINKAGE void clang_CXRewriter_insertTextBefore(CXRewriter Rew, CXSourceLocation Loc,
0031                                            const char *Insert);
0032 
0033 /**
0034  * Replace the specified range of characters in the input with the specified
0035  * replacement.
0036  */
0037 CINDEX_LINKAGE void clang_CXRewriter_replaceText(CXRewriter Rew, CXSourceRange ToBeReplaced,
0038                                       const char *Replacement);
0039 
0040 /**
0041  * Remove the specified range.
0042  */
0043 CINDEX_LINKAGE void clang_CXRewriter_removeText(CXRewriter Rew, CXSourceRange ToBeRemoved);
0044 
0045 /**
0046  * Save all changed files to disk.
0047  * Returns 1 if any files were not saved successfully, returns 0 otherwise.
0048  */
0049 CINDEX_LINKAGE int clang_CXRewriter_overwriteChangedFiles(CXRewriter Rew);
0050 
0051 /**
0052  * Write out rewritten version of the main file to stdout.
0053  */
0054 CINDEX_LINKAGE void clang_CXRewriter_writeMainFileToStdOut(CXRewriter Rew);
0055 
0056 /**
0057  * Free the given CXRewriter.
0058  */
0059 CINDEX_LINKAGE void clang_CXRewriter_dispose(CXRewriter Rew);
0060 
0061 LLVM_CLANG_C_EXTERN_C_END
0062 
0063 #endif