/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. @import <Foundation/CPKeyedUnarchiver.j>
  23. @implementation _CPCibKeyedUnarchiver : CPKeyedUnarchiver
  24. {
  25. CPBundle _bundle;
  26. BOOL _awakenCustomResources;
  27. CPDictionary _externalObjectsForProxyIdentifiers;
  28. }
  29. - (id)initForReadingWithData:(CPData)data bundle:(CPBundle)aBundle awakenCustomResources:(BOOL)shouldAwakenCustomResources
  30. {
  31. self = [super initForReadingWithData:data];
  32. if (self)
  33. {
  34. _bundle = aBundle;
  35. _awakenCustomResources = shouldAwakenCustomResources;
  36. [self setDelegate:self];
  37. }
  38. return self;
  39. }
  40. - (CPBundle)bundle
  41. {
  42. return _bundle;
  43. }
  44. - (BOOL)awakenCustomResources
  45. {
  46. return _awakenCustomResources;
  47. }
  48. - (void)setExternalObjectsForProxyIdentifiers:(CPDictionary)externalObjectsForProxyIdentifiers
  49. {
  50. _externalObjectsForProxyIdentifiers = externalObjectsForProxyIdentifiers;
  51. }
  52. - (id)externalObjectForProxyIdentifier:(CPString)anIdentifier
  53. {
  54. return [_externalObjectsForProxyIdentifiers objectForKey:anIdentifier];
  55. }
  56. - (void)replaceObjectAtUID:(int)aUID withObject:(id)anObject
  57. {
  58. _objects[aUID] = anObject;
  59. }
  60. - (id)objectAtUID:(int)aUID
  61. {
  62. return _objects[aUID];
  63. }
  64. @end