From 05c952f0207fa40d5dc315933bd8fd34dd0cdd1c Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Wed, 6 Mar 2024 12:42:27 +0100 Subject: WIP lock/propertyupdate implementation --- src/dav/xml.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/dav/xml.rs') diff --git a/src/dav/xml.rs b/src/dav/xml.rs index 1cce86a..bf02721 100644 --- a/src/dav/xml.rs +++ b/src/dav/xml.rs @@ -129,5 +129,23 @@ impl Reader { } self.next().await } + + pub async fn tag_string(&mut self) -> Result { + let mut acc = String::new(); + loop { + match self.peek() { + Event::CData(unescaped) => { + acc.push_str(std::str::from_utf8(unescaped.as_ref())?); + self.next().await? + }, + Event::Text(escaped) => { + acc.push_str(escaped.unescape()?.as_ref()); + self.next().await? + } + Event::End(_) | Event::Start(_) | Event::Empty(_) => return Ok(acc), + _ => self.next().await?, + }; + } + } } -- cgit v1.2.3