File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ public :
3535 String (plist_t node, Node* parent = NULL );
3636 String (const String& s);
3737 String& operator =(const String& s);
38+ String& operator =(const char * s);
3839 String (const std::string& s);
3940 virtual ~String ();
4041
Original file line number Diff line number Diff line change @@ -45,6 +45,13 @@ String& String::operator=(const PList::String& s)
4545 return *this ;
4646}
4747
48+ String& String::operator =(const char * s)
49+ {
50+ plist_free (_node);
51+ _node = plist_new_string (s);
52+ return *this ;
53+ }
54+
4855String::String (const std::string& s) : Node(PLIST_STRING)
4956{
5057 plist_set_string_val (_node, s.c_str ());
@@ -69,7 +76,7 @@ std::string String::GetValue() const
6976 char * s = NULL ;
7077 plist_get_string_val (_node, &s);
7178 std::string ret = s ? s : " " ;
72- delete s ;
79+ free (( void *)s) ;
7380 return ret;
7481}
7582
You can’t perform that action at this time.
0 commit comments