summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Fitzgerald <fitzgen@gmail.com>2016-11-07 14:09:40 -0800
committerNick Fitzgerald <fitzgen@gmail.com>2016-11-07 14:09:40 -0800
commit4d45f83d1ed0c768795080cd0af87f5d06089da0 (patch)
treed6fbba357e1c47a355175b34eca4040cc178ca47
parentcc82b839b164f38513dcdcc93a63d654c82ca80c (diff)
Add `clang::Type::is_valid`
A helper for checking if the type's kind is not `CXType_Invalid`.
-rwxr-xr-xsrc/clang.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/clang.rs b/src/clang.rs
index a11e2924..b250e548 100755
--- a/src/clang.rs
+++ b/src/clang.rs
@@ -715,6 +715,11 @@ impl Type {
}
}
}
+
+ /// Is this a valid type?
+ pub fn is_valid(&self) -> bool {
+ self.kind() != CXType_Invalid
+ }
}
/// An iterator for a type's template arguments.