From d5f396d789fe9b70201caa18d5e88a9e4f82e9b7 Mon Sep 17 00:00:00 2001 From: matcool <26722564+matcool@users.noreply.github.com> Date: Mon, 8 Jul 2024 23:12:06 -0300 Subject: [PATCH] start work on templated member functions --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- src/builder/namespace.rs | 4 ++-- src/builder/shared.rs | 5 +++++ src/builder/traits.rs | 2 +- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5db2284..5ab8571 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -290,9 +290,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clang" -version = "1.0.3" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34c6913be3a1c94f52fb975cdec7ef5a7b69de10a55de66dcbc30d7046b85fa1" +checksum = "84c044c781163c001b913cd018fc95a628c50d0d2dfea8bca77dad71edb16e37" dependencies = [ "clang-sys", "libc", diff --git a/Cargo.toml b/Cargo.toml index ca75d59..2dc00ca 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" diff --git a/src/builder/namespace.rs b/src/builder/namespace.rs index c5aef70..6c0f1df 100644 --- a/src/builder/namespace.rs +++ b/src/builder/namespace.rs @@ -23,8 +23,8 @@ impl CppItemKind { pub fn from<'e>(entity: &Entity<'e>) -> Option { 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, } diff --git a/src/builder/shared.rs b/src/builder/shared.rs index c4a5d82..f9768a0 100644 --- a/src/builder/shared.rs +++ b/src/builder/shared.rs @@ -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)) diff --git a/src/builder/traits.rs b/src/builder/traits.rs index 44c3b83..f92aa38 100644 --- a/src/builder/traits.rs +++ b/src/builder/traits.rs @@ -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(),