How can I 'pickle' my datalists

Hello,

Those of you who are familiar with Python might be knowing the 'Pickle' function. With this lists can be quikly stored in a file and can be retrieved later. Even lists(arrays) of objects can be stored. Very convenient indeed!

1
2
3
4
5
import pickle
fileHandle = open ( 'pickleFile.txt', 'w' )
testList = [ 'This', 2, 'is', 1, 'a', 0, 'test.' ]
pickle.dump ( testList, fileHandle )
fileHandle.close() 



I was wondering if there is any similar function/facility in C++. I have an array of Class objects, which I would love to store in a txt file and later retrieve with just a simple library function like Pickle. (My Class objects also have some STL Vector elements!)

Thanks.
Any other suggestion please? This boost asks for 2GB space on my hard-disk, and I cant use it everywhere (I have to use different computers at Workplace, on which I dont have admin rights).
Topic archived. No new replies allowed.