-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathXMLObject.h
58 lines (46 loc) · 2.4 KB
/
XMLObject.h
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
46
47
48
49
50
51
52
53
54
55
56
57
58
//
// XMLObject.h
//
// Created by Petr Syrov on 15/11/13.
// Copyright (c) 2013 Petr Syrov. All rights reserved.
//
#import <Foundation/Foundation.h>
/**
@description
XMLObject class synchronously creates a structure, that can be used in dictionary-like and array-like styles.
*/
@interface XMLObject : NSObject <NSXMLParserDelegate>
@property (readonly, weak, nonatomic) NSArray *allTags;
@property (readonly, weak, nonatomic) NSString *xml;
@property (readonly, weak, nonatomic) NSString *string;
- (NSString *)description;
+ (id)xmlObjectWithData:(NSData *)data error:(NSError **)error;
+ (id)xmlObjectWithXMLObject:(XMLObject *)xmlObject;
+ (id)xmlObjectWithXMLObjects:(NSArray *)xmlObjects value:(NSString *)value attributes:(NSDictionary *)attributes forKey:(NSString *)key;
+ (id)xmlObjectWithValue:(NSString *)value attributes:(NSDictionary *)attributes forKey:(NSString *)key;
+ (id)xmlObjectWithAttributes:(NSDictionary *)attributes forKey:(NSString *)key;
+ (id)xmlObjectForKey:(NSString *)key;
- (XMLObject *)objectForKey:(NSString *)key;
- (XMLObject *)objectForKeys:(NSArray *)keys;
- (XMLObject *)objectForKey:(NSString *)key atIndex:(NSInteger)index;
- (XMLObject *)objectAtIndex:(NSInteger)index;
- (NSString *)valueForKey:(NSString *)key;
- (NSString *)valueForKeys:(NSArray *)keys;
- (NSString *)valueForKey:(NSString *)key atIndex:(NSInteger)index;
- (NSString *)valueAtIndex:(NSInteger)index;
- (NSDictionary *)attributesForKey:(NSString *)key;
- (NSDictionary *)attributesForKeys:(NSArray *)keys;
- (NSDictionary *)attributesForKey:(NSString *)key atIndex:(NSInteger)index;
- (NSDictionary *)attributesAtIndex:(NSInteger)index;
- (NSInteger)countForKey:(NSString *)key;
- (void)setAttributes:(NSDictionary *)attributes forKey:(NSString *)key atIndex:(NSInteger)index;
- (void)setAttributes:(NSDictionary *)attributes forKey:(NSString *)key;
- (void)setValue:(NSString *)value forKey:(NSString *)key atIndex:(NSInteger)index;
- (void)setValue:(NSString *)value forKey:(NSString *)key;
- (void)setObject:(XMLObject *)xmlObject forKey:(NSString *)key atIndex:(NSInteger)index;
- (void)setObject:(XMLObject *)xmlObject forKey:(NSString *)key;
- (void)addObject:(XMLObject *)xmlObject forKey:(NSString *)key atIndex:(NSInteger)index;
- (void)addObject:(XMLObject *)xmlObject forKey:(NSString *)key;
- (void)removeObjectForKey:(NSString *)key atIndex:(NSInteger)index;
- (void)removeObjectForKey:(NSString *)key;
@end