@@ -17,13 +17,13 @@ #include #include #include -#import "OFEmbeddedURIHandler.h" +#import "OFEmbeddedIRIHandler.h" +#import "OFIRI.h" #import "OFMemoryStream.h" -#import "OFURI.h" #import "OFInvalidArgumentException.h" #import "OFOpenItemFailedException.h" #ifdef OF_HAVE_THREADS @@ -69,26 +69,26 @@ #ifdef OF_HAVE_THREADS OFEnsure(OFPlainMutexUnlock(&mutex) == 0); #endif } -@implementation OFEmbeddedURIHandler -- (OFStream *)openItemAtURI: (OFURI *)URI mode: (OFString *)mode +@implementation OFEmbeddedIRIHandler +- (OFStream *)openItemAtIRI: (OFIRI *)IRI mode: (OFString *)mode { OFString *path; - if (![URI.scheme isEqual: @"embedded"] || URI.host.length > 0 || - URI.port != nil || URI.user != nil || URI.password != nil || - URI.query != nil || URI.fragment != nil) + if (![IRI.scheme isEqual: @"embedded"] || IRI.host.length > 0 || + IRI.port != nil || IRI.user != nil || IRI.password != nil || + IRI.query != nil || IRI.fragment != nil) @throw [OFInvalidArgumentException exception]; if (![mode isEqual: @"r"]) - @throw [OFOpenItemFailedException exceptionWithURI: URI + @throw [OFOpenItemFailedException exceptionWithIRI: IRI mode: mode errNo: EROFS]; - if ((path = URI.path) == nil) { + if ((path = IRI.path) == nil) { @throw [OFInvalidArgumentException exception]; } #ifdef OF_HAVE_THREADS OFEnsure(OFPlainMutexLock(&mutex) == 0); @@ -108,10 +108,10 @@ } @finally { OFEnsure(OFPlainMutexUnlock(&mutex) == 0); } #endif - @throw [OFOpenItemFailedException exceptionWithURI: URI + @throw [OFOpenItemFailedException exceptionWithIRI: IRI mode: mode errNo: ENOENT]; } @end