mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 00:11:26 +00:00
Performance improvments.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@4209 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
8b1836589b
commit
07e6ebd772
5 changed files with 719 additions and 516 deletions
|
@ -27,6 +27,10 @@
|
|||
#include <base/preface.h>
|
||||
#include <Foundation/NSString.h>
|
||||
#include <Foundation/NSCoder.h>
|
||||
#include <Foundation/NSArray.h>
|
||||
#include <Foundation/NSData.h>
|
||||
#include <Foundation/NSDictionary.h>
|
||||
#include <Foundation/NSCharacterSet.h>
|
||||
#include <base/NSGString.h>
|
||||
#include <base/NSGCString.h>
|
||||
#include <base/IndexedCollection.h>
|
||||
|
@ -37,6 +41,12 @@
|
|||
#include <base/Unicode.h>
|
||||
#include <base/fast.x>
|
||||
|
||||
/*
|
||||
* Include property-list parsing code configured for ascii characters.
|
||||
*/
|
||||
#define GSPLUNI 0
|
||||
#include "propList.h"
|
||||
|
||||
static SEL csInitSel = @selector(initWithCStringNoCopy:length:fromZone:);
|
||||
static SEL msInitSel = @selector(initWithCapacity:);
|
||||
static IMP csInitImp; /* designated initialiser for cString */
|
||||
|
@ -591,6 +601,54 @@ static IMP msInitImp; /* designated initialiser for mutable */
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (id) propertyList
|
||||
{
|
||||
id result;
|
||||
pldata data;
|
||||
|
||||
data.ptr = _contents_chars;
|
||||
data.pos = 0;
|
||||
data.end = _count;
|
||||
data.lin = 1;
|
||||
data.err = nil;
|
||||
|
||||
if (plInit == 0)
|
||||
setupPl([NSGCString class]);
|
||||
|
||||
result = parsePlItem(&data);
|
||||
|
||||
if (result == nil && data.err != nil)
|
||||
{
|
||||
[NSException raise: NSGenericException
|
||||
format: @"%@ at line %u", data.err, data.lin];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
- (NSDictionary*) propertyListFromStringsFileFormat
|
||||
{
|
||||
id result;
|
||||
pldata data;
|
||||
|
||||
data.ptr = _contents_chars;
|
||||
data.pos = 0;
|
||||
data.end = _count;
|
||||
data.lin = 1;
|
||||
data.err = nil;
|
||||
|
||||
if (plInit == 0)
|
||||
setupPl([NSGCString class]);
|
||||
|
||||
result = parseSfItem(&data);
|
||||
if (result == nil && data.err != nil)
|
||||
{
|
||||
[NSException raise: NSGenericException
|
||||
format: @"%@ at line %u", data.err, data.lin];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue