mirror of
https://gitee.com/openharmony/third_party_rust_cxx
synced 2024-11-27 01:11:38 +00:00
Add option to emit C++ comments as ///
This commit is contained in:
parent
c16f037b8a
commit
a628611897
@ -59,6 +59,7 @@ pub struct Opt {
|
||||
pub(super) gen_implementation: bool,
|
||||
pub(super) allow_dot_includes: bool,
|
||||
pub(super) cfg_evaluator: Box<dyn CfgEvaluator>,
|
||||
pub(super) doxygen: bool,
|
||||
}
|
||||
|
||||
pub(super) trait CfgEvaluator {
|
||||
@ -89,6 +90,7 @@ impl Default for Opt {
|
||||
gen_implementation: true,
|
||||
allow_dot_includes: true,
|
||||
cfg_evaluator: Box::new(UnsupportedCfgEvaluator),
|
||||
doxygen: false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -229,7 +229,11 @@ fn pick_includes_and_builtins(out: &mut OutFile, apis: &[Api]) {
|
||||
|
||||
fn write_doc(out: &mut OutFile, indent: &str, doc: &Doc) {
|
||||
for line in doc.to_string().lines() {
|
||||
writeln!(out, "{}//{}", indent, line);
|
||||
if out.opt.doxygen {
|
||||
writeln!(out, "{}///{}", indent, line);
|
||||
} else {
|
||||
writeln!(out, "{}//{}", indent, line);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user