HashMap serialization/deserialization

Hello, guys, can you help me?
I have a singleton class which should load and save HashMap. I can’t get how to do it. As far as I understood, I should use Serializer and Deserializer, but I can’t get how.
Can you give me some example of saving/loading HashMap from file?

Take a look at Deserializer::ReadVariantMap() and Serializer::WriteVariantMap(). The format is up to you, but typically you would write the number of elements first, then iterate the map and write each key and value.

Thanks. And one more question. How to set output file where I would write my data?

The class File inherits from Deserializer & Serializer.

So you’d do something like:

File file(GetContext());
file.Open("MyFileName", FILE_WRITE);

file.WriteUInt(hashMap.Size());
...