Serialization?
Pointers are great until it comes to needing to write the data that they point to to a file, especially when some of that data that they point to happens to be more pointers and more pointers within that, etc.
NSData performs a shallow write. I need to do a deep write. I can see that I could write a method that will write primitive data and then tell the pointers to write until there are no more pointers, however...
The problem with that is, NSData has no way to open a file and leave it open for appending, that I could tell. I got to looking at CFData functions and my head started to spin. Not sure if that's the right way to go or not.
I could just use an fstream but then I'd have to change most of my files to .mm...
Any advice as to what's the standard way of writing ALL of the data in a class to file? Thanks again!!!
NSData performs a shallow write. I need to do a deep write. I can see that I could write a method that will write primitive data and then tell the pointers to write until there are no more pointers, however...
The problem with that is, NSData has no way to open a file and leave it open for appending, that I could tell. I got to looking at CFData functions and my head started to spin. Not sure if that's the right way to go or not.
I could just use an fstream but then I'd have to change most of my files to .mm...
Any advice as to what's the standard way of writing ALL of the data in a class to file? Thanks again!!!
| Messages In This Thread |
|
Serialization? - bmantzey - Sep 16, 2009 02:49 PM
Serialization? - SethWillits - Sep 16, 2009, 02:52 PM
Serialization? - bmantzey - Sep 16, 2009, 03:05 PM
Serialization? - ThemsAllTook - Sep 16, 2009, 04:16 PM
Serialization? - Mark Levin - Sep 21, 2009, 12:19 PM
Serialization? - bmantzey - Sep 23, 2009, 11:43 AM
Serialization? - ThemsAllTook - Sep 23, 2009, 01:15 PM
Serialization? - bmantzey - Sep 23, 2009, 09:10 PM
|

