summaryrefslogtreecommitdiffstats
path: root/src/Dictionary.cpp
AgeCommit message (Collapse)AuthorFilesLines
2021-06-22[clang-tidy] cpp: Replace free with deleteGravatar Rosen Penev1-2/+2
It's the C++ way. It also avoids having to check for NULL. Found with cppcoreguidelines-owning-memory Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-06-22[clang-tidy] cpp: Turn reference operators to constGravatar Rosen Penev1-1/+1
Found with cppcoreguidelines-c-copy-assignment-signature Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-06-03c++: Switch to c++ headersGravatar Rosen Penev1-1/+1
[clang-tidy]Found with hicpp-deprecated-headers Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-06-03c++: Remove redundant initializationGravatar Rosen Penev1-1/+1
[clang-tidy] Found with readability-redundant-member-init Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-06-03c++: Add closing namespace commentGravatar Rosen Penev1-1/+1
[clang-tidy] Found with google-readability-namespace-comments Signed-off-by: Rosen Penev <rosenp@gmail.com>
2019-07-07Add PList::Dictionary::const_iteratorGravatar Alexander Böhn1-0/+15
... and const versions of three member functions, each returning const_iterator: * Plist::Dictionary::Begin() * PList::Dictionary::End() * PList::Dictionary::Find()
2019-06-26Fixed bug in dictionary_fillGravatar tihmstar1-1/+1
Bug: when creating a new Dictionary object (for example through PList::Node::FromPlist(plist_t node) ), the dictionary_fill function is called from Dictionary() constructor in line 50. It seems that the intended way of calling dictionary_fill() is to pass the _map object by reference, however it is actually passed by value. Thus the changes to the map object made by dictionary_fill() are discarded when the function returns. Fix: pass _map by reference to keep the changes
2019-01-21cpp: Dictionary: Reduce code duplication with helper functionGravatar Nikias Bassen1-47/+16
2014-09-20Change Clone() to be const, which required constructors with const ↵Gravatar Aaron Burghardt1-3/+8
references and a const GetValue().
2014-03-19deprecated plist_dict_insert_item in favor of plist_dict_set_itemGravatar Nikias Bassen1-2/+7
2013-10-29fixed mavericks compile problem, return iterator of _map.end() instead of ↵Gravatar Jim Koning1-1/+1
iterator of NULL
2011-02-12Fix Dictionary copy constructorGravatar Christophe Fergeau1-1/+1
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>
2009-11-28Remove last includes of non-existing Utils.hGravatar Martin Szulecki1-1/+0
2009-11-11Fix removal of the Utils class.Gravatar Jonathan Beck1-3/+3
2009-11-10Do not free plist node twice in Dictionary destructor.Gravatar Jonathan Beck1-1/+0
2009-11-10Remove wrongly exposed SetParent method.Gravatar Jonathan Beck1-1/+1
2009-11-04Add GetNodeIdex and GetNodeKey methods.Gravatar Jonathan Beck1-0/+10
2009-10-28Format sources to ANSI style using AStyle (astyle --style=ansi).Gravatar Jonathan Beck1-39/+39
2009-10-28Fix build for MSVC9.Gravatar Jonathan Beck1-0/+1
2009-10-26Add Set/Get Parent and a helper to create a Node from a plist_t.Gravatar Jonathan Beck1-99/+7
2009-10-18Tweak Dictioonary interface a bit.Gravatar Jonathan Beck1-1/+10
2009-10-16Fix key valuation in dictionary loop.Gravatar Jonathan Beck1-1/+1
2009-10-16Fix Node lifecycle and change argument as reference to const reference.Gravatar Jonathan Beck1-7/+13
2009-10-15Fix various mistakes in C++ bindings.Gravatar Jonathan Beck1-3/+42
2009-10-13Add C++ binding.Gravatar Jonathan Beck1-0/+217