summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar guyingzhao2025-02-28 00:17:57 +0800
committerGravatar Nikias Bassen2025-03-01 23:42:06 +0100
commitd40f03e4090edafea75f04a1697ef0384231d333 (patch)
treee3915131a791b3ce5669ee7938ff4eb4f2c5bbba /src
parent02be84957d44ce68dcf81bada0d3250d4d81395a (diff)
downloadlibplist-d40f03e4090edafea75f04a1697ef0384231d333.tar.gz
libplist-d40f03e4090edafea75f04a1697ef0384231d333.tar.bz2
C++: Add more convenience functions to the interface
Diffstat (limited to 'src')
-rw-r--r--src/Structure.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/Structure.cpp b/src/Structure.cpp
index 670cce6..b33de96 100644
--- a/src/Structure.cpp
+++ b/src/Structure.cpp
@@ -77,7 +77,7 @@ void Structure::UpdateNodeParent(Node* node)
if ( NULL != node->_parent )
{
plist_type type = plist_get_node_type(node->_parent);
- if (PLIST_ARRAY ==type || PLIST_DICT == type )
+ if (PLIST_ARRAY == type || PLIST_DICT == type)
{
Structure* s = static_cast<Structure*>(node->_parent);
s->Remove(node);
@@ -117,8 +117,14 @@ Structure* Structure::FromBin(const std::vector<char>& bin)
plist_from_bin(&bin[0], bin.size(), &root);
return ImportStruct(root);
+}
+
+Structure* Structure::FromBin(const char* bin, uint64_t size)
+{
+ plist_t root = NULL;
+ plist_from_bin(bin, size, &root);
+ return ImportStruct(root);
}
} // namespace PList
-