The following test case unexpectedly stops with an
exception:
include
include <plist/plist++.h>
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">
<key>Key</key>
<string>Hello</string>
<key>Another Key</key>
<string>Hi!</string>
terminate called after throwing an instance of
'std::logic_error'
what(): basic_string::_S_construct NULL not valid
*/