[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Bug in NSScanner ?
From: |
Manuel Guesdon |
Subject: |
Bug in NSScanner ? |
Date: |
Wed, 19 Feb 2003 10:51:00 +0100 (CET) |
Hi,
I can't understand why this fail
NSString* str=@"( 1.3.6.1.4.1.4980.1.3.3 NAME 'oxyInetDomain' DESC 'Oxymium
Inet Domain' SUP oxyTop AUXILIARY MUST dc MAY ( admContact $ admincontact $
billingContact $ cn $ domainCreationDate $ labeledURL $ mailRelayedBy $
managerEMail $ nic $ nichandle $ registrant $ soa $ techContact $
domaindescription $ oxymiumReferenceDisplay $ associatedServices $
associatedrootentity $ associatedmanagemententity $ associatedrootcompany $
associatedmanagemententityrights $ associatedrootentityrights $
associatedrootcompanyrights $ parkmessage $ logoURL ) )";
NSScanner *aScanner = [NSScanner scannerWithString:str];
if (0) // If 1, it works !
{
BOOL upTo1=[aScanner scanUpToString:@"MUST "
intoString:NULL];
NSLog(@"upTo1=%d",upTo1);
if (upTo1)
{
BOOL scan1=[aScanner scanString:@"MUST "
intoString:NULL];
NSLog(@"scan1=%d",scan1);
if (scan1)
{
NSString* must=nil;
[aScanner scanUpToString:@" "
intoString:&must];
}
};
};
NSLog(@"scanLocation=%u",[aScanner scanLocation]);
NSLog(@"scan=[%@]",[[aScanner string] substringFromIndex:[aScanner
scanLocation]]);
BOOL upTo2=[aScanner scanUpToString:@"MAY "
intoString:NULL];
NSLog(@"upTo2=%d",upTo2);
if (upTo2)
{
BOOL scan2=[aScanner scanString:@"MAY "
intoString:NULL];
NSLog(@"scan2=%d",scan2);
};
I try to scan str for differents components. If I scan directly up to MAY, it
works. If I scan for must and next scan
for may, it doesn't works.
May be my code is wrong but I can't see why :-)
Manuel
--
______________________________________________________________________
Manuel Guesdon - ORANGE CONCEPT <mguesdon@orange-concept.com>
14 rue Jean-Baptiste Clement - 93200 Saint-Denis - France
Tel: +33 1 4940 0997 - Fax: +33 1 4940 0998
- Bug in NSScanner ?,
Manuel Guesdon <=