Commit Graph

17 Commits

Author SHA1 Message Date
Aaron Burghardt ccd6f05fe1 Change Clone() to be const, which required constructors with const references and a const GetValue(). 2014-09-20 00:10:46 +02:00
Nikias Bassen 6b719ecda2 deprecated plist_dict_insert_item in favor of plist_dict_set_item 2014-03-19 02:32:57 +01:00
Jim Koning c56c8103f5 fixed mavericks compile problem, return iterator of _map.end() instead of iterator of NULL 2013-10-29 10:23:15 -07:00
Christophe Fergeau be225ca1b6 Fix Dictionary copy constructor
While iterating over all the keys stored in the source Dictionary
to copy them to create the copied Dictonary, the name of the key
being copied was only set to a non-NULL value for the first key
we copy. This was then leading to an assertion when trying to
create a std::string from a NULL pointer. Simple test-case:

int main()
{
	PList::Dictionary a;
	PList::String b("Hello");
	PList::String c("Hi!");
	PList::Dictionary d;

	a.Insert("Key", &b);
	a.Insert("Another Key", &c);
	std::cout << a.ToXml() << std::endl;

	d.Insert("dictionary", &a); //CRAAAAAAAAASH!
	std::cout << d.ToXml() << std::endl;
	return 0;
}
/* Output:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Key</key>
	<string>Hello</string>
	<key>Another Key</key>
	<string>Hi!</string>
</dict>
</plist>

terminate called after throwing an instance of 'std::logic_error'
  what():  basic_string::_S_construct NULL not valid
*/

Signed-off-by: Martin Szulecki <opensuse@sukimashita.com>
2011-02-12 14:17:47 +01:00
Martin Szulecki 834d7d7f27 Remove last includes of non-existing Utils.h 2009-11-28 13:37:40 +01:00
Jonathan Beck e91836fb31 Fix removal of the Utils class. 2009-11-11 21:40:26 +01:00
Jonathan Beck 35b287d0d9 Do not free plist node twice in Dictionary destructor. 2009-11-10 21:13:21 +01:00
Jonathan Beck 0f92ed12ff Remove wrongly exposed SetParent method. 2009-11-10 18:30:43 +01:00
Jonathan Beck 84596548e5 Add GetNodeIdex and GetNodeKey methods. 2009-11-04 20:21:54 +01:00
Jonathan Beck 6710f4bfb9 Format sources to ANSI style using AStyle (astyle --style=ansi). 2009-10-28 18:31:34 +01:00
Jonathan Beck 1bc333972b Fix build for MSVC9. 2009-10-28 17:57:52 +01:00
Jonathan Beck c1363bea10 Add Set/Get Parent and a helper to create a Node from a plist_t. 2009-10-26 18:41:15 +01:00
Jonathan Beck c17b420a7f Tweak Dictioonary interface a bit. 2009-10-18 21:54:33 +02:00
Jonathan Beck 7372d12b5a Fix key valuation in dictionary loop. 2009-10-16 23:33:39 +02:00
Jonathan Beck 32be8ec384 Fix Node lifecycle and change argument as reference to const reference. 2009-10-16 22:26:13 +02:00
Jonathan Beck 8186a9d371 Fix various mistakes in C++ bindings. 2009-10-15 19:28:30 +02:00
Jonathan Beck a922b714c9 Add C++ binding. 2009-10-13 20:04:06 +02:00