discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RFC: Appreciation of .gmodel format (was deprecation)


From: Stefan Urbanek
Subject: Re: RFC: Appreciation of .gmodel format (was deprecation)
Date: Tue, 06 Jan 2004 19:54:58 +0100

On 2004-01-06 17:47:30 +0100 Alexander Malmberg <alexander@malmberg.org> wrote:

Gregory John Casamento wrote:
--- Georg Fleischmann <georg@vhf.de> wrote:

<snip>

Writing a subclass of NSData (or, more appropriately, NSCoder) that
encodes as text is fairly easy, but also pointless. The resulting text
would be no more readable than the output of 'hexdump foo.gorm'. Eg. for
NSView, we have:

...
  [aCoder encodeRect: _frame];
  [aCoder encodeRect: _bounds];
  [aCoder encodeValueOfObjCType: @encode(BOOL) at:
&_is_rotated_from_base];
  [aCoder encodeValueOfObjCType: @encode(BOOL)
                             at: &_is_rotated_or_scaled_from_base];
  [aCoder encodeValueOfObjCType: @encode(BOOL) at:
&_post_frame_changes];
  [aCoder encodeValueOfObjCType: @encode(BOOL) at:
&_autoresizes_subviews];
  [aCoder encodeValueOfObjCType: @encode(unsigned int) at:
&_autoresizingMask];
...

so instead of a bit of binary data, you'd get something like "0.0 0.0
100.0 100.0 0.0 0.0 100.0 100.0 0 0 0 1 5" .... Sure, it's text, but
you'd go insane if you tried to edit it by hand. :)

I believe what Georg Fleischmann wants isn't just a text format, it's a
structured, human readable text format.


What about NSKeyedArchiver and NSKeyedUnarchiver? Are there any plans to 
imlpement those classes in GNUstep? They can definitely help in creating 
readable object dumps (using textual versions of those archivers).

Cocoa reference:
http://developer.apple.com/documentation/Cocoa/Reference/Foundation/ObjC_classic/Classes/NSKeyedArchiver.html#//apple_ref/occ/cl/NSKeyedArchiver

Btw. Apple docs about archiving are using keyed archiver as an example.

Stefan Urbanek
--
http://stefan.agentfarms.net

First they ignore you, then they laugh at you, then they fight you, then you 
win.
- Mahatma Gandhi






reply via email to

[Prev in Thread] Current Thread [Next in Thread]