2004-11-13 01:55:00 +00:00
|
|
|
#ifndef __ruamoko_PropertyList_h
|
|
|
|
#define __ruamoko_PropertyList_h
|
|
|
|
|
2020-03-03 06:24:41 +00:00
|
|
|
#include <plist.h>
|
|
|
|
#include <Object.h>
|
2004-11-13 01:55:00 +00:00
|
|
|
|
2020-07-05 05:38:44 +00:00
|
|
|
@class PLItem;
|
|
|
|
|
|
|
|
@protocol PLDictionary
|
|
|
|
- (int) count;
|
|
|
|
- (int) numKeys;
|
|
|
|
- (PLItem *) getObjectForKey:(string) key;
|
|
|
|
- (PLItem *) allKeys;
|
|
|
|
- addKey:(string) key value:(PLItem *) value;
|
|
|
|
@end
|
|
|
|
|
|
|
|
@protocol PLArray
|
|
|
|
- (int) count;
|
|
|
|
- (int) numObjects;
|
|
|
|
- (PLItem *) getObjectAtIndex:(int) index;
|
|
|
|
- addObject:(PLItem *) object;
|
|
|
|
- insertObject:(PLItem *) object atIndex:(int) index;
|
|
|
|
@end
|
|
|
|
|
|
|
|
@protocol PLString
|
|
|
|
- (string) string;
|
|
|
|
@end
|
|
|
|
|
|
|
|
@interface PLItem: Object <PLDictionary, PLArray, PLString>
|
2004-11-13 01:55:00 +00:00
|
|
|
{
|
|
|
|
plitem_t item;
|
2011-03-25 07:46:32 +00:00
|
|
|
int own;
|
2004-11-13 01:55:00 +00:00
|
|
|
}
|
2011-02-13 12:25:36 +00:00
|
|
|
+ (PLItem *) newDictionary;
|
|
|
|
+ (PLItem *) newArray;
|
2011-03-25 07:46:32 +00:00
|
|
|
+ (PLItem *) newData:(void*) data size:(int) len;
|
2011-02-13 12:25:36 +00:00
|
|
|
+ (PLItem *) newString:(string) str;
|
|
|
|
+ (PLItem *) fromString:(string) str;
|
|
|
|
+ (PLItem *) fromFile:(QFile) file;
|
2004-11-13 01:55:00 +00:00
|
|
|
|
2006-12-02 06:51:41 +00:00
|
|
|
- initWithItem:(plitem_t) item;
|
|
|
|
- initWithOwnItem:(plitem_t) item;
|
2004-11-13 01:55:00 +00:00
|
|
|
- (string) write;
|
|
|
|
- (pltype_t) type;
|
2020-12-23 12:52:42 +00:00
|
|
|
- (int) line;
|
2004-11-13 01:55:00 +00:00
|
|
|
@end
|
|
|
|
|
2020-07-05 05:38:44 +00:00
|
|
|
@interface PLDictionary: PLItem <PLDictionary>
|
2011-02-13 12:25:36 +00:00
|
|
|
+ (PLDictionary *) new;
|
2004-11-13 01:55:00 +00:00
|
|
|
@end
|
|
|
|
|
2020-07-05 05:38:44 +00:00
|
|
|
@interface PLArray: PLItem <PLArray>
|
2011-02-13 12:25:36 +00:00
|
|
|
+ (PLArray *) new;
|
2004-11-13 01:55:00 +00:00
|
|
|
@end
|
|
|
|
|
|
|
|
@interface PLData: PLItem
|
2011-03-25 07:46:32 +00:00
|
|
|
+ (PLData *) new:(void*) data size:(int) len;
|
2004-11-13 01:55:00 +00:00
|
|
|
@end
|
|
|
|
|
2020-07-05 05:38:44 +00:00
|
|
|
@interface PLString: PLItem <PLString>
|
2011-02-13 12:25:36 +00:00
|
|
|
+ (PLString *) new:(string) str;
|
2004-11-13 01:55:00 +00:00
|
|
|
@end
|
|
|
|
|
|
|
|
#endif//__ruamoko_PropertyList_h
|