Skip to content

Commit

Permalink
start work on templated member functions
Browse files Browse the repository at this point in the history
  • Loading branch information
matcool committed Jul 9, 2024
1 parent ada0ea1 commit d5f396d
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ keywords = ["documentation"]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
clang = "1.0.2"
clang = { version = "2.0.0", features = ["clang_10_0"] }
clap = { version = "4.0.29", features = ["derive"] }
glob = "0.3.0"
indicatif = "0.17.2"
Expand Down
4 changes: 2 additions & 2 deletions src/builder/namespace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ impl CppItemKind {
pub fn from<'e>(entity: &Entity<'e>) -> Option<Self> {
match entity.get_kind() {
EntityKind::StructDecl => Some(Self::Struct),
EntityKind::ClassDecl | EntityKind::ClassTemplate => Some(Self::Class),
EntityKind::FunctionDecl => Some(Self::Function),
EntityKind::ClassDecl | EntityKind::ClassTemplate | EntityKind::ClassTemplatePartialSpecialization => Some(Self::Class),
EntityKind::FunctionDecl | EntityKind::FunctionTemplate => Some(Self::Function),
EntityKind::Namespace => Some(Self::Namespace),
_ => None,
}
Expand Down
5 changes: 5 additions & 0 deletions src/builder/shared.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,11 @@ pub fn fmt_field(field: &Entity, builder: &Builder) -> Html {
}

pub fn fmt_fun_decl(fun: &Entity, builder: &Builder) -> Html {
if fun.get_name().is_some_and(|x| x.contains("add")) {
dbg!(&fun);
dbg!(fun.get_arguments());
dbg!(fun.get_template_arguments());
}
HtmlElement::new("details")
.with_class("entity-desc")
.with_attr_opt("id", member_fun_link(fun))
Expand Down
2 changes: 1 addition & 1 deletion src/builder/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ pub fn get_member_functions<'e>(
.get_children()
.into_iter()
.filter(|child| {
child.get_kind() == EntityKind::Method
(child.get_kind() == EntityKind::Method || child.get_kind() == EntityKind::FunctionTemplate)
&& match include_statics {
Include::Members => !child.is_static_method(),
Include::Statics => child.is_static_method(),
Expand Down

0 comments on commit d5f396d

Please sign in to comment.