2 Copyright (C) 2000-2005 SKYRIX Software AG
4 This file is part of SOPE.
6 SOPE is free software; you can redistribute it and/or modify it under
7 the terms of the GNU Lesser General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
11 SOPE is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14 License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with SOPE; see the file COPYING. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
22 #ifndef __NGExtensions_NGPropertyListParser_H__
23 #define __NGExtensions_NGPropertyListParser_H__
25 #import <Foundation/NSObject.h>
27 @class NSString, NSArray, NSDictionary, NSData;
30 The property list format is:
32 Strings: char's without specials: 'hello', but not 'hel lo'
33 or quoted string: '"hello world !"
36 or '(' element ( ',' element )* ')'
38 Dicts: '{' ( dictEntry )* '}'
39 dictEntry = property '=' property ';' ;
41 Data: '<' data '>', eg: '< AABB 88CC 77a7 11 >'
44 NSString *NGParseStringFromBuffer(const unsigned char *_buffer, unsigned _len);
45 NSArray *NGParseArrayFromBuffer(const unsigned char *_buffer, unsigned _len);
46 NSDictionary *NGParseDictionaryFromBuffer(const unsigned char *_buffer, unsigned _len);
48 NSString *NGParseStringFromData(NSData *_data);
49 NSArray *NGParseArrayFromData(NSData *_data);
50 NSDictionary *NGParseDictionaryFromData(NSData *_data);
51 NSString *NGParseStringFromString(NSString *_str);
52 NSArray *NGParseArrayFromString(NSString *_str);
53 NSDictionary *NGParseDictionaryFromString(NSString *_str);
55 id NGParsePropertyListFromBuffer(const unsigned char *_buffer, unsigned _len);
56 id NGParsePropertyListFromData(NSData *_data);
57 id NGParsePropertyListFromString(NSString *_string);
58 id NGParsePropertyListFromFile(NSString *_path);
60 NSDictionary *NGParseStringsFromBuffer(const char *_buffer, unsigned _len);
61 NSDictionary *NGParseStringsFromData(NSData *_data);
62 NSDictionary *NGParseStringsFromString(NSString *_string);
63 NSDictionary *NGParseStringsFromFile(NSString *_path);
65 #import <Foundation/NSArray.h>
66 #import <Foundation/NSDictionary.h>
68 @interface NSArray(NGPropertyListParser)
70 + (id)skyArrayWithContentsOfFile:(NSString *)_path;
71 - (id)skyInitWithContentsOfFile:(NSString *)_path;
75 @interface NSDictionary(NGPropertyListParser)
77 + (id)skyDictionaryWithContentsOfFile:(NSString *)_path;
78 - (id)skyInitWithContentsOfFile:(NSString *)_path;
82 #endif /* __NGExtensions_NGPropertyListParser_H__ */