~ubuntu-branches/ubuntu/karmic/gnustep-base/karmic

« back to all changes in this revision

Viewing changes to Headers/gnustep/base/NSSerialization.h

  • Committer: Bazaar Package Importer
  • Author(s): Eric Heintzmann
  • Date: 2005-04-17 00:14:38 UTC
  • mfrom: (1.2.1 upstream) (2.1.2 hoary)
  • Revision ID: james.westby@ubuntu.com-20050417001438-enf0y07c9tku85z1
Tags: 1.10.3-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Protocol for NSSerialization for GNUStep
2
 
   Copyright (C) 1995 Free Software Foundation, Inc.
3
 
 
4
 
   Written by:  Andrew Kachites McCallum <mccallum@gnu.ai.mit.edu>
5
 
   Date: 1995
6
 
   Updated by:  Richard Frith-Macdonald <richard@brainstorm.co.uk>
7
 
   Date: 1998
8
 
   
9
 
   This file is part of the GNUstep Base Library.
10
 
 
11
 
   This library is free software; you can redistribute it and/or
12
 
   modify it under the terms of the GNU Library General Public
13
 
   License as published by the Free Software Foundation; either
14
 
   version 2 of the License, or (at your option) any later version.
15
 
   
16
 
   This library is distributed in the hope that it will be useful,
17
 
   but WITHOUT ANY WARRANTY; without even the implied warranty of
18
 
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19
 
   Library General Public License for more details.
20
 
   
21
 
   You should have received a copy of the GNU Library General Public
22
 
   License along with this library; if not, write to the Free
23
 
   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
24
 
   */ 
25
 
 
26
 
#ifndef __NSSerialization_h_GNUSTEP_BASE_INCLUDE
27
 
#define __NSSerialization_h_GNUSTEP_BASE_INCLUDE
28
 
 
29
 
#include <Foundation/NSObject.h>
30
 
 
31
 
@class NSData, NSMutableData;
32
 
 
33
 
@protocol NSObjCTypeSerializationCallBack
34
 
- (void) deserializeObjectAt: (id*)object
35
 
                  ofObjCType: (const char *)type
36
 
                    fromData: (NSData*)data
37
 
                    atCursor: (unsigned*)cursor;
38
 
- (void) serializeObjectAt: (id*)object
39
 
                ofObjCType: (const char *)type
40
 
                  intoData: (NSMutableData*)data;
41
 
@end
42
 
 
43
 
@interface NSSerializer: NSObject
44
 
+ (NSData*) serializePropertyList: (id)propertyList;
45
 
+ (void) serializePropertyList: (id)propertyList
46
 
                      intoData: (NSMutableData*)d;
47
 
@end
48
 
 
49
 
#ifndef NO_GNUSTEP
50
 
/*
51
 
 *      GNUstep extends serialization by having the option to make the
52
 
 *      resulting data more compact by ensuring that repeated strings
53
 
 *      are only stored once.  If the property-list has a lot of repeated
54
 
 *      strings in it, this will be both faster and more space efficient
55
 
 *      but it will be slower if the property-list has few repeated
56
 
 *      strings.  The default is NOT to generate compact versions of the data.
57
 
 *
58
 
 *      The [+shouldBeCompact:] method sets default behavior.
59
 
 *      The [+serializePropertyList:intoData:compact:] method lets you
60
 
 *      override the default behavior.
61
 
 */
62
 
@interface NSSerializer (GNUstep)
63
 
+ (void) shouldBeCompact: (BOOL)flag;
64
 
+ (void) serializePropertyList: (id)propertyList
65
 
                      intoData: (NSMutableData*)d
66
 
                       compact: (BOOL)flag;
67
 
@end
68
 
#endif
69
 
 
70
 
@interface NSDeserializer: NSObject
71
 
+ (id) deserializePropertyListFromData: (NSData*)data
72
 
                              atCursor: (unsigned int*)cursor
73
 
                     mutableContainers: (BOOL)flag;
74
 
+ (id) deserializePropertyListFromData: (NSData*)data
75
 
                     mutableContainers: (BOOL)flag;
76
 
+ (id) deserializePropertyListLazilyFromData: (NSData*)data
77
 
                                    atCursor: (unsigned*)cursor
78
 
                                      length: (unsigned)length
79
 
                           mutableContainers: (BOOL)flag;
80
 
 
81
 
@end
82
 
 
83
 
#ifndef NO_GNUSTEP
84
 
/*
85
 
 *      GNUstep extends deserialization by having the option to make the
86
 
 *      resulting data more compact by ensuring that repeated strings
87
 
 *      are only stored once.  If the property-list has a lot of repeated
88
 
 *      strings in it, this will be more space efficient but it will be
89
 
 *      slower (though other parts of your code may speed up through more
90
 
 *      efficient equality testing of uniqued strings).
91
 
 *      The default is NOT to deserialize uniqued strings.
92
 
 *
93
 
 *      The [+uniquing:] method turns uniquing on/off.
94
 
 *      Uniquing is done using a global NSCountedSet - see NSCountedSet for
95
 
 *      details.
96
 
 */
97
 
@class  NSMutableSet;
98
 
@interface NSDeserializer (GNUstep)
99
 
+ (void) uniquing: (BOOL)flag;
100
 
@end
101
 
 
102
 
#endif
103
 
 
104
 
#endif /* __NSSerialization_h_GNUSTEP_BASE_INCLUDE */