PageRenderTime 12ms CodeModel.GetById 9ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/AppKit/Cib/_CPCibKeyedUnarchiver.j

http://github.com/cacaodev/cappuccino
Unknown | 78 lines | 64 code | 14 blank | 0 comment | 0 complexity | 59bb03fc41eb308236973a5a88f4d452 MD5 | raw file
 1/*
 2 * _CPCibKeyedUnarchiver.j
 3 * AppKit
 4 *
 5 * Created by Francisco Tolmasky.
 6 * Copyright 2008, 280 North, Inc.
 7 *
 8 * This library is free software; you can redistribute it and/or
 9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 */
22
23@import <Foundation/CPKeyedUnarchiver.j>
24
25
26@implementation _CPCibKeyedUnarchiver : CPKeyedUnarchiver
27{
28    CPBundle        _bundle;
29    BOOL            _awakenCustomResources;
30    CPDictionary    _externalObjectsForProxyIdentifiers;
31}
32
33- (id)initForReadingWithData:(CPData)data bundle:(CPBundle)aBundle awakenCustomResources:(BOOL)shouldAwakenCustomResources
34{
35    self = [super initForReadingWithData:data];
36
37    if (self)
38    {
39        _bundle = aBundle;
40        _awakenCustomResources = shouldAwakenCustomResources;
41
42        [self setDelegate:self];
43    }
44
45    return self;
46}
47
48- (CPBundle)bundle
49{
50    return _bundle;
51}
52
53- (BOOL)awakenCustomResources
54{
55    return _awakenCustomResources;
56}
57
58- (void)setExternalObjectsForProxyIdentifiers:(CPDictionary)externalObjectsForProxyIdentifiers
59{
60    _externalObjectsForProxyIdentifiers = externalObjectsForProxyIdentifiers;
61}
62
63- (id)externalObjectForProxyIdentifier:(CPString)anIdentifier
64{
65    return [_externalObjectsForProxyIdentifiers objectForKey:anIdentifier];
66}
67
68- (void)replaceObjectAtUID:(int)aUID withObject:(id)anObject
69{
70    _objects[aUID] = anObject;
71}
72
73- (id)objectAtUID:(int)aUID
74{
75    return _objects[aUID];
76}
77
78@end