-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathNSDictionary+JSONDeepMutable.h
More file actions
45 lines (39 loc) · 1.78 KB
/
Copy pathNSDictionary+JSONDeepMutable.h
File metadata and controls
45 lines (39 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//
// NSDictionary+JSONDeepMutable.h
// JSONTools
//
// Copyright (C) 2014 Gregory Combs [gcombs at gmail]
// See LICENSE.txt for details.
@import Foundation;
@interface NSDictionary (JSONDeepMutable)
/**
* Recurses into the receiver's contents and makes a (mutable) copy of each value it encounters.
* Throws an exception if any interior value objects aren't copyable in some way. This method
* prefers NSMutableCopying over NSCopying whenever possible.
*
* @return A deeply mutable copy of the receiver's contents.
*/
- (NSMutableDictionary *)copyAsDeeplyMutableJSON;
/**
* Recurses into the receiver's contents and makes a (mutable) copy of each value it encounters.
* Throws an exception if any interior value objects aren't copyable in some way. This method
* prefers NSMutableCopying over NSCopying whenever possible.
*
* @param throwsExceptions Conditionally throw exceptions if an interior object isn't mutable or copyable,
* otherwise it merely omits that object from the new collection.
*
* @return A deeply mutable copy of the receiver's contents.
*/
- (NSMutableDictionary *)copyAsDeeplyMutableJSONWithExceptions:(BOOL)throwsExceptions;
/**
* Recurses into the receiver's contents and makes an immutable copy of each value it encounters.
* Throws an exception if any interior value objects aren't copyable in some way. This method
* ensures there are no mutable objects in the copy.
*
* @param throwsExceptions Conditionally throw exceptions if an interior object isn't mutable or copyable,
* otherwise it merely omits that object from the new collection.
*
* @return A deeply immutable copy of the receiver's contents.
*/
- (NSDictionary *)copyAsDeeplyImmutableJSONWithExceptions:(BOOL)throwsExceptions;
@end