• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Saving C++ based data structures
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Saving C++ based data structures


  • Subject: Re: Saving C++ based data structures
  • From: Dan Price <email@hidden>
  • Date: Wed, 7 Dec 2005 01:17:14 +0000 (GMT)

> Does the data that describes Shape need to be in
> human-readable form
> (i.e. you need to have one XML tag per attribute)?
> If not, you may
> want to consider flattening the object into a block
> of data (NSData)
> and archiving that.

Yes. The main elements must be stored as standard XML
data. Would it be possible to encode archived C data
(bytes) into a property or attribute of the same XML?
Or is either one format or the other? The parsing
efficiency of XML may prove to be a problem, but right
now I'm more interested in readability.

> I took a similar approach myself with some of my
> data. The original C
> ++ version (Carbon) stored all data in a flat binary
> file. The Cocoa
> version archives many objects which all implement
> NSCoding. But for
> some things, data residing in C structs made the
> most sense (I didn't
> need to overhead of wrapping every last thing in a
> object). Those
> structs are just archived via NSData.

Could you elaborate? I've tried encoding my data as
NSData objects but I can't get it to work.

As it is, I can save out my hierarchy completely in
serialized form, but without object data for each
node. I haven't figured out yet how to save
hierarchical structures to XML (flat lists of objects
are quite easy though), but I'll get there.



___________________________________________________________
To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: Saving C++ based data structures (From: Ricky Sharp <email@hidden>)

  • Prev by Date: Re: NSTokenFieldCell and Interface Builder (IB 2.5.3)
  • Next by Date: Can NSNotification and NSRunLoop live together?
  • Previous by thread: Re: Saving C++ based data structures
  • Next by thread: Re: Saving C++ based data structures
  • Index(es):
    • Date
    • Thread