diff options
-rw-r--r-- | include/plist/String.h | 1 | ||||
-rw-r--r-- | src/String.cpp | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/include/plist/String.h b/include/plist/String.h index 7e8a6e4..95f8dd1 100644 --- a/include/plist/String.h +++ b/include/plist/String.h @@ -35,6 +35,7 @@ public : String(plist_t node, Node* parent = NULL); String(const String& s); String& operator=(const String& s); + String& operator=(const std::string& s); String& operator=(const char* s); String(const std::string& s); String(const char *s); 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); |