text: add wholeText getter

Signed-off-by: Francis Bouvier <francis.bouvier@gmail.com>
This commit is contained in:
Francis Bouvier
2023-10-09 16:06:14 +02:00
parent 8c3712c697
commit de8f586223
3 changed files with 42 additions and 0 deletions

View File

@@ -503,6 +503,16 @@ pub fn characterDataSubstringData(cdata: *CharacterData, offset: u32, count: u32
// Text
pub const Text = c.dom_text;
fn textVtable(text: *Text) c.dom_text_vtable {
return getVtable(c.dom_text_vtable, Text, text);
}
pub fn textWholdeText(text: *Text) []const u8 {
var s: ?*String = undefined;
_ = textVtable(text).dom_text_get_whole_text.?(text, &s);
return stringToData(s.?);
}
// Comment
pub const Comment = c.dom_comment;