Comment to show native access

This commit is contained in:
Mitchell Hashimoto
2022-10-28 10:02:32 -07:00
parent 71042b6f1b
commit 1e5c17dffa
2 changed files with 55 additions and 0 deletions

View File

@@ -9,6 +9,14 @@ pub const Property = extern struct {
pub fn getName(self: Property) [:0]const u8 {
return std.mem.sliceTo(c.property_getName(self.value), 0);
}
/// Returns the value of a property attribute given the attribute name.
pub fn copyAttributeValue(self: Property, attr: [:0]const u8) ?[:0]u8 {
return std.mem.sliceTo(
c.property_copyAttributeValue(self.value, attr.ptr) orelse return null,
0,
);
}
};
test {