Index: src/OFExceptions.h ================================================================== --- src/OFExceptions.h +++ src/OFExceptions.h @@ -500,51 +500,51 @@ /** * \brief An exception indicating that renaming a file failed. */ @interface OFRenameFileFailedException: OFException { - OFString *from; - OFString *to; + OFString *src; + OFString *dst; int err; } /** * \param class_ The class of the object which caused the exception - * \param from The original path - * \param to The new path + * \param src The original path + * \param dst The new path * \return A new rename file failed exception */ -+ newWithClass: (Class)class_ - from: (OFString*)from - to: (OFString*)to; ++ newWithClass: (Class)class_ + sourcePath: (OFString*)src + destinationPath: (OFString*)dst; /** * Initializes an already allocated rename failed exception. * * \param class_ The class of the object which caused the exception - * \param from The original path - * \param to The new path + * \param src The original path + * \param dst The new path * \return An initialized rename file failed exception */ -- initWithClass: (Class)class_ - from: (OFString*)from - to: (OFString*)to; +- initWithClass: (Class)class_ + sourcePath: (OFString*)src + destinationPath: (OFString*)dst; /** * \return The errno from when the exception was created */ - (int)errNo; /** * \return The original path */ -- (OFString*)from; +- (OFString*)sourcePath; /** * \return The new path */ -- (OFString*)to; +- (OFString*)destinationPath; @end /** * \brief An exception indicating that deleting a file failed. */ @@ -598,40 +598,40 @@ * \param class_ The class of the object which caused the exception * \param src The source for the link * \param dest The destination for the link * \return A new link failed exception */ -+ newWithClass: (Class)class_ - source: (OFString*)src - destination: (OFString*)dest; ++ newWithClass: (Class)class_ + sourcePath: (OFString*)src + destinationPath: (OFString*)dest; /** * Initializes an already allocated link failed exception. * * \param class_ The class of the object which caused the exception * \param src The source for the link * \param dest The destination for the link * \return An initialized link failed exception */ -- initWithClass: (Class)class_ - source: (OFString*)src - destination: (OFString*)dest; +- initWithClass: (Class)class_ + sourcePath: (OFString*)src + destinationPath: (OFString*)dest; /** * \return The errno from when the exception was created */ - (int)errNo; /** * \return A string with the source for the link */ -- (OFString*)source; +- (OFString*)sourcePath; /** * \return A string with the destination for the link */ -- (OFString*)destination; +- (OFString*)destinationPath; @end /** * \brief An exception indicating that creating a symlink failed. */ @@ -646,40 +646,40 @@ * \param class_ The class of the object which caused the exception * \param src The source for the symlink * \param dest The destination for the symlink * \return A new symlink failed exception */ -+ newWithClass: (Class)class_ - source: (OFString*)src - destination: (OFString*)dest; ++ newWithClass: (Class)class_ + sourcePath: (OFString*)src + destinationPath: (OFString*)dest; /** * Initializes an already allocated symlink failed exception. * * \param class_ The class of the object which caused the exception * \param src The source for the symlink * \param dest The destination for the symlink * \return An initialized symlink failed exception */ -- initWithClass: (Class)class_ - source: (OFString*)src - destination: (OFString*)dest; +- initWithClass: (Class)class_ + sourcePath: (OFString*)src + destinationPath: (OFString*)dest; /** * \return The errno from when the exception was created */ - (int)errNo; /** * \return A string with the source for the symlink */ -- (OFString*)source; +- (OFString*)sourcePath; /** * \return A string with the destination for the symlink */ -- (OFString*)destination; +- (OFString*)destinationPath; @end #endif /** * \brief An exception indicating that setting an option failed. Index: src/OFExceptions.m ================================================================== --- src/OFExceptions.m +++ src/OFExceptions.m @@ -709,42 +709,42 @@ } @end #endif @implementation OFRenameFileFailedException -+ newWithClass: (Class)class__ - from: (OFString*)from_ - to: (OFString*)to_ ++ newWithClass: (Class)class__ + sourcePath: (OFString*)src_ + destinationPath: (OFString*)dst_ { return [[self alloc] initWithClass: class__ - from: from_ - to: to_]; + sourcePath: src_ + destinationPath: dst_]; } - initWithClass: (Class)class__ { @throw [OFNotImplementedException newWithClass: isa selector: _cmd]; } -- initWithClass: (Class)class__ - from: (OFString*)from_ - to: (OFString*)to_ +- initWithClass: (Class)class__ + sourcePath: (OFString*)src_ + destinationPath: (OFString*)dst_ { self = [super initWithClass: class__]; - from = [from_ copy]; - to = [to_ copy]; - err = GET_ERR; + src = [src_ copy]; + dst = [dst_ copy]; + err = GET_ERR; return self; } - (void)dealloc { - [from release]; - [to release]; + [src release]; + [dst release]; [super dealloc]; } - (OFString*)string @@ -752,28 +752,28 @@ if (string != nil) return string; string = [[OFString alloc] initWithFormat: @"Failed to rename file %s to %s in class %s! " ERRFMT, - [from cString], [to cString], [class_ className], ERRPARAM]; + [src cString], [dst cString], [class_ className], ERRPARAM]; return string; } - (int)errNo { return err; } -- (OFString*)from +- (OFString*)sourcePath { - return from; + return src; } -- (OFString*)to +- (OFString*)destinationPath; { - return to; + return dst; } @end @implementation OFDeleteFileFailedException + newWithClass: (Class)class__ @@ -830,28 +830,28 @@ } @end #ifndef _WIN32 @implementation OFLinkFailedException -+ newWithClass: (Class)class__ - source: (OFString*)src_ - destination: (OFString*)dest_ ++ newWithClass: (Class)class__ + sourcePath: (OFString*)src_ + destinationPath: (OFString*)dest_ { return [[self alloc] initWithClass: class__ - source: src_ - destination: dest_]; + sourcePath: src_ + destinationPath: dest_]; } - initWithClass: (Class)class__ { @throw [OFNotImplementedException newWithClass: isa selector: _cmd]; } -- initWithClass: (Class)class__ - source: (OFString*)src_ - destination: (OFString*)dest_ +- initWithClass: (Class)class__ + sourcePath: (OFString*)src_ + destinationPath: (OFString*)dest_ { self = [super initWithClass: class__]; src = [src_ copy]; dest = [dest_ copy]; @@ -883,40 +883,40 @@ - (int)errNo { return err; } -- (OFString*)source +- (OFString*)sourcePath { return src; } -- (OFString*)destination +- (OFString*)destinationPath { return dest; } @end @implementation OFSymlinkFailedException -+ newWithClass: (Class)class__ - source: (OFString*)src_ - destination: (OFString*)dest_ ++ newWithClass: (Class)class__ + sourcePath: (OFString*)src_ + destinationPath: (OFString*)dest_ { return [[self alloc] initWithClass: class__ - source: src_ - destination: dest_]; + sourcePath: src_ + destinationPath: dest_]; } - initWithClass: (Class)class__ { @throw [OFNotImplementedException newWithClass: isa selector: _cmd]; } -- initWithClass: (Class)class__ - source: (OFString*)src_ - destination: (OFString*)dest_ +- initWithClass: (Class)class__ + sourcePath: (OFString*)src_ + destinationPath: (OFString*)dest_ { self = [super initWithClass: class__]; src = [src_ copy]; dest = [dest_ copy]; @@ -948,16 +948,16 @@ - (int)errNo { return err; } -- (OFString*)source +- (OFString*)sourcePath { return src; } -- (OFString*)destination +- (OFString*)destinationPath { return dest; } @end #endif Index: src/OFFile.m ================================================================== --- src/OFFile.m +++ src/OFFile.m @@ -262,12 +262,12 @@ if (rename([from cString], [to cString])) #else if (!MoveFile([from cString], [to cString])) #endif @throw [OFRenameFileFailedException newWithClass: self - from: from - to: to]; + sourcePath: from + destinationPath: to]; } + (void)deleteFileAtPath: (OFString*)path { #ifndef _WIN32 @@ -283,21 +283,21 @@ + (void)linkFileAtPath: (OFString*)src toPath: (OFString*)dest { if (link([src cString], [dest cString]) != 0) @throw [OFLinkFailedException newWithClass: self - source: src - destination: dest]; + sourcePath: src + destinationPath: dest]; } + (void)symlinkFileAtPath: (OFString*)src toPath: (OFString*)dest { if (symlink([src cString], [dest cString]) != 0) @throw [OFSymlinkFailedException newWithClass: self - source: src - destination: dest]; + sourcePath: src + destinationPath: dest]; } #endif - init {