mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-04-08 02:12:17 +00:00
[ruamoko] Add wrappers for the new plist functions
With both file and string versions (as per PL_GetPropertyList).
This commit is contained in:
parent
ea77df2daa
commit
8f87407133
4 changed files with 43 additions and 6 deletions
|
@ -49,10 +49,14 @@
|
|||
|
||||
@interface PLDictionary: PLItem <PLDictionary>
|
||||
+ (PLDictionary *) new;
|
||||
+ (PLItem *) fromString:(string) str;
|
||||
+ (PLItem *) fromFile:(QFile) file;
|
||||
@end
|
||||
|
||||
@interface PLArray: PLItem <PLArray>
|
||||
+ (PLArray *) new;
|
||||
+ (PLItem *) fromString:(string) str;
|
||||
+ (PLItem *) fromFile:(QFile) file;
|
||||
@end
|
||||
|
||||
@interface PLData: PLItem
|
||||
|
|
|
@ -8,6 +8,10 @@ typedef enum {QFDictionary, QFArray, QFBinary, QFString} pltype_t; // possible t
|
|||
|
||||
@extern plitem_t *PL_GetFromFile (QFile file);
|
||||
@extern plitem_t *PL_GetPropertyList (string str);
|
||||
@extern plitem_t *PL_GetDictionaryFromFile (QFile file);
|
||||
@extern plitem_t *PL_GetDictionary (string str);
|
||||
@extern plitem_t *PL_GetArrayFromFile (QFile file);
|
||||
@extern plitem_t *PL_GetArray (string str);
|
||||
@extern string PL_WritePropertyList (plitem_t *pl);
|
||||
@extern pltype_t PL_Type (plitem_t *str);
|
||||
@extern int PL_Line (plitem_t *str);
|
||||
|
|
|
@ -49,18 +49,23 @@
|
|||
return [[class alloc] initWithItem: item];
|
||||
}
|
||||
|
||||
+ (PLItem *) ownItemClass:(plitem_t *) item
|
||||
{
|
||||
PLItem *plitem = [PLItem itemClass:item];
|
||||
if (plitem) {
|
||||
plitem.own = 1;
|
||||
}
|
||||
return plitem;
|
||||
}
|
||||
|
||||
+ (PLItem *) fromString:(string) str
|
||||
{
|
||||
PLItem *item = [[PLItem itemClass: PL_GetPropertyList (str)] autorelease];
|
||||
item.own = 1;
|
||||
return item;
|
||||
return [[PLItem ownItemClass: PL_GetPropertyList (str)] autorelease];
|
||||
}
|
||||
|
||||
+ (PLItem *) fromFile:(QFile) file
|
||||
{
|
||||
PLItem *item = [[PLItem itemClass: PL_GetFromFile (file)] autorelease];
|
||||
item.own = 1;
|
||||
return item;
|
||||
return [[PLItem ownItemClass: PL_GetFromFile (file)] autorelease];
|
||||
}
|
||||
|
||||
- initWithItem:(plitem_t *) item
|
||||
|
@ -198,6 +203,16 @@
|
|||
return [[PLDictionary alloc] initWithOwnItem: PL_NewDictionary ()];
|
||||
}
|
||||
|
||||
+ (PLItem *) fromString:(string) str
|
||||
{
|
||||
return [[PLItem ownItemClass: PL_GetDictionary (str)] autorelease];
|
||||
}
|
||||
|
||||
+ (PLItem *) fromFile:(QFile) file
|
||||
{
|
||||
return [[PLItem ownItemClass: PL_GetDictionaryFromFile (file)] autorelease];
|
||||
}
|
||||
|
||||
- (int) count
|
||||
{
|
||||
return PL_D_NumKeys (item);
|
||||
|
@ -241,6 +256,16 @@
|
|||
return [[PLArray alloc] initWithOwnItem: PL_NewArray ()];
|
||||
}
|
||||
|
||||
+ (PLItem *) fromString:(string) str
|
||||
{
|
||||
return [[PLItem ownItemClass: PL_GetArray (str)] autorelease];
|
||||
}
|
||||
|
||||
+ (PLItem *) fromFile:(QFile) file
|
||||
{
|
||||
return [[PLItem ownItemClass: PL_GetArrayFromFile (file)] autorelease];
|
||||
}
|
||||
|
||||
- (int) count
|
||||
{
|
||||
return PL_A_NumObjects (item);
|
||||
|
|
|
@ -2,6 +2,10 @@
|
|||
|
||||
plitem_t *PL_GetFromFile (QFile file) = #0;
|
||||
plitem_t *PL_GetPropertyList (string str) = #0;
|
||||
plitem_t *PL_GetDictionaryFromFile (QFile file) = #0;
|
||||
plitem_t *PL_GetDictionary (string str) = #0;
|
||||
plitem_t *PL_GetArrayFromFile (QFile file) = #0;
|
||||
plitem_t *PL_GetArray (string str) = #0;
|
||||
string PL_WritePropertyList (plitem_t *pl) = #0;
|
||||
pltype_t PL_Type (plitem_t *str) = #0;
|
||||
int PL_Line (plitem_t *str) = #0;
|
||||
|
|
Loading…
Reference in a new issue