Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add rewriter API #191

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1453,6 +1453,8 @@ opaque!(CXRemapping);
#[cfg(feature = "clang_5_0")]
opaque!(CXTargetInfo);
opaque!(CXTranslationUnit);
#[cfg(feature = "clang_12_0")]
opaque!(CXRewriter);

// Transparent ___________________________________

Expand Down Expand Up @@ -2394,6 +2396,27 @@ link! {
pub fn clang_toggleCrashRecovery(recovery: c_uint);
pub fn clang_tokenize(tu: CXTranslationUnit, range: CXSourceRange, tokens: *mut *mut CXToken, n_tokens: *mut c_uint);
pub fn clang_visitChildren(cursor: CXCursor, visitor: CXCursorVisitor, data: CXClientData) -> c_uint;
/// Only available on `libclang` 12.0 and later.
#[cfg(feature = "clang_12_0")]
pub fn clang_CXRewriter_create(tu: CXTranslationUnit) -> CXRewriter;
/// Only available on `libclang` 12.0 and later.
#[cfg(feature = "clang_12_0")]
pub fn clang_CXRewriter_insertTextBefore(rew: CXRewriter, loc: CXSourceLocation, insert: *const c_char);
/// Only available on `libclang` 12.0 and later.
#[cfg(feature = "clang_12_0")]
pub fn clang_CXRewriter_replaceText(rew: CXRewriter, to_be_replaced: CXSourceRange, replacement: *const c_char);
/// Only available on `libclang` 12.0 and later.
#[cfg(feature = "clang_12_0")]
pub fn clang_CXRewriter_removeText(rew: CXRewriter, to_be_removed: CXSourceRange);
/// Only available on `libclang` 12.0 and later.
#[cfg(feature = "clang_12_0")]
pub fn clang_CXRewriter_overwriteChangedFiles(rew: CXRewriter) -> c_int;
/// Only available on `libclang` 12.0 and later.
#[cfg(feature = "clang_12_0")]
pub fn clang_CXRewriter_writeMainFileToStdOut(rew: CXRewriter);
/// Only available on `libclang` 12.0 and later.
#[cfg(feature = "clang_12_0")]
pub fn clang_CXRewriter_dispose(rew: CXRewriter);

// Documentation
pub fn clang_BlockCommandComment_getArgText(comment: CXComment, index: c_uint) -> CXString;
Expand Down