-
Notifications
You must be signed in to change notification settings - Fork 281
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement -[NSFileManager URLsForDirectory:inDomains:] #419
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The concept is fine, but there are two show-stopping issues of non-portable coding with the implementation:
- The use of generics: you need to replace the generic syntax with the macros provided in NSObjCRuntime.h
- The use of blocks: you need to replace any blocks code with portable code. In this case it's simple enumeration so you might best use the FOR_IN macro provided in GSFastEnumeration.h
@2xsaiko I don't believe a copyright assignment is needed for this change. Please write [email protected] and request a copyright assignment for GNUstep and CC me on the request at [email protected]. Also, please make the changes suggested via @rfm. The reason is that GNUstep supports more compilers than just clang and not all support the same features. Thank you, GC |
Sorry, I accidentally hit the "close" button. I reopened this. |
e2cf136
to
952e076
Compare
Done! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One tiny issue; the dot syntax to access a property is non-portable; older compilers don't support properties, so we must call the method to get the count of objects in the paths array.
However, I'll merge and then fix that rather than holding things up.
oops ... also an excess RELEASE to be removed and some formatting tweaks |
Hmm, I see, the array returned by NSSearchPathForDirectoriesInDomains is autoreleased. Should that be the case for the array returned from this method too then? Sorry about that, this was originally written in ARC mode so I didn't see if it breaks anything and I'm used to COM where there's only retain and release so you generally have to release everything returned from a method call :^) |
This behaves like NSSearchPathForDirectoriesInDomains (at least, superficially. Not sure if Apple's implementation has some special behavior on top that their documentation doesn't mention.)
The documentation comment is copied from NSSearchPathForDirectoriesInDomains.