forked from mirek/YAML.framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
YAMLSerialization.h
58 lines (47 loc) · 1.68 KB
/
YAMLSerialization.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
//
// YAMLSerialization.h
// YAML Serialization support by Mirek Rusin based on C library LibYAML by Kirill Simonov
// Released under MIT License
//
// Copyright 2010 Mirek Rusin
// Copyright 2010 Stanislav Yudin
//
#import <Foundation/Foundation.h>
#import "yaml.h"
// Mimics NSPropertyListMutabilityOptions
typedef enum {
kYAMLReadOptionImmutable = 0x0000000000000001,
kYAMLReadOptionMutableContainers = 0x0000000000000010,
kYAMLReadOptionMutableContainersAndLeaves = 0x0000000000000110,
kYAMLReadOptionStringScalars = 0x0000000000001000
} YAMLReadOptions;
typedef enum {
kYAMLErrorNoErrors,
kYAMLErrorCodeParserInitializationFailed,
kYAMLErrorCodeParseError,
kYAMLErrorCodeEmitterError,
kYAMLErrorInvalidOptions,
kYAMLErrorCodeOutOfMemory,
kYAMLErrorInvalidYamlObject,
} YAMLErrorCode;
typedef enum {
kYAMLWriteOptionSingleDocument = 0x0000000000000001,
kYAMLWriteOptionMultipleDocuments = 0x0000000000000010,
} YAMLWriteOptions;
extern NSString *const YAMLErrorDomain;
@interface YAMLSerialization : NSObject {
}
+ (void) writeYAML: (id) yaml
toStream: (NSOutputStream *) stream
options: (YAMLWriteOptions) opt
error: (NSError **) error;
+ (NSData *) dataFromYAML: (id) yaml
options: (YAMLWriteOptions) opt
error: (NSError **) error;
+ (NSMutableArray *) YAMLWithStream: (NSInputStream *) stream
options: (YAMLReadOptions) opt
error: (NSError **) error;
+ (NSMutableArray *) YAMLWithData: (NSData *) data
options: (YAMLReadOptions) opt
error: (NSError **) error;
@end