2 Copyright (C) 2000-2004 SKYRIX Software AG
4 This file is part of OpenGroupware.org.
6 OGo 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 OGo 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 OGo; see the file COPYING. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
23 #ifndef __NGExtensions_NGPropertyListParser_H__
24 #define __NGExtensions_NGPropertyListParser_H__
26 #import <Foundation/NSObject.h>
28 @class NSString, NSArray, NSDictionary, NSData;
31 The property list format is:
33 Strings: char's without specials: 'hello', but not 'hel lo'
34 or quoted string: '"hello world !"
37 or '(' element ( ',' element )* ')'
39 Dicts: '{' ( dictEntry )* '}'
40 dictEntry = property '=' property ';' ;
42 Data: '<' data '>', eg: '< AABB 88CC 77a7 11 >'
45 NSString *NGParseStringFromBuffer(const unsigned char *_buffer, unsigned _len);
46 NSArray *NGParseArrayFromBuffer(const unsigned char *_buffer, unsigned _len);
47 NSDictionary *NGParseDictionaryFromBuffer(const unsigned char *_buffer, unsigned _len);
49 NSString *NGParseStringFromData(NSData *_data);
50 NSArray *NGParseArrayFromData(NSData *_data);
51 NSDictionary *NGParseDictionaryFromData(NSData *_data);
52 NSString *NGParseStringFromString(NSString *_str);
53 NSArray *NGParseArrayFromString(NSString *_str);
54 NSDictionary *NGParseDictionaryFromString(NSString *_str);
56 id NGParsePropertyListFromBuffer(const unsigned char *_buffer, unsigned _len);
57 id NGParsePropertyListFromData(NSData *_data);
58 id NGParsePropertyListFromString(NSString *_string);
59 id NGParsePropertyListFromFile(NSString *_path);
61 NSDictionary *NGParseStringsFromBuffer(const char *_buffer, unsigned _len);
62 NSDictionary *NGParseStringsFromData(NSData *_data);
63 NSDictionary *NGParseStringsFromString(NSString *_string);
64 NSDictionary *NGParseStringsFromFile(NSString *_path);
66 #import <Foundation/NSArray.h>
67 #import <Foundation/NSDictionary.h>
69 @interface NSArray(NGPropertyListParser)
71 + (id)skyArrayWithContentsOfFile:(NSString *)_path;
72 - (id)skyInitWithContentsOfFile:(NSString *)_path;
76 @interface NSDictionary(NGPropertyListParser)
78 + (id)skyDictionaryWithContentsOfFile:(NSString *)_path;
79 - (id)skyInitWithContentsOfFile:(NSString *)_path;
83 #endif /* __NGExtensions_NGPropertyListParser_H__ */