mirror of
https://github.com/libimobiledevice/libplist.git
synced 2026-05-17 20:30:34 +00:00
C++: Add = operator to String class
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user