diff options
Diffstat (limited to 'callbacks.rs')
-rw-r--r-- | callbacks.rs | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/callbacks.rs b/callbacks.rs index 5824466..c22ba97 100644 --- a/callbacks.rs +++ b/callbacks.rs @@ -99,6 +99,9 @@ pub trait ParseCallbacks: fmt::Debug { None } + /// This will be called on every header filename passed to (`Builder::header`)[`crate::Builder::header`]. + fn header_file(&self, _filename: &str) {} + /// This will be called on every file inclusion, with the full path of the included file. fn include_file(&self, _filename: &str) {} @@ -135,6 +138,27 @@ pub trait ParseCallbacks: fmt::Debug { fn process_comment(&self, _comment: &str) -> Option<String> { None } + + /// Potentially override the visibility of a composite type field. + /// + /// Caution: This allows overriding standard C++ visibility inferred by + /// `respect_cxx_access_specs`. + fn field_visibility( + &self, + _info: FieldInfo<'_>, + ) -> Option<crate::FieldVisibilityKind> { + None + } + + /// Process a function name that as exactly one `va_list` argument + /// to be wrapped as a variadic function with the wrapped static function + /// feature. + /// + /// The returned string is new function name. + #[cfg(feature = "experimental")] + fn wrap_as_variadic_fn(&self, _name: &str) -> Option<String> { + None + } } /// Relevant information about a type to which new derive attributes will be added using @@ -176,3 +200,14 @@ pub enum ItemKind { /// A Variable Var, } + +/// Relevant information about a field for which visibility can be determined using +/// [`ParseCallbacks::field_visibility`]. +#[derive(Debug)] +#[non_exhaustive] +pub struct FieldInfo<'a> { + /// The name of the type. + pub type_name: &'a str, + /// The name of the field. + pub field_name: &'a str, +} |