There is no function to get the data, as you already have it: your ValueMap. You would need to do it the way I posted(to write out your own binary format) or use the XML parser and implement the compressing of the XML data yourself.
The ValueMap is just a std::unordered_map/std::map.
The writeToFile function is a function of FileUtils, which just uses the XML parser to write out the plist file.
Yes, I’ve seen the XML parser, but weirdly, it uses different code for android and iOS.
For iOS it uses the default iOS code (NSDictionary) and for android it uses tinyxml.
I think it would make sense to use tinyxml for both (if this is possible), so there’s one way to grab the result data.
Thanks, I’m going to look into other serialization formats that are more efficient.
It’s because the data is written as a plist. plists are native to all OS X variants, as these were invented by Apple/Next and are used for serialization of dictionary objects. They are implemented directly in the OS, so they are used on those platforms.
Android does not use plists.
That’s an argument, but would also introduce redundant code on the OS X platforms.
Cap’n Proto is one of the best solutions out there.
The above code should create (or update) a file called
filenameForMyData.plist
with a dictionary row called
keyForDictionaryData
that drops down to have two sub-items: an Int row with key “randomIntSubData” and value “0” as well as a String row with key “randomStringSubData” and value “randomStringDataValue.” You should be able to read it as a ValueMap as specified at the beginning of this answer. I know it’s late, but hope this helps you or someone else! God bless you friend.