From ed8a73301b844bf5f7efd9cd437c9c0765a49a88 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Sun, 6 Apr 2025 11:48:14 +0200 Subject: C++: Add = operator to String class --- src/String.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') diff --git a/src/String.cpp b/src/String.cpp index 5bae804..8daec0f 100644 --- a/src/String.cpp +++ b/src/String.cpp @@ -45,6 +45,13 @@ String& String::operator=(const PList::String& s) return *this; } +String& String::operator=(const std::string& s) +{ + plist_free(_node); + _node = plist_new_string(s.c_str()); + return *this; +} + String& String::operator=(const char* s) { plist_free(_node); -- cgit v1.1-32-gdbae