From a91f5740d100414a76959714b819422ee5b2d8a8 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Sun, 14 Apr 2024 18:19:14 +0200 Subject: Change API around #PLIST_DATA to use uint8_t instead of char arrays This makes it more obvious that it is arbitrary data and not necessarily a string value. --- src/Data.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/Data.cpp') diff --git a/src/Data.cpp b/src/Data.cpp index a96fc50..c4709f7 100644 --- a/src/Data.cpp +++ b/src/Data.cpp @@ -34,7 +34,7 @@ Data::Data(plist_t node, Node* parent) : Node(node, parent) Data::Data(const PList::Data& d) : Node(PLIST_DATA) { - std::vector b = d.GetValue(); + std::vector b = d.GetValue(); plist_set_data_val(_node, &b[0], b.size()); } @@ -45,7 +45,7 @@ Data& Data::operator=(const PList::Data& b) return *this; } -Data::Data(const std::vector& buff) : Node(PLIST_DATA) +Data::Data(const std::vector& buff) : Node(PLIST_DATA) { plist_set_data_val(_node, &buff[0], buff.size()); } @@ -59,17 +59,17 @@ Node* Data::Clone() const return new Data(*this); } -void Data::SetValue(const std::vector& buff) +void Data::SetValue(const std::vector& buff) { plist_set_data_val(_node, &buff[0], buff.size()); } -std::vector Data::GetValue() const +std::vector Data::GetValue() const { - char* buff = NULL; + uint8_t* buff = NULL; uint64_t length = 0; plist_get_data_val(_node, &buff, &length); - std::vector ret(buff, buff + length); + std::vector ret(buff, buff + length); delete buff; return ret; } -- cgit v1.1-32-gdbae