在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:mirek/YAML.framework开源软件地址:https://github.com/mirek/YAML.framework开源编程语言:HTML 48.3%开源软件介绍:YAML.framework for Objective-CBased on C
It's fast and compatible with iOS. Example usageNSInputStream *stream = [[NSInputStream alloc] initWithFileAtPath: @"yaml/items.yaml"];
// or [[NSInputStream alloc] initWithURL: ...]
// You can use objectsWithYAMLStream:options:error instead to get all YAML documents.
//
// Alternativelly object(s)WithYAMLData:options:error or object(s)WithYAMLString:options:error.
id yaml = [YAMLSerialization objectWithYAMLStream: stream
options: kYAMLReadOptionStringScalars
error: nil];
// Dump Objective-C object description.
printf("%s", [[yaml description] UTF8String]); For input YAML file: items:
- name: Foo
- name: Bar Should print dump string similar to:
APIThe following class methods are defined on Reading YAML// Returns all document objects from parsed YAML stream.
+ (NSMutableArray *) objectsWithYAMLStream: (NSInputStream *) stream
options: (YAMLReadOptions) opt
error: (NSError **) error;
// Returns all document objects from parsed YAML data.
+ (NSMutableArray *) objectsWithYAMLData: (NSData *) data
options: (YAMLReadOptions) opt
error: (NSError **) error;
// Returns all document objects from parsed YAML string.
+ (NSMutableArray *) objectsWithYAMLString: (NSString *) string
options: (YAMLReadOptions) opt
error: (NSError **) error;
// Returns first object from parsed YAML stream.
+ (id) objectWithYAMLStream: (NSInputStream *) stream
options: (YAMLReadOptions) opt
error: (NSError **) error;
// Returns first object from parsed YAML data.
+ (id) objectWithYAMLData: (NSData *) data
options: (YAMLReadOptions) opt
error: (NSError **) error;
// Returns first object from parsed YAML string.
+ (id) objectWithYAMLString: (NSString *) string
options: (YAMLReadOptions) opt
error: (NSError **) error; Writing YAML// Returns YES on success, NO otherwise.
+ (BOOL) writeObject: (id) object
toYAMLStream: (NSOutputStream *) stream
options: (YAMLWriteOptions) opt
error: (NSError **) error;
// Caller is responsible for releasing returned object.
+ (NSData *) createYAMLDataWithObject: (id) object
options: (YAMLWriteOptions) opt
error: (NSError **) error NS_RETURNS_RETAINED;
// Returns autoreleased object.
+ (NSData *) YAMLDataWithObject: (id) object
options: (YAMLWriteOptions) opt
error: (NSError **) error;
// Caller is responsible for releasing returned object.
+ (NSString *) createYAMLStringWithObject: (id) object
options: (YAMLWriteOptions) opt
error: (NSError **) error NS_RETURNS_RETAINED;
// Returns autoreleased object.
+ (NSString *) YAMLStringWithObject: (id) object
options: (YAMLWriteOptions) opt
error: (NSError **) error; License
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论