views:

47

answers:

2

The question is does anyone know what the structure of the (type-2) plist files in Cappuccino are?

In Cappuccino there is a lot of use made of plist files.

Some such as info.plist (type-1) follow a recognizable structure. These are fine i can inderstand them.

<plist version="1.0">
<dict>
<key>CPApplicationDelegateClass</key>
<string>DocumentController</string>
<key>CPBundleDocumentTypes</key>
<array>
<dict> ..... etc

However others (type-2) which are used for importing data, importing the pptx files to and from the slides application and i believe in Atlas the development tool do not.

They have a structure like this

280NPLIST;1.0;D;K;4;$topD;K;23;DocumentPresentationKeyD;K;6;CP$UIDd;1;1E;E;K;8;$objectsA;S;5;$nullD;K;6;$classD;K;6;CP$UIDd;1;2E;K;23;SKPresentationSlideSizeD;K;6;CP$UIDd;1;3E;K;23;SKPresentationNotesSizeD;K;6;CP$UIDd;1;4E;K;20;SKPresentationSlidesD;K;6;CP$UIDd;1;5E;K;26;SKPresentationSlideMastersD;K;6;CP$UIDd;1;7E;K;19;SKPresentationThemeD;K;6;CP$UIDd;1;8E;E;D;K;10;$classnameS;14;

Which appears to come on a single line regardless of size (i had one today with in excess of 1.3 million chars.

Some of the structure is to do with character counting but i have had what look like valid files that fail and ones that look dubious do not.

I suspect i have just asked a Tumbleweed badge question her but as i already have one it doesn't matter.

+2  A: 

I can only guess what a Tumbleweed badge is, but let's see if we can avoid that. The file you are looking at is a '280 North format Plist', a special format of plist optimised for use in Cappuccino applications. If you want to dig into it you can use the cplutil tool and convert it to a regular XML plist.

cplutil -convert xml1 -o Info3.plist Info1.plist

Nice Panorama has more info.

Alexander Ljungberg
+2  A: 

To answer your question about the actual structure of the plist, it's somewhat similar to netstrings (http://cr.yp.to/proto/netstrings.txt). The content is the same as the XML plist, of course.

The format starts with a magic string (and a version) to identify the plist type for reading. It's then followed by constants for the few plist types (d->dictionary, k->key, etc.), the length of the item, and then the item itself. These sections are semi-colon delimited.

So if we look just at the first part of what you posted:

280NPLIST;1.0; this tells us the format, and that this is version 1.0

D; the first entry is a dictionary, which always has a key then the object

K;4;$top the first item in the dictionary is the first key, length of 4

D;K;23;DocumentPresentationKey The associated value is itself dictionary whose first key is 23 characters long

etc.

The format was designed to make it easier to read only parts of the document without needing to parse the entire plist.

Ross Boucher