0

Hello I need to load NSKeyedArchiver classes to C++/CLI counterparts. Is there any way to get internal format of NSKeyedArchiver?
Another option is to rewrite whole saving and opening code into pure C++ for both Mac and Windows.

Thanks a lot.

skaffman
  • 398,947
  • 96
  • 818
  • 769
Filip Kunc
  • 631
  • 1
  • 8
  • 19

2 Answers2

1

So your constraints seem to be:

  1. Something easy to parse on both Windows and Mac.
  2. 3D modeling data, so the format needs to be efficient

If you want something quick and dirty, go with a binary plist (and possibly gzip it). You could also try Google's protocol buffers but I have no experience with that. There are also a couple open source implementations of Foundation out there -- Cocotron might be most useful for you.

Peter Hosey
  • 95,783
  • 15
  • 211
  • 370
Colin Barrett
  • 4,451
  • 1
  • 26
  • 33
  • I think I will write some quick and dirty custom format in pure C++, using standard ofstream/ifstream in STL. Cocotron looks interesting, if the implementation of format is same with Apple. But I think that reading Cocotron inner workings takes more time than simple ofstream/ifstream C++ implementation for both platforms. Thanks for ideas. – Filip Kunc Dec 21 '09 at 06:31
  • I'm about 75% sure it would be the same thing, as I believe NSKeyedArchiver is used in nib files. – Colin Barrett Dec 26 '09 at 09:12
0

If you're not serializing anything Objective-C specific then just use XML property lists.

Azeem.Butt
  • 5,855
  • 1
  • 26
  • 22
  • Problem is that I am serializing modeling data in 3d app, it will be extremely huge in XML. So best will be some binary form. I can write serialization in pure C++, but I wrote code using NSKeyedArchiver and if the internal format is not hard I can write similar class for C# or C++/CLI. Thanks for fast answer. – Filip Kunc Dec 20 '09 at 21:53
  • Then there's really not any reason for you to use Apple's format for your data. – Azeem.Butt Dec 20 '09 at 22:04
  • @Azeem.Butt I kinda have the same as he has, and there is a reason, firstly my app was mac only so I used Apple's format now after 3 years I want to pass it to windows. If i want to drop Apple's format I will be in trouble for backward mac compatibility... So maybe I should try with Cocotron :-/ – Coldsteel48 Jun 30 '15 at 09:23