objc2 icon indicating copy to clipboard operation
objc2 copied to clipboard

Improve `objc2::foundation`

Open madsmtm opened this issue 2 years ago • 0 comments

Collection of ideas to improve objc2-foundation

  • [ ] Add more iterator methods to INSArray and INSMutableArray (see also https://github.com/madsmtm/objc2/issues/29#issuecomment-913185651)
  • [ ] Safety of NSArray::objects_in_range (out of bounds?)
  • [x] ~Add INSString::to_string to avoid having to use autoreleasepool~ This is already available via. Display
  • [x] Figure out how NSNumber vs. NSValue should work - done in #226
  • [ ] Lifetime parameter on NSString/NSData and subclasses, so that initWithBytesNoCopy can work?
  • [ ] NSData index with ranges / SliceIndex?
  • [x] NSSize validity: https://github.com/madsmtm/objc2/pull/260
  • [ ] Iteration improvements, see also https://clang.llvm.org/docs/AutomaticReferenceCounting.html#fast-enumeration-iteration-variables
  • [ ] ...

Add these classes/structs that are used by winit:

  • [x] NSThread
  • [x] NSString
  • [x] NSAttributedString
  • [x] NSAttributedMutableString
  • [x] NSArray
  • [x] NSProcessInfo
  • [x] NSDictionary
  • [x] NSData
  • [x] NSFastEnumeration
  • [ ] NSNotificationCenter
  • [x] NSTimeInterval
  • [x] NSPoint
  • [x] NSRect
  • [x] NSSize
  • [x] NSRange

An furthermore these that are available in cocoa-foundation:

  • [ ] NSOperatingSystemVersion
  • [ ] More NSProcessInfo methods
  • [ ] NSEnumerationOptions?
  • [ ] NSDate
  • [ ] NSRunLoop
  • [ ] NSURL
  • [x] NSBundle
  • [ ] NSData base64 functionality?
  • [ ] NSUserDefaults

And a few that makes sense to do:

  • [x] NSSet/NSMutableSet - https://github.com/madsmtm/objc2/pull/245
  • [x] NSMutableDictionary - https://github.com/madsmtm/objc2/pull/249

madsmtm avatar Nov 03 '21 10:11 madsmtm