diff options
author | Quentin Dufour <quentin@deuxfleurs.fr> | 2024-03-06 12:42:27 +0100 |
---|---|---|
committer | Quentin Dufour <quentin@deuxfleurs.fr> | 2024-03-06 12:42:27 +0100 |
commit | 05c952f0207fa40d5dc315933bd8fd34dd0cdd1c (patch) | |
tree | a9d265024a3843945298ea46cbfbdf5603a9418f /src/dav/xml.rs | |
parent | ba32a0d4a6810e4bf9d18f14086597c20212bbcb (diff) | |
download | aerogramme-05c952f0207fa40d5dc315933bd8fd34dd0cdd1c.tar.gz aerogramme-05c952f0207fa40d5dc315933bd8fd34dd0cdd1c.zip |
WIP lock/propertyupdate implementation
Diffstat (limited to 'src/dav/xml.rs')
-rw-r--r-- | src/dav/xml.rs | 18 |
1 files changed, 18 insertions, 0 deletions
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<T: IRead> Reader<T> { } self.next().await } + + pub async fn tag_string(&mut self) -> Result<String, ParsingError> { + 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?, + }; + } + } } |