[View]  [Edit]  [Lock]  [References]  [Attachments]  [History]  [Home]  [Changes]  [Search]  [Help] 

api[apple,Foundation] methods

"API definition for core Foundation library.
Includes code that will run on both iOS and OSX execution environments."

NSObject buildGetters: #(
	attributeKeys
	className
	toManyRelationshipKeys
	toOneRelationshipKeys
	description hash
	retain autorelease retainCount
)!
NSObject buildAccessors: #(
	scriptingProperties
)!
NSObject buildBooleanGetters: #(
	isProxy
)!
NSObject buildTypedGetters: #(
	#( autoContentAccessingProxy #NSObject )
)!
NSObject buildFunctions: #(
	#( #performSelector:withObject:afterDelay: #( selector #(arg json) delay ))
	#( #performSelector:withObject:afterDelay:inModes: #( selector #(arg json) delay modes ))
	#( #performSelectorInBackground:withObject: #( selector #(arg json) ))
	#( #performSelectorOnMainThread:withObject:waitUntilDone: #( selector #(arg json) aBoolean ))
	#( #performSelectorOnMainThread:withObject:waitUntilDone:modes: #( selector #(arg json) aBoolean modes ))
)!

! NSObject class methodsFor: #cancelation !
cancelPreviousPerformRequestsWithTarget: aTarget
	" Cancels perform requests previously registered with the #performSelector:withObject:afterDelay: "

	self nativeClass cancelPreviousPerformRequestsWithTarget: aTarget handle! !

! NSObject class methodsFor: #cancelation !
cancelPreviousPerformRequestsWithTarget: aTarget selector: aSelector object: anArgument
	" Cancels perform requests previously registered with the #performSelector:withObject:afterDelay: "

	self nativeClass
		cancelPreviousPerformRequestsWithTarget: aTarget handle
		selector: aSelector object: anArgument handle! !

" KVC - NSKeyValueCoding Protocol
https://developer.apple.com/library/mac/documentation/cocoa/reference/foundation/Protocols/NSKeyValueCoding_Protocol/Reference/Reference.html
The NSKeyValueCoding informal protocol defines a mechanism by which you can access the properties of an object indirectly by name (or key),
 rather than directly through invocation of an accessor method or as instance variables.
"
NSObject buildFunctions: #(
	#(#dictionaryWithValuesForKeys: #(array))
	#(#mutableArrayValueForKey: #(key))
	#(#mutableArrayValueForKeyPath: #(keyPath))
	#(#mutableOrderedSetValueForKey: #(key))
	#(#mutableOrderedSetValueForKeyPath: #(keyPath))
	#(#mutableSetValueForKey: #(key))
	#(#mutableSetValueForKeyPath: #(keyPath))
	#(#setNilValueForKey: #(key))
	#(#setValue:forKey: #(#(value handle) key))
	#(#setValue:forKeyPath: #(#(value handle) keyPath))
	#(#setValue:forUndefinedKey: #(#(value handle) key))
	#(#setValuesForKeysWithDictionary: #( json ))
	#(#valueForKey: #(key))
	#(#valueForKeyPath: #(keyPath))
	#(#valueForUndefinedKey: #(key))
)!

! NSObject class methodsFor: #KVC !
accessInstanceVariablesDirectly
	" Returns a Boolean value that indicates whether the key-value coding methods should access the corresponding instance variable directly on finding no accessor method for a property. "

	^(self nativeClass basicAt: #accessInstanceVariablesDirectly) = 1! !


"  Foundation Functions Reference - Functions defined by the Foundation framework.
https://developer.apple.com/library/ios/documentation/cocoa/reference/foundation/miscellaneous/foundation_functions/Reference/reference.html
"

! NSObject methodsFor: #filePaths !
searchPathForDirectories: directory
	inDomains: domainMask
	expandTilde: aBoolean
	" Returns the list of directory search paths. "

	^JSC new
		searchPathForDirectoriesInDomains: (self directoryConstant: directory)
		domainMask: (self domainMask: domainMask)
		expandTilde: aBoolean! !

! NSObject methodsFor: #filePaths !
documentsDirectory
	" Returns the documents directory path (or an empty string). "

	| list |
	list := self searchPathForDirectories: #document inDomains: #user expandTilde: true.
	^list notEmpty
		ifTrue: [ list first ]
		ifFalse: [ '' ]! !

! NSObject class methodsFor: #filePaths !
documentsDirectory
	" Returns the application's documents directory path. "

	^self new documentsDirectory! !

! NSObject methodsFor: #filePaths !
domainMask: selector
	" Private - Return the domain mask constant for selector. "

	selector isNumber ifTrue: [ ^selector ].
	selector == #all ifTrue: [ ^16rFFFF ].
	selector isString ifTrue: [
		^#( user local 3 network 5 6 7 system )
		  indexOf: selector
		  ifAbsent: [ self error: 'Unknown domain mask: ',selector ]
	].
	^selector "array of constants assumed"
	  inject: 0
	  into: [:total :each| total + each ]! !

! NSObject methodsFor: #filePaths !
directoryConstant: selector
	" Private - Return the constant for directory search. "

	selector isNumber ifTrue: [ ^selector ].
	selector == #itemReplacement ifTrue: [ ^99 ].
	selector == #allApplications ifTrue: [ ^100 ].
	selector == #allLibraries ifTrue: [ ^101 ].
	selector == #trash ifTrue: [ ^102 ].
	^#(	application
		demoApplication
		developerApplication
		adminApplication
		library developer user
		documentation document
		coreService
		autosavedInformation
		desktop caches
		applicationSupport
		downloads inputMethods
		movies music pictures
		printerDescription
		sharedPublic
		preferencePanes
		applicationScripts
	) indexOf: selector ifAbsent: [
		self error: 'Unknown directory search constant: ',selector
	]! !

"--- End of NSObject core foundation ----------------------------"!

NSObject subclass: #NSIndexPath!
NSIndexPath buildFunctions: #(
	#(#compare: #( #(aNSIndexPath handle) ) )
	#(#indexAtPosition: #( offset ) )
	#length
)!

! NSIndexPath class methodsFor: #instantiation !
withIndex: index
	" Return an instance of the receiver. "

	^self @ (self nativeClass indexPathWithIndex: index)! !

! NSIndexPath class methodsFor: #instantiation !
withIndexes: indexes length: length
	" Return an instance of the receiver. "

	^self @ (self nativeClass indexPathWithIndexes: indexes length: length)! !

NSObject subclass: #NSSet!
NSSet buildGetters: #(
	description
)!
NSSet buildFunctions: #(
	#allObjects count
	#(#anyObject  #NSObject)
	#(#containsObject: #( #(aNSObject handle)) #Boolean)
	#(#filteredSetUsingPredicate: #( #(aNSPredicate handle)) #NSSet)
	#(#makeObjectsPerformSelector: #( selector ))
	#(#makeObjectsPerformSelector:withObject: #( selector #(aNSObject handle)))
	#(#member: #( #(aNSObject handle)) #NSObject)
	#(#objectEnumerator  #NSEnumerator)
	#(#enumerateObjectsUsingBlock: #( #(aNSBlock handle)))
	#(#enumerateObjectsWithOptions:usingBlock: #(opts #(aNSBlock handle)))
	#(#objectsPassingTest: #( #(aNSBlock handle)) #NSSet)
	#(#objectsWithOptions:passingTest: #(opts #(aNSBlock handle)) #NSSet)
	#(#isSubsetOfSet: #(#(aNSSet handle)) #Boolean)
	#(#intersectsSet: #(#(aNSSet handle)) #Boolean)
	#(#isEqualToSet: #(#(aNSSet handle)) #Boolean)
	#(#valueForKey: #(key) #NSObject)
	#(#setValue:forKey: #( #(aValue handle) key))
	#(#sortedArrayUsingDescriptors: #( #(descriptors handles)))
	#(#addObserver:forKeyPath:options:context: #( #(observer handle) keyPath options context))
	#(#removeObserver:forKeyPath:context: #( #(observer handle) keyPath context))
	#(#removeObserver:forKeyPath: #( #(observer handle) keyPath))
	#(#descriptionWithLocale: #( #(aNSLocale handle)))
)!

! NSSet class methodsFor: #instantiation !
empty
	" Return an instance of the receiver. "

	^self @ (self nativeClass basicAt: #set)! !

! NSSet class methodsFor: #instantiation !
withArray: anArray
	" Return an instance of the receiver. "

	^self @ (self nativeClass setWithArray: anArray)! !

! NSSet class methodsFor: #instantiation !
with: aNSObject
	" Return an instance of the receiver. "

	^self @ (self nativeClass setWith: aNSObject json)! !

! NSSet class methodsFor: #instantiation !
withSet: aNSSet
	" Return an instance of the receiver. "

	^self @ (self nativeClass setWithSet: aNSSet json)! !

! NSSet methodsFor: #accessing !
size
	" Return the size of the receiver. "

	^self count! !

NSSet subclass: #NSMutableSet!
NSMutableSet buildFunctions: #(
	#(#addObject: #( #(aNSObject handle)))
	#(#filterUsingPredicate: #( #(aNSPredicate handle)))
	#(#removeObject: #( #(aNSObject handle)))
	#removeAllObjects
	#(#addObjectsFromArray: #( #(aNSArray handle)))
	#(#unionSet: #( #(aNSSet handle)))
	#(#minusSet: #( #(aNSSet handle)))
	#(#intersectSet: #( #(aNSSet handle)))
	#(#setSet: #( #(aNSSet handle)))
)!

! NSMutableSet class methodsFor: #instantiation !
withCapacity: count
	" Return an instance of the receiver. "

	^self @ (self nativeClass setWithCapacity: count)! !

NSMutableSet subclass: #NSCountedSet!
NSCountedSet buildFunctions: #(
	#(#countForObject: #( #(aNSObject handle)))
	#objectEnumerator
)!

NativeObject
 subclass: #NSRange
 category: #Foundation!
NSRange buildNumberAccessors: #( location length )!

! NSRange class methodsFor: #instantiation !
location: location length: length
	| handle |
	handle := {'new NSRange(location,length);'}.
	^self @ handle! !

NSObject subclass: #NSAttributedString!
NSAttributedString buildFunctions: #(
	#(#attribute:atIndex:effectiveRange: #( attributeName index #(aNSRange handle) ) )
	#(#attribute:atIndex:longestEffectiveRange:inRange: #( attributeName index #(aNSRange handle) #(nsRangeLimit handle) ) )
	#(#attributedSubstringFromRange: #(#(aNSRange handle)) #NSAttributedString )
	length string
)!

! NSAttributedString class methodsFor: #instantiation !
withString: aString
	" Return an instance of the receiver. "

	^self @ (self nativeClass instanceWithString: aString)! !

! NSAttributedString class methodsFor: #instantiation !
withString: aString attributes: attributes
	" Return an instance of the receiver. "

	^self @ (self nativeClass
		instanceWithString: aString
		attributes: attributes)! !

! NSAttributedString class methodsFor: #instantiation !
withAttributedString: anAttributedString
	" Return an instance of the receiver. "

	^self @ (self nativeClass instanceWithAttributedString: anAttributedString handle)! !

! NSAttributedString methodsFor: #copying !
attributedSubstringFromRange: aNSRange
	" Return the characters and attributes within a given range in the receiver. "

	^self class @ (self handle attributedSubstringFromRange: aNSRange handle)! !

! NSAttributedString methodsFor: #accessing !
attributesAtIndex: index effectiveRange: aNSRange
	" Return the attributes for the character at a given index. "

	^self class @ (self handle attributesAtIndex: index effectiveRange: aNSRange handle)! !

! NSAttributedString methodsFor: #query !
isEqualToAttributedString: otherString
	" Indicates whether the receiver is equal to another given attributed string. "

	^self handle isEqualToAttributedString: otherString handle! !

! NSAttributedString methodsFor: #enumerating !
enumerateAttribute: attrName inRange: enumerationRange options: opts usingBlock: aBlock
	" Executes the aBlock for the specified attribute run in the specified range.
	TODO: See - https://developer.apple.com/library/ios/documentation/cocoa/reference/foundation/classes/NSAttributedString_Class/Reference/Reference.html#//apple_ref/doc/uid/20000166-SW1
	enumerateAttribute:(NSString *)attrName inRange:(NSRange)enumerationRange options:(NSAttributedStringEnumerationOptions)opts usingBlock:(void (^)(id value, NSRange range, BOOL *stop))block
	"

	self error: 'Not implemented. Yet (',self class name,'>>#enumerateAttribute:inRange:options:usingBlock:)'.
	^self handle
		enumerateAttribute: attrName
		inRange: enumerationRange handle
		options: opts usingBlock: aBlock handle! !

! NSAttributedString methodsFor: #enumerating !
enumerateAttributesInRange: enumerationRange options: opts usingBlock: aBlock
	" Executes the aBlock for each attribute in the range.
	TODO: See - https://developer.apple.com/library/ios/documentation/cocoa/reference/foundation/classes/NSAttributedString_Class/Reference/Reference.html#//apple_ref/doc/uid/20000166-SW1
	enumerateAttributesInRange:(NSRange)enumerationRange options:(NSAttributedStringEnumerationOptions)opts usingBlock:(void (^)(id value, NSRange range, BOOL *stop))block
	"

	self error: 'Not implemented. Yet (',self class name,'>>#enumerateAttributesInRange:inRange:options:usingBlock:)'.
	^self handle
		enumerateAttributesInRange: enumerationRange handle
		options: opts usingBlock: aBlock handle! !

NSAttributedString subclass: #NSMutableAttributedString !

NSMutableAttributedString buildFunctions: #(
	#( #addAttribute:value:range: #( attributeName aValue #(aNSRange handle) ) )
	#( #addAttributes:range: #( aNSDictionary #(aNSRange handle) ) )
	#( #appendAttributedString: #( #(aNSAttributedString handle) ) )
	beginEditing endEditing
	#( #deleteCharactersInRange: #( #(aNSRange handle) ) )
	#( #insertAttributedString:atIndex: #( #(aNSAttributedString handle) index ) )
	#( #removeAttribute:range: #( name #(aNSRange handle) ) )
	#( #replaceCharactersInRange:withAttributedString: #( #(aNSRange handle) #(aNSAttributedString handle) ) )
	#( #replaceCharactersInRange:withString: #( #(aNSRange handle) aString ) )
	#( #setAttributedString: #( #(aNSAttributedString handle) ) )
	#( #setAttributes:range: #( aNSDictionary #(aNSRange handle) ) )
)!

! NSMutableAttributedString methodsFor: #accessing !
mutableString
	" Returns the character contents of the receiver as an NSMutableString object. "

	^NSMutableString @ self handle mutableString! !

NSObject subclass: #NSString!
! NSString class methodsFor: #accessing !
availableStringEncodings
	" Return the list of the encodings support in the application’s environment. "

	^self nativeClass basicAt: #availableStringEncodings! !

! NSString class methodsFor: #accessing !
defaultCStringEncoding
	" Return the C-string encoding assumed for any method accepting a C string as an argument. "

	^self nativeClass basicAt: #defaultCStringEncoding! !

! NSString class methodsFor: #accessing !
localizedNameOfStringEncoding: encoding
	" Return the human-readable string giving the name of encoding in the current locale’s language. "

	^self nativeClass localizedNameOfStringEncoding: encoding! !

! NSString class methodsFor: #accessing !
pathWithComponents: array
	" Return a string built from the strings in a given array by concatenating them with a path separator between each pair. "

	^self nativeClass pathWithComponents: array! !

! NSString class methodsFor: #io !
withContentsOfFile: path encoding: enc error: pError
	" Return a string created by reading data from the file at a given path. "

	^self nativeClass
		stringWithContentsOfFile: path
		encoding: enc
		error: pError! !

! NSString class methodsFor: #io !
withContentsOfFile: path encoding: enc onError: aBlock
	" Return a string created by reading data from the file at a given path. "

	| pError result |
	pError := self outArgument.
	result := self withContentsOfFile: path encoding: enc error: pError.
	(pError basicAt: #code) isNil ifTrue: [
		^result notNil ifTrue: [ result ]
	].
	^aBlock evaluateWith: NSError @ pError! !

! NSString class methodsFor: #io !
defaultContentEncoding
	" Private - Return the encoding used for default content string. "

	^1"=NSASCIIStringEncoding 4=NSUTF8StringEncoding"! !

! NSString class methodsFor: #io !
withContentsOfFile: path
	" Return a string created by reading data from the file at a given path (or nil). "

	^self withContentsOfFile: path encoding: self defaultContentEncoding! !

! NSString class methodsFor: #io !
withContentsOfFile: path encoding: enc
	" Return a string created by reading data from the file at a given path (or nil). "

	^self withContentsOfFile: path encoding: enc onError: [ nil ]! !

! NSString class methodsFor: #io !
withContentsOfURL: url encoding: enc error: pError
	" Return a string created by reading data from a given URL interpreted using a given encoding. "

	^self nativeClass stringWithContentsOfURL: url handle encoding: enc error: pError! !

! NSString class methodsFor: #io !
withContentsOfURL: url encoding: enc
	" Return a string created by reading data from a given URL interpreted using a given encoding (or nil). "

	^self withContentsOfURL: url encoding: enc onError: [ nil ]! !

! NSString class methodsFor: #io !
withContentsOfURL: path
	" Return a string created by reading data from a given URL (or nil). "

	^self withContentsOfURL: path encoding: self defaultContentEncoding! !

! NSString class methodsFor: #io !
withContentsOfURL: url encoding: enc onError: aBlock
	" Return a string created by reading data from a given URL interpreted using a given encoding. "

	| pError result |
	pError := self outArgument.
	result := self nativeClass stringWithContentsOfURL: url handle encoding: enc error: pError.
	(pError basicAt: #code) isNil ifTrue: [
		^result notNil ifTrue: [ result ]
	].
	^aBlock evaluateWith: NSError @ pError! !

NSString subclass: #NSMutableString!
NSMutableString buildFunctions: #(
	#( #appendFormat: #( format ) )
	#( #appendString: #( string ) )
	#( #deleteCharactersInRange: #( #(aNSRange handle) ) )
	#( #insertString:atIndex: #( string offset ) )
	#( #replaceCharactersInRange:withString: #( #(aNSRange handle) aString ) )
	#( #replaceOccurrencesOfString:withString:options:range: #( target replacement options #(aNSRange handle) ) )
	#( #setString: #( aString ) )
)!

! NSMutableString class methodsFor: #instantiation !
withCapacity: capacity
	" Return an instance of the receiver. "

	^self @ (self nativeClass stringWithCapacity: capacity)! !

! NSMutableString class methodsFor: #instantiation !
new: capacity
	" Return an instance of the receiver. "

	^self @ (self nativeClass stringWithCapacity: capacity)! !

! NSMutableString methodsFor: #accessing !
string: aString
	" Set the contents of the receiver with aString. "

	self handle setString: aString.
	^aString! !

! NSMutableString methodsFor: #accessing !
contents: aString
	" Set the contents of the receiver with aString. "

	^self string: aString! !

NSObject subclass: #NSThread!

! NSThread ignoreFileInUpTo: #NSThreadIGNORED !

NSThread buildBooleanGetters: #(
	isCancelled isExecuting isFinished isMainThread
)!
NSThread buildAccessors: #(
	name stackSize threadPriority
)!
NSThread buildFunctions: #(
	cancel main start
	threadDictionary
)!

! NSThread class methodsFor: #instantiation !
mainThread
	" Return an instance of the receiver. "

	^self @ (self nativeClass basicAt: #mainThread)! !

! NSThread class methodsFor: #instantiation !
currentThread
	" Return an instance of the receiver. "

	^self @ (self nativeClass basicAt: #currentThread)! !

! NSThread class methodsFor: #stack !
callStackReturnAddresses
	" Returns an array containing the call stack return addresses. "

	| result |
	result := (self nativeClass basicAt: #callStackReturnAddresses).
	result isNil ifTrue: [ ^#() ].
	^result! !

! NSThread class methodsFor: #stack !
callStackSymbols
	" Returns an array containing the call stack symbols. "

	^self nativeClass basicAt: #callStackSymbols! !

! NSThread class methodsFor: #stack !
detachNewThreadSelector: aSelector toTarget: aTarget withObject: anArgument
	" Detaches a new thread and uses the specified selector as the thread entry point. "

	^self nativeClass
		detachNewThreadSelector: aSelector
		toTarget: aTarget json
		withObject: anArgument json! !

! NSThread class methodsFor: #query !
isMainThread

	^(self nativeClass basicAt: #isMainThread) = 1! !

! NSThread class methodsFor: #query !
isMultiThreaded

	^(self nativeClass basicAt: #isMultiThreaded) = 1! !

! NSThread class methodsFor: #accessing !
setThreadPriority: priority

	^self nativeClass setThreadPriority: priority! !

! NSThread class methodsFor: #accessing !
threadPriority

	^self nativeClass basicAt: #threadPriority! !

We skip this methods. Enable them if you need in your system
#NSThreadIGNORED !

! NSThread class methodsFor: #threading !
sleepForTimeInterval: duration

	^self nativeClass sleepForTimeInterval: duration! !

NSObject subclass: #NSURL!
NSURL buildGetters: #(
	absoluteString fragment host
	lastPathComponent parameterString
	password path pathComponents
	pathExtension query
	relativePath relativeString
	resourceSpecifier scheme user
)!
NSURL buildNumberGetters: #(
	port
)!
NSURL buildBooleanGetters: #(
	isFileReferenceURL isFileURL
	
)!
NSURL buildTypedGetters: #(
	#(absoluteURL #NSURL)
	#(baseURL #NSURL)
	#(filePathURL #NSURL)
	#(fileReferenceURL #NSURL)
	#(standardizedURL #NSURL)
)!
NSURL buildFunctions: #(
	#(#isEqual: #(#(anObject handle)) #Boolean)
)!

! NSURL class methodsFor: #instantiation !
withPath: path
	" Return an instance of the receiver. "

	^self @ (self nativeClass fileURLWithPath: path)! !

! NSURL class methodsFor: #instantiation !
withPath: path isDirectory: aBoolean
	" Return an instance of the receiver. "

	^self @ (self nativeClass fileURLWithPath: path isDirectory: aBoolean)! !

! NSURL class methodsFor: #instantiation !
withPathComponents: anArray
	" Return an instance of the receiver. "

	^self @ (self nativeClass fileURLWithPathComponents: anArray)! !

! NSURL class methodsFor: #instantiation !
withString: aString
	" Return an instance of the receiver. "

"self print: '//' ,aString.
"	^self @ (self nativeClass #URLWithString: aString)! !

! NSURL class methodsFor: #instantiation !
withString: aString relativeToURL: baseURL
	" Return an instance of the receiver. "

	^self @ (self nativeClass #URLWithString: aString relativeToURL: baseURL handle)! !

! NSURL class methodsFor: #instantiation !
@ aHandle
	" Return an instance of the receiver. "

	((self isObject: aHandle) and: [ aHandle isString ]) ifTrue: [
		^self withString: aHandle
	].
	^super @ aHandle! !

! NSURL methodsFor: #converting !
asNSURL
	" Return an NSURL instance from the receiver. "

	^self! !

! String methodsFor: 'Foundation-converting' !
asNSURL
	" Return an NSURL instance from the receiver. "

	^NSURL withString: '',self! !
	
NSObject subclass: #NSURLRequest!
NSURLRequest buildGetters: #(
	allHTTPHeaderFields #HTTPMethod
)!
NSURLRequest buildNumberGetters: #(
	cachePolicy
	timeoutInterval
	networkServiceType
)!
NSURLRequest buildBooleanGetters: #(
	#HTTPShouldUsePipelining #HTTPShouldHandleCookies 
	allowsCellularAccess
)!
NSURLRequest buildBooleanAccessors: #(
	supportsSecureCoding
)!
NSURLRequest buildTypedGetters: #(
	#(mainDocumentURL #NSURL)
	#(#URL #NSURL)
	#(#HTTPBody #NSData)
	#(#HTTPBodyStream #NSInputStream)
)!
NSURLRequest buildFunctions: #(
	#(#isEqual: #(#(anObject handle)) #Boolean)
	#(#valueForHTTPHeaderField: #(field))
)!

! NSURLRequest class methodsFor: #instantiation !
withURL: theURL
	" Return an instance of the receiver. "

	^self @ (self nativeClass requestWithURL: theURL handle)! !

! NSURLRequest class methodsFor: #instantiation !
withURL: theURL cachePolicy: policy timeoutInterval: interval
	" Return an instance of the receiver. "

	^self @ (self nativeClass
		requestWithURL: theURL handle
		cachePolicy: policy
		timeoutInterval: interval)! !

NSURLRequest subclass: #NSMutableURLRequest!
NSMutableURLRequest buildSetters: #(
	allHTTPHeaderFields #HTTPMethod
)!
NSMutableURLRequest buildSetters: #(
	cachePolicy
	timeoutInterval
	networkServiceType
	#HTTPShouldUsePipelining #HTTPShouldHandleCookies
	allowsCellularAccess
)!
NSMutableURLRequest buildTypedAccessors: #(
	#(mainDocumentURL #NSURL)
	#(#URL #NSURL)
	#(#HTTPBody #NSData)
	#(#HTTPBodyStream #NSInputStream)
)!
NSMutableURLRequest buildFunctions: #(
	#(#addValue:forHTTPHeaderField: #(value field))
	#(#setValue:forHTTPHeaderField: #(value field))
)!

NSObject subclass: #NSURLSession!
NSURLSession buildAccessors: #(
	sessionDescription
)!
NSURLSession buildTypedGetters: #(
	#(delegate #NSObject)
	#(configuration #NSURLSessionConfiguration)
	#(delegateQueue #NSOperationQueue)
)!
NSURLSession buildFunctions: #(
	#(#dataTaskWithURL: #(#(url handle)) #NSURLSessionDataTask)
	#(#dataTaskWithURL:completionHandler: #( #(url handle) #(handler handle)) #NSURLSessionDataTask)
	#(#dataTaskWithRequest: #(#(request handle)) #NSURLSessionDataTask)
	#(#dataTaskWithRequest:completionHandler: #( #(request handle) #(handler handle)) #NSURLSessionDataTask)
	
	#(#downloadTaskWithURL: #(#(url handle)) #NSURLSessionDownloadTask)
	#(#downloadTaskWithURL:completionHandler: #( #(url handle) #(handler handle)) #NSURLSessionDownloadTask)
	#(#downloadTaskWithRequest: #(#(request handle)) #NSURLSessionDownloadTask)
	#(#downloadTaskWithRequest:completionHandler: #( #(request handle) #(handler handle)) #NSURLSessionDownloadTask)
	#(#downloadTaskWithResumeData: #(#(data handle)) #NSURLSessionDownloadTask)
	#(#downloadTaskWithResumeData:completionHandler: #( #(data handle) #(handler handle)) #NSURLSessionDownloadTask)
	
	#(#uploadTaskWithRequest:fromData: #(#(request handle) #(data handle)) #NSURLSessionUploadTask)
	#(#uploadTaskWithRequest:fromData:completionHandler: #(#(request handle) #(data handle) #(handler handle)) #NSURLSessionUploadTask)
	#(#uploadTaskWithRequest:fromFile: #(#(request handle) #(url handle)) #NSURLSessionUploadTask)
	#(#uploadTaskWithRequest:fromFile:completionHandler: #(#(request handle) #(data handle) #(handler handle)) #NSURLSessionUploadTask)
	#(#uploadTaskWithStreamedRequest: #(#(request handle)) #NSURLSessionUploadTask)
	#(#streamTaskWithHostName:port: #(hostName port) #NSURLSessionStreamTask)
	#(#streamTaskWithNetService: #(#(service handle)) #NSURLSessionStreamTask)
	finishTasksAndInvalidate
	#(#flushWithCompletionHandler: #(#(handler handle)) )
	#(#getTasksWithCompletionHandler: #(#(handler handle)) )
	invalidateAndCancel
	#(#resetWithCompletionHandler: #(#(handler handle)) )
)!

! NSURLSession class methodsFor: #instantiation !
withConfiguration: configuration
	" Return an instance of the receiver. "

	^self @ (self nativeClass sessionWithConfiguration: configuration handle)! !

! NSURLSession class methodsFor: #instantiation !
withConfiguration: configuration
	delegate: delegate
	delegateQueue: queue
	" Return an instance of the receiver. "

	^self @ (self nativeClass 
		sessionWithConfiguration: configuration handle 
		delegate: delegate handle 
		delegateQueue: queue handle)! !

! NSURLSession class methodsFor: #instantiation !
sharedSession
	" Return a Singleton instance of the receiver. "

	^self @ (self nativeClass basicAt: #sharedSession)! !

NSObject subclass: #NSURLSessionConfiguration!
NSURLSessionConfiguration comment: '
	Defines the behavior and policies to use when uploading and downloading data using an NSURLSession object.
'!
NSURLSessionConfiguration buildAccessors: #(
	#HTTPAdditionalHeaders
	sharedContainerIdentifier
	protocolClasses
	connectionProxyDictionary
)!
NSURLSessionConfiguration buildGetters: #(
	identifier
)!
NSURLSessionConfiguration buildNumberAccessors: #(
	timeoutIntervalForRequest
	timeoutIntervalForResource
	sharedContainerIdentifier
	#HTTPCookieAcceptPolicy
	networkServiceType
	requestCachePolicy
	#HTTPMaximumConnectionsPerHost
)!
NSURLSessionConfiguration buildBooleanAccessors: #(
	allowsCellularAccess
	#HTTPShouldSetCookies
	sessionSendsLaunchEvents
	#HTTPShouldUsePipelining
)!
NSURLSessionConfiguration buildIsBooleanAccessors: #(
	discretionary
)!
NSURLSessionConfiguration buildTypedAccessors: #(
	#(#HTTPCookieStorage #NSHTTPCookieStorage)
	#(#TLSMaximumSupportedProtocol #SSLProtocol)
	#(#TLSMinimumSupportedProtocol #SSLProtocol)
	#(#URLCredentialStorage #NSURLCredentialStorage)
	#(#URLCache #NSURLCache)
)!

! NSURLSessionConfiguration class methodsFor: #instantiation !
default
	" Return a Singleton instance of the receiver. "

	^self @ (self nativeClass basicAt: #defaultSessionConfiguration)! !

! NSURLSessionConfiguration class methodsFor: #instantiation !
backgroundWithIdentifier: anString
	" Return an instance of the receiver for background tasks. "

	^self @ (self nativeClass backgroundSessionConfigurationWithIdentifier: anString)! !

NSObject subclass: #NSURLSessionTask!
NSURLSessionTask comment: ' Model of a task in a URL session. '!
NSURLSessionTask buildFunctions: #(
	cancel
	resume
	suspend
)!
NSURLSessionTask buildAccessors: #(
	taskDescription
)!
NSURLSessionTask buildGetters: #(
	identifier
)!
NSURLSessionTask buildNumberAccessors: #(
	priority
)!
NSURLSessionTask buildNumberGetters: #(
	state
	countOfBytesExpectedToReceive
	countOfBytesReceived
	countOfBytesExpectedToSend
	countOfBytesSent
	taskIdentifier
)!
NSURLSessionTask buildTypedGetters: #(
	#(currentRequest #NSURLRequest )
	#(originalRequest #NSURLRequest )
	#(response #NSURLResponse )
	#(error #NSError )
)!

NSURLSessionTask subclass: #NSURLSessionDataTask!
NSURLSessionDataTask subclass: #NSURLSessionUploadTask!

NSURLSessionTask subclass: #NSURLSessionDownloadTask!
NSURLSessionDownloadTask buildFunctions: #(
	#(#cancelByProducingResumeData: #( #(aCompletionHandler handle) ) )
)!

NSURLSessionTask subclass: #NSURLSessionStreamTask!
NSURLSessionStreamTask buildFunctions: #(
	captureStreams
	closeRead closeWrite
	startSecureConnection stopSecureConnection
	#(#readDataOfMinLength:maxLength:timeout:completionHandler: #(minBytes maxBytes timeout #(completionHandler handle)))
	#(#writeData:timeout:completionHandler: #(#(aNSData handle) timeout #(completionHandler handle)))
)!

NSObject subclass: #NSBundle!
NSBundle comment: '
	An NSBundle object represents a location in the file system that groups code and resources that can be used in a program.
'!
NSBundle buildBooleanGetters: #(
	isLoaded load unload
)!
NSBundle buildGetters: #(
	builtInPlugInsPath
	bundleIdentifier
	bundlePath
	developmentLocalization
	executableArchitectures
	executablePath
	infoDictionary
	localizations
	localizedInfoDictionary
	preferredLocalizations
	principalClass
	privateFrameworksPath
	resourcePath
	sharedFrameworksPath
	sharedSupportPath
)!
NSBundle buildTypedGetters: #(
	#(appStoreReceiptURL #NSURL)
	#(builtInPlugInsURL #NSURL)
	#(bundleURL #NSURL)
	#(executableURL #NSURL)
	#(privateFrameworksURL #NSURL)
	#(resourceURL #NSURL)
	#(sharedFrameworksURL #NSURL)
	#(sharedSupportURL #NSURL)
)!
NSBundle buildFunctions: #(
	#(#localizedStringForKey:value:table: #( key value tableName ) )
	#(#pathForAuxiliaryExecutable: #( executableName ) )
	#(#pathForResource:ofType: #( name extension ) )
	#(#pathForResource:ofType:inDirectory: #( name extension subpath ) )
	#(#pathForResource:ofType:inDirectory:forLocalization: #( name extension subpath localizationName ) )
	#(#pathsForResourcesOfType:inDirectory: #( extension subpath ) )
	#(#pathsForResourcesOfType:inDirectory:forLocalization: #( extension subpath localizationName ) )
)!

! NSBundle class methodsFor: #accessing !
allBundles
	" Returns an array of all the application’s non-framework bundles. "

	^(self nativeClass basicAt: #allBundles) collect: [:each| self @ each ]! !

! NSBundle class methodsFor: #accessing !
allFrameworks
	" Returns an array of all the application’s framework bundles. "

	^(self nativeClass basicAt: #allFrameworks) collect: [:each| self @ each ]! !

! NSBundle class methodsFor: #instantiation !
mainBundle
	" Return an instance of the receiver. "

	^self @ (self nativeClass basicAt: #mainBundle)! !

! NSBundle class methodsFor: #instantiation !
forClass: objCclass
	" Return an instance of the receiver. "

	(self isObject: objCclass) ifrue: [
		^self forClass: objCclass nativeClass
	].
	^self @ (self nativeClass bundleForClass: objCclass)! !

! NSBundle class methodsFor: #instantiation !
withIdentifier: identifier
	" Return an instance of the receiver. "

	^self @ (self nativeClass bundleWithIdentifier: identifier)! !

! NSBundle class methodsFor: #instantiation !
withPath: fullPath
	" Return an instance of the receiver. "

	^self @ (self nativeClass bundleWithPath: fullPath)! !

! NSBundle class methodsFor: #instantiation !
withURL: aDirectoryURL
	" Return an instance of the receiver. "

	^self @ (self nativeClass bundleWithURL: aDirectoryURL handle)! !

! NSBundle class methodsFor: #fileSystem !
pathForResource: name ofType: extension inDirectory: bundlePath
	" Returns the full pathname for the resource file identified by the specified name and extension and residing in a given bundle directory. "

	^self nativeClass
		pathForResource: name
		ofType: extension
		inDirectory: bundlePath! !

! NSBundle class methodsFor: #fileSystem !
pathForResource: name inDirectory: bundlePath
	" Returns the full pathname for the resource file identified by the specified name, residing in a given bundle directory (or nil). "

	^self	pathForResource: name
		ofType: ''
		inDirectory: bundlePath! !

! NSBundle class methodsFor: #fileSystem !
pathsForResourcesOfType: extension inDirectory: bundlePath
	" Returns an array containing the pathnames for all bundle resources having the specified extension and residing in the bundle directory at the specified path. "

	^self nativeClass
		pathsForResourcesOfType: extension
		inDirectory: bundlePath! !

! NSBundle class methodsFor: #fileSystem !
pathsForResourcesInDirectory: bundlePath
	" Returns an array containing the pathnames for all bundle resources having the specified extension and residing in the bundle directory at the specified path. "

	^self	pathsForResourcesOfType: ''
		inDirectory: bundlePath! !

! NSBundle class methodsFor: #fileSystem !
preferredLocalizationsFromArray: localizationsArray
	" Returns one or more localizations from the specified list that a bundle object would use to locate resources for the current user. "

	^self nativeClass preferredLocalizationsFromArray: localizationsArray! !

! NSBundle class methodsFor: #fileSystem !
preferredLocalizationsFromArray: localizationsArray forPreferences: preferencesArray
	" Returns one or more localizations from the specified list that a bundle object would use to locate resources for the current user and user preference. "

	^self nativeClass
		preferredLocalizationsFromArray: localizationsArray
		 forPreferences: preferencesArray! !

! NSBundle class methodsFor: #fileSystem !
urlForResource: name withExtension: ext subdirectory: subpath inBundleWithURL: bundleURL
	" Creates and returns a file URL for the resource with the specified name and extension in the specified bundle. "

	^NSURL @ (self nativeClass
		#URLForResource: name
		withExtension: ext
		subdirectory: subpath
		inBundleWithURL: bundleURL handle)! !

! NSBundle class methodsFor: #fileSystem !
urlsForResourcesWithExtension: ext subdirectory: subpath inBundleWithURL: bundleURL

	^(self nativeClass
		#URLsForResourcesWithExtension: ext
		subdirectory: subpath
		inBundleWithURL: bundleURL handle)
		collect: [:each| NSURL @ each ]! !

! NSBundle methodsFor: #accessing !
objectForInfoDictionaryKey: key

	^NSObject @ (self handle objectForInfoDictionaryKey: key)! !

! NSBundle methodsFor: #accessing !
pathForResource: name

	^self pathForResource: name ofType: ''! !

! NSBundle methodsFor: #accessing !
pathForResource: name inDirectory: subpath

	^self pathForResource: name ofType: '' inDirectory: subpath! !

! NSBundle methodsFor: #accessing !
pathForResource: name inDirectory: subpath forLocalization: localizationName

	^self	pathForResource: name
		ofType: ''
		inDirectory: subpath
		forLocalization: localizationName! !

! NSBundle methodsFor: #accessing !
urlForAuxiliaryExecutable: executableName

	^NSURL @ (self handle #URLForAuxiliaryExecutable: executableName)! !

! NSBundle methodsFor: #accessing !
urlForResource: name withExtension: extension

	^NSURL @ (self handle #URLForResource: name withExtension: extension)! !

! NSBundle methodsFor: #accessing !
urlForResource: name 

	^self urlForResource: name withExtension: ''! !

! NSBundle methodsFor: #accessing !
urlForResource: name withExtension: extension subdirectory: subpath

	^NSURL @ (self handle #URLForResource: name withExtension: extension subdirectory: subpath)! !

! NSBundle methodsFor: #accessing !
urlForResource: name subdirectory: subpath

	^self	urlForResource: name
		withExtension: ''
		subdirectory: subpath! !

! NSBundle methodsFor: #accessing !
urlForResource: name withExtension: extension
 subdirectory: subpath localization: localizationName

	^NSURL @ (self handle
		#URLForResource: name
		withExtension: extension
		subdirectory: subpath
		localization: localizationName)! !

! NSBundle methodsFor: #accessing !
urlForResource: name subdirectory: subpath localization: localizationName

	^self	urlForResource: name
		withExtension: ''
		subdirectory: subpath
		localization: localizationName! !

! NSBundle methodsFor: #accessing !
urlsForResourcesWithExtension: extension
 subdirectory: subpath localization: localizationName

	^NSURL @ (self handle
		#URLsForResourcesWithExtension: extension
		subdirectory: subpath
		localization: localizationName)! !

! NSBundle methodsFor: #accessing !
urlsForResourcesWithExtension: extension subdirectory: subpath

	^NSURL @ (self handle
		#URLsForResourcesWithExtension: extension
		subdirectory: subpath)! !

! NSBundle methodsFor: #accessing !
urlsForResourcesWithExtension: extension
 subdirectory: subpath localization: localizationName

	^NSURL @ (self handle
		#URLsForResourcesWithExtension: extension
		subdirectory: subpath
		localization: localizationName)! !

! NSBundle methodsFor: #accessing !
urlsForResourcesIn: subpath

	^self	urlsForResourcesWithExtension: ''
		subdirectory: subpath! !

! NSBundle methodsFor: #accessing !
urlsForResourcesIn: subpath localization: localizationName

	^self	urlsForResourcesWithExtension: ''
		subdirectory: subpath
		localization: localizationName! !

NSObject subclass: #NSCache!
NSCache comment: '
	An NSCache object is a collection-like container, or cache, that stores key-value pairs, similar to the NSDictionary class.
'!
NSCache buildAccessors: #(
	name
)!
NSCache buildTypedAccessors: #(
	#(delegate #NSObject)
)!
NSCache buildNumberAccessors: #(
	countLimit totalCostLimit
)!
NSCache buildBooleanAccessors: #(
	evictsObjectsWithDiscardedContent
)!
NSCache buildFunctions: #(
	#(#objectForKey: #(key))
	#(#setObject:forKey: #(object key))
	#(#setObject:forKey:cost: #(object key anInteger))
	#(#removeObjectForKey: #(key))
	removeAllObjects
)!

! NSCache methodsFor: #accessing !
at: aKey
	^self objectForKey: aKey! !

! NSCache methodsFor: #accessing !
at: aKey ifAbsent: aBlock
	| result |
	result := self objectForKey: aKey.
	^result isNil
		ifTrue: [ aBlock evaluate ]
		ifFalse: [ result ]! !

! NSCache methodsFor: #remove !
removeKey: aKey
	^self removeObjectForKey: aKey! !

! NSCache methodsFor: #accessing !
at: aKey put: aNSObject
	^self setObject: aNSObject forKey: aKey! !

NSObject subclass: #NSCachedURLResponse!
NSCachedURLResponse comment: '
	An NSCachedURLResponse object represents a cached response to a URL request.
'!
NSCachedURLResponse buildTypedGetters: #(
	#(data #NSData)
	#(response #NSURLResponse)
)!
NSCachedURLResponse buildGetters: #(
	storagePolicy
	userInfo
)!

! NSCachedURLResponse class methodsFor: #instantiation !
withResponse: response data: data
	" Return an instance of the receiver. "

	^self @ (self nativeClass
		instanceWithResponse: response handle
		data: data json)! !

! NSCachedURLResponse class methodsFor: #instantiation !
withResponse: response
	data: data
	userInfo: userInfo
	storagePolicy: storagePolicy
	" Return an instance of the receiver. "

	^self @ (self nativeClass
		instanceWithResponse: response handle
		data: data json
		userInfo: userInfo json
		storagePolicy: storagePolicy)! !

NSObject
	subclass: #NSFileHandle
	category: #Foundation!

NSFileHandle buildNumberGetters: #(
	fileDescriptor
	offsetInFile seekToEndOfFile
)!
NSFileHandle buildTypedGetters: #(
	#(#availableData #NSData)
)!
NSFileHandle buildFunctions: #(
	#(#readDataToEndOfFile #NSData)
	#(#readDataOfLength: #(numberOfBytes) #NSData)
	#(#writeData: #(#(data json)) )
	acceptConnectionInBackgroundAndNotify
	#(#acceptConnectionInBackgroundAndNotifyForModes: #(modes) )
	readInBackgroundAndNotify
	#(#readInBackgroundAndNotifyForModes: #(modes) )
	readToEndOfFileInBackgroundAndNotify
	#(#readToEndOfFileInBackgroundAndNotifyForModes: #(modes) )
	waitForDataInBackgroundAndNotify
	#(#waitForDataInBackgroundAndNotifyForModes: #(modes) )
	#(#seekToFileOffset: #(offset))
	closeFile synchronizeFile
	#(#truncateFileAtOffset: #(offset))
)!
NSFileHandle buildSetters: #(
	readabilityHandler
	writeabilityHandler
)!

! NSFileHandle class methodsFor: #instantiation !
forReadingAtPath: path
	" Returns a file handle initialized for reading the file, device, or named socket at the specified path. "

	^self @ (self nativeClass fileHandleForReadingAtPath: path)! !

! NSFileHandle class methodsFor: #instantiation !
forReadingFromURL: aNSURL error: pError
	" Returns a file handle initialized for reading the file, device, or named socket at the specified URL. "

	^self @ (self nativeClass
		fileHandleForReadingFromURL: aNSURL handle
		error: pError)! !

! NSFileHandle class methodsFor: #instantiation !
forReadingFromURL: aNSURL onError: aBlock
	" Returns a file handle initialized for reading the file, device, or named socket at the specified URL.
	Or the result of evaluating aBlock with the error.
	"

	| pError result |
	pError := self outArgument.
	result := self forReadingFromURL: aNSURL error: pError.
	(pError basicAt: #code) isNil ifTrue: [
		^result notNil ifTrue: [ result ]
	].
	^aBlock evaluateWith: NSError @ pError! !

! NSFileHandle class methodsFor: #instantiation !
forWritingAtPath: path
	" Returns a file handle initialized for writing to the file, device, or named socket at the specified path. "

	^self @ (self nativeClass fileHandleForWritingAtPath: path)! !

! NSFileHandle class methodsFor: #instantiation !
forWritingFromURL: aNSURL error: pError
	" Returns a file handle initialized for writing the file, device, or named socket at the specified URL. "

	^self @ (self nativeClass
		fileHandleForWritingFromURL: aNSURL handle
		error: pError)! !

! NSFileHandle class methodsFor: #instantiation !
forWritingFromURL: aNSURL onError: aBlock
	" Returns a file handle initialized for writing the file, device, or named socket at the specified URL.
	Or the result of evaluating aBlock with the error.
	"

	| pError result |
	pError := self outArgument.
	result := self forWritingFromURL: aNSURL error: pError.
	(pError basicAt: #code) isNil ifTrue: [
		^result notNil ifTrue: [ result ]
	].
	^aBlock evaluateWith: NSError @ pError! !

! NSFileHandle class methodsFor: #instantiation !
forUpdatingAtPath: path
	" Returns a file handle initialized for reading and writing to the file, device, or named socket at the specified path. "

	^self @ (self nativeClass fileHandleForUpdatingAtPath: path)! !

! NSFileHandle class methodsFor: #instantiation !
forUpdatingURL: aNSURL error: pError
	" Returns a file handle initialized for reading and writing the file, device, or named socket at the specified URL. "

	^self @ (self nativeClass
		fileHandleForUpdatingURL: aNSURL handle
		error: pError)! !

! NSFileHandle class methodsFor: #instantiation !
forUpdatingURL: aNSURL onError: aBlock
	" Returns a file handle initialized for reading and writing the file, device, or named socket at the specified URL.
	Or the result of evaluating aBlock with the error.
	"

	| pError result |
	pError := self outArgument.
	result := self forUpdatingURL: aNSURL error: pError.
	(pError basicAt: #code) isNil ifTrue: [
		^result notNil ifTrue: [ result ]
	].
	^aBlock evaluateWith: NSError @ pError! !

! NSFileHandle class methodsFor: #instantiation !
withStandardError
	" Returns the file handle associated with the standard error file. "

	^self @ (self nativeClass basicAt: #fileHandleWithStandardError)! !

! NSFileHandle class methodsFor: #instantiation !
withStandardInput
	" Returns the file handle associated with the standard input file. "

	^self @ (self nativeClass basicAt: #fileHandleWithStandardInput)! !

! NSFileHandle class methodsFor: #instantiation !
withStandardOutput
	" Returns the file handle associated with the standard output file. "

	^self @ (self nativeClass basicAt: #fileHandleWithStandardOutput)! !

! NSFileHandle class methodsFor: #instantiation !
withNullDevice
	" Returns the file handle associated with a null device. "

	^self @ (self nativeClass basicAt: #fileHandleWithNullDevice)! !

! NSFileHandle methodsFor: #actions !
close
	" Close the receiver. "

	^self closeFile! !

! NSFileHandle methodsFor: #actions !
synchronize
	" Synchronize the receiver. "

	^self synchronizeFile! !

! NSFileHandle methodsFor: #actions !
seekToEnd
	" Puts the file pointer at the end of the file referenced by the receiver and returns the new file offset. "

	^self seekToEndOfFile! !

! NSFileHandle methodsFor: #accessing !
offset
	" Returns the position of the file pointer within the file represented by the receiver. "

	^self offsetInFile! !

NSObject subclass: #NSFileManager!
NSFileManager comment: '
	An NSFileManager object lets you examine the contents of the file system and make changes to it.
'!
NSFileManager buildGetters: #(
	currentDirectoryPath
	ubiquityIdentityToken
)!
NSFileManager buildTypedAccessors: #(
	#(delegate #NSObject)
)!
NSFileManager buildFunctions: #(
	#(#attributesOfFileSystemForPath:error: #(path pError) #PoolDictionary)
	#(#attributesOfItemAtPath:error: #(path pError) #PoolDictionary)
	#(#changeCurrentDirectoryPath: #(path) #Boolean)
	#(#componentsToDisplayForPath: #(path) #NSArray)
	#(#contentsAtPath: #(path) #NSData)
	#(#contentsEqualAtPath:andPath: #(path1 path2) #Boolean)
	#(#contentsOfDirectoryAtPath:error: #(path pError) #NSArray)
	#(#contentsOfDirectoryAtURL:includingPropertiesForKeys:options:error: #( #(url handle) keys mask pError) #NSArray)
	#(#copyItemAtPath:toPath:error: #(srcPath dstPath pError) #Boolean)
	#(#copyItemAtURL:toURL:error: #( #(src handle) #(dst handle) pError) #Boolean)
	#(#createDirectoryAtPath:withIntermediateDirectories:attributes:error: #(path createIntermediates attributes pError) #Boolean)
	#(#createDirectoryAtURL:withIntermediateDirectories:attributes:error: #( #(url handle) createIntermediates attributes pError) #Boolean)
	#(#createFileAtPath:contents:attributes: #(path contents attributes) #Boolean)
	#(#createSymbolicLinkAtPath:withDestinationPath:error: #(path destPath pError) #Boolean)
	#(#createSymbolicLinkAtURL:withDestinationURL:error: #( #(url handle) #(destURL handle) pError) #Boolean)
	#(#destinationOfSymbolicLinkAtPath:error: #(path pError))
	#(#displayNameAtPath: #(path))
	#(#evictUbiquitousItemAtURL:error: #( #(url handle) pError) #Boolean)
	#(#fileExistsAtPath: #(path) #Boolean)
	#(#getRelationship:ofDirectoryAtURL:toItemAtURL:error: #( pOutRelationship #(directoryURL handle) #(otherURL handle) pError) #Boolean)
	#(#getRelationship:ofDirectory:inDomain:toItemAtURL:error: #( pOutRelationship #(directory handle) domainMask #(otherURL handle) pError) #Boolean)
	#(#isDeletableFileAtPath: #(path) #Boolean)
	#(#isExecutableFileAtPath: #(path) #Boolean)
	#(#isReadableFileAtPath: #(path) #Boolean)
	#(#isUbiquitousItemAtURL: #(#(url handle)) #Boolean)
	#(#isWritableFileAtPath: #(path) #Boolean)
	#(#linkItemAtPath:toPath:error: #(srcPath dstPath pError) #Boolean)
	#(#linkItemAtURL:toURL:error: #( #(srcURL handle) #(dstURL handle) pError) #Boolean)
	#(#moveItemAtPath:toPath:error: #(srcPath dstPath pError) #Boolean)
	#(#moveItemAtURL:toURL:error: #( #(src handle) #(dst handle) pError) #Boolean)
	#(#mountedVolumeURLsIncludingResourceValuesForKeys:options: #(propertyKeys options) #NSArray)
	#(#removeItemAtPath:error: #(srcPath pError) #Boolean)
	#(#removeItemAtURL:error: #( #(src handle) pError) #Boolean)
	#(#replaceItemAtURL:withItemAtURL:backupItemName:options:resultingItemURL:error: #( #(originalItemURL handle) #(newItemURL handle) backupItemName options pNSURL pError) #Boolean)
	#(#setAttributes:ofItemAtPath:error: #(attributes path pError) #Boolean)
	#(#setUbiquitous:itemAtURL:destinationURL:error: #( aBoolean #(url handle) #(destinationURL handle) pError) #Boolean)
	#(#startDownloadingUbiquitousItemAtURL:error: #( #(url handle) pError) #Boolean)
	#(#subpathsAtPath: #(path) #NSArray)
	#(#subpathsOfDirectoryAtPath:error: #(path pError) #NSArray)
	#(#trashItemAtURL:resultingItemURL:error: #( #(url handle) pOutResultingURL pError) #Boolean)
)!

! NSFileManager class methodsFor: #instantiation !
defaultManager
	" Return an instance of the receiver. "

	^self @ (self nativeClass basicAt: #defaultManager)! !

! NSFileManager class methodsFor: #instantiation !
default
	" Return an instance of the receiver. "

	^self defaultManager! !

! NSFileManager methodsFor: #accessing !
attributesOfFileSystemForPath: path

	^self attributesOfFileSystemForPath: path error: nil json! !

! NSFileManager methodsFor: #accessing !
attributesOfItemAtPath: path

	^self attributesOfItemAtPath: path error: nil json! !

! NSFileManager methodsFor: #accessing !
containerURLForSecurityApplicationGroupIdentifier: identifier

	^NSURL @ (self handle containerURLForSecurityApplicationGroupIdentifier: identifier)! !

! NSFileManager methodsFor: #accessing !
contentsOfDirectoryAtPath: path

	^self contentsOfDirectoryAtPath: path error: nil json! !

! NSFileManager methodsFor: #accessing !
contentsOfDirectoryAtURL: url includingPropertiesForKeys: keys options: mask

	^self	contentsOfDirectoryAtURL: url
		includingPropertiesForKeys: keys
		options: mask error: nil json! !

! NSFileManager methodsFor: #actions !
copyItemAtPath: src toPath: dst

	^self copyItemAtPath: src toPath: dst error: nil json! !

! NSFileManager methodsFor: #actions !
copyItemAtURL: src toURL: dst

	^self copyItemAtURL: src toURL: dst error: nil json! !

! NSFileManager methodsFor: #actions !
createDirectoryAtPath: path
	withIntermediateDirectories: createIntermediates
	attributes: attributes

	^self	createDirectoryAtPath: path
		withIntermediateDirectories: createIntermediates
		attributes: attributes error: nil json! !

! NSFileManager methodsFor: #actions !
createDirectoryAtURL: url
	withIntermediateDirectories: createIntermediates
	attributes: attributes

	^self	createDirectoryAtURL: url
		withIntermediateDirectories: createIntermediates
		attributes: attributes error: nil json! !

! NSFileManager methodsFor: #actions !
createSymbolicLinkAtPath: path withDestinationPath: destPath

	^self	createSymbolicLinkAtPath: path
		withDestinationPath: destPath
		error: nil json! !

! NSFileManager methodsFor: #actions !
createSymbolicLinkAtURL: url withDestinationURL: destURL

	^self	createSymbolicLinkAtURL: url
		withDestinationURL: destURL
		error: nil json! !

! NSFileManager methodsFor: #actions !
destinationOfSymbolicLinkAtPath: path

	^self	destinationOfSymbolicLinkAtPath: path
		error: nil json! !

! NSFileManager methodsFor: #actions !
evictUbiquitousItemAtURL: url

	^self	evictUbiquitousItemAtURL: url
		error: nil json! !

! NSFileManager methodsFor: #actions !
linkItemAtPath: srcPath toPath: dstPath

	^self	linkItemAtPath: srcPath toPath: dstPath
		error: nil json! !

! NSFileManager methodsFor: #actions !
linkItemAtURL: srcURL toURL: dstURL

	^self	linkItemAtURL: srcURL toURL: dstURL
		error: nil json! !

! NSFileManager methodsFor: #actions !
mountedVolumeURLsIncludingResourceValuesForKeys: propertyKeys options: options

	^(self handle
		mountedVolumeURLsIncludingResourceValuesForKeys: propertyKeys
		options: options) collect: [:each| NSURL @ each ]! !

! NSFileManager methodsFor: #actions !
moveItemAtPath: src toPath: dst

	^self moveItemAtPath: src toPath: dst error: nil json! !

! NSFileManager methodsFor: #actions !
moveItemAtURL: src toURL: dst

	^self moveItemAtURL: src toURL: dst error: nil json! !

! NSFileManager methodsFor: #actions !
removeItemAtPath: src

	^self removeItemAtPath: src error: nil json! !

! NSFileManager methodsFor: #actions !
removeItemAtURL: src

	^self removeItemAtURL: src error: nil json! !

! NSFileManager methodsFor: #actions !
setAttributes: attributes ofItemAtPath: src

	^self setAttributes: attributes ofItemAtPath: src error: nil json! !

! NSFileManager methodsFor: #actions !
setUbiquitous: aBoolean itemAtURL: url destinationURL: destinationURL

	^self	setUbiquitous: aBoolean
		itemAtURL: url
		destinationURL: destinationURL
		error: nil json! !

! NSFileManager methodsFor: #actions !
startDownloadingUbiquitousItemAtURL: url

	^self	startDownloadingUbiquitousItemAtURL: url
		error: nil json! !

! NSFileManager methodsFor: #actions !
subpathsOfDirectoryAtPath: path

	^self	subpathsOfDirectoryAtPath: path
		error: nil json! !

! NSFileManager class methodsFor: #hooks !
installHooks
	" Private - Install native iOS hooks. "

	[:fileName| | result |
		result := self xmlHttpRequest: fileName.
		result isNil
			ifTrue: [ fileName fileOrURLContents ]
			ifFalse: [ result ]
	] installAs: #read.
	[:fileName :aString :mode |
		self output: aString toFile: fileName asLocalPathName mode: mode
	] installAs: #fileWrite.
	[:status | self error: 'iOS applications cant quit.' ] installAs: #quit.
	[:fileName| # #eval: fileName fileContents ] installAs: #load.! !

! NSFileManager class methodsFor: #io !
xmlHttpRequest: url
	" Private - Return contents read at url String (or nil). "

	| xmlhttp request |
	xmlhttp := Smalltalk at: #XMLHttpRequest ifAbsent: [
		"self print: 'Missing XMLHttpRequest support'."
		^nil
	].
	request := xmlhttp new.
	request open: #GET url: url async: false; send.
	^request status = 200 ifTrue: [ request responseText ] ! !

! String methodsFor: 'Foundation-io' !
isLocalPathName
	" Return true if the receiver can specify local pathName. "

	^((self upTo: $/) includes: $:) not! !

! String methodsFor: 'Foundation-io' !
asLocalPathName
	" Return the receiver as a local pathName. "

	self first = $/ ifTrue: [ ^'' ,self ].
	^NSObject documentsDirectory ,$/ ,self! !

! NSFileManager class methodsFor: #io !
output: aString toFile: localPathName mode: mode
	" Private - Set the contents of the file at localPathName (or nil). "

	mode = #ab ifTrue: [
		^JSCocoa current append: aString toFile: localPathName
	].
	^JSCocoa current output: aString toFile: localPathName! !

! NSFileManager class methodsFor: #io !
output: aString toFile: localPathName
	" Private - Set the contents of the file at localPathName (or nil). "

	^self output: aString toFile: localPathName mode: #wb! !

! NSFileManager class methodsFor: #io !
fileContents: aPathName
	" Private - Return the contents of the file at aPathName (or nil). "

	| path result |
	path := (aPathName includes: $/)
		ifFalse: [ NSBundle mainBundle pathForResource: aPathName ]
		ifTrue: [ aPathName ].
	path isNil ifTrue: [ ^nil ].
	result := NSString withContentsOfFile: path.
	^result notNil ifTrue: [ result toString ]! !

! String methodsFor: 'Foundation-io' !
fileContents
	" Return the contents of file stored at fileName given by the receiver.
	Return nil if the file do not exist.
	"

	Smalltalk nativeObjectAt: #__jsc__ ifAbsent: [ ^# #read: self ].
	self isLocalPathName ifTrue: [ ^NSFileManager fileContents: self asLocalPathName ].
	^# #read: self! !

! String methodsFor: 'Foundation-io' !
urlContents
	" Return the contents at URL given by the receiver.
	Return nil if the resource do not exist or API not available.
	"

	| result |
	Smalltalk nativeObjectAt: #__jsc__ ifAbsent: [ ^nil ].
	result := NSString withContentsOfURL: self asNSURL.
	^result notNil ifTrue: [ result toString ]! !

! String methodsFor: 'Foundation-io' !
isURLAddress
	" Return true if the receiver is considered an URL address. "

	| protocoll |
	protocoll := ((self upTo: $/) upTo: $:) asLowercase.
	^#( #http #https ) includes: protocoll! !

! String methodsFor: 'Foundation-io' !
fileOrURLContents
	" Return the contents at the receiver (an URL or fileName).
	Return nil if the resource do not exist or API not available.
	"

	^self isURLAddress
		ifTrue: [ self urlContents ]
		ifFalse: [ self fileContents ]! !

NSObject subclass: #NSError!
NSError buildGetters: #(
	domain userInfo
	localizedDescription
	localizedRecoveryOptions
	localizedRecoverySuggestion
	localizedFailureReason
	helpAnchor
)!
NSError buildNumberGetters: #(
	code
)!
NSError buildTypedGetters: #(
	#( recoveryAttempter #NSObject )
)!
! NSError class methodsFor: #instantiation !
errorWithDomain: domain code: code userInfo: userInfo
	" Return an instance of the receiver. "

	^self @ (self nativeClass
		errorWithDomain: domain
                           code: code
                       userInfo: userInfo json)! !

! NSError class methodsFor: #instantiation !
withDomain: domain code: code userInfo: userInfo
	" Return an instance of the receiver. "

	^self @ (self nativeClass
		instanceWithDomain: domain
                           code: code
                       userInfo: userInfo json)! !

! NSError methodsFor: #accessing !
description
	" Return the description of the receiver. "

	^'[',self code,'] ',self localizedDescription! !

NSObject subclass: #NSDate!
NSDate buildFunctions: #(
	#(#isEqualToDate: #(#(aNSDate handle)) #Boolean)
	#(#earlierDate: #(#(aNSDate handle)) #NSDate)
	#(#laterDate: #(#(aNSDate handle)) #NSDate)
	#(#compare: #(#(aNSDate handle)))
	#(#timeIntervalSinceDate: #(#(aNSDate handle)))
	timeIntervalSinceNow
	timeIntervalSinceReferenceDate
	timeIntervalSince1970
	#(#dateByAddingTimeInterval: #(seconds) #NSDate)
	description
	#(#descriptionWithLocale: #(#(aNSLocale handle)))
)!
! NSDate class methodsFor: #instantiation !
date
	" Return an instance of the receiver. "

	^self @ (self nativeClass basicAt: #date)! !

! NSDate class methodsFor: #constants !
timeIntervalSinceReferenceDate

	^self nativeClass basicAt: #timeIntervalSinceReferenceDate! !

! NSDate class methodsFor: #instantiation !
distantFuture
	" Return an instance of the receiver. "

	^self @ (self nativeClass basicAt: #distantFuture)! !

! NSDate class methodsFor: #instantiation !
distantPast
	" Return an instance of the receiver. "

	^self @ (self nativeClass basicAt: #distantPast)! !

! NSDate class methodsFor: #instantiation !
dateWithTimeIntervalSinceNow: seconds
	" Return an instance of the receiver. "

	^self @ (self nativeClass dateWithTimeIntervalSinceNow: seconds)! !

! NSDate class methodsFor: #instantiation !
dateWithTimeInterval: seconds sinceDate: aNSDate
	" Return an instance of the receiver. "

	^self @ (self nativeClass
		dateWithTimeInterval: seconds
		sinceDate: aNSDate handle)! !

! NSDate class methodsFor: #instantiation !
dateWithTimeIntervalSinceReferenceDate: seconds
	" Return an instance of the receiver. "

	^self @ (self nativeClass dateWithTimeIntervalSinceReferenceDate: seconds)! !

! NSDate class methodsFor: #instantiation !
dateWithTimeIntervalSince1970: seconds
	" Return an instance of the receiver. "

	^self @ (self nativeClass dateWithTimeIntervalSince1970: seconds)! !

! NSDate class methodsFor: #instantiation !
fromDateTime: aDateTime
	" Return an instance of the receiver. "

	|interval|
	interval := aDateTime asMilliseconds * 0.001.
	^self dateWithTimeIntervalSince1970: interval! !

! NSDate methodsFor: #converting !
asDateTime
	" Return a DataTime instance representing the same date and time as the receiver"

	^DateTime new: self timeIntervalSince1970 * 1000 ! !


NSObject subclass: #NSBlock!
NSObject subclass: #NSOperation!
NSOperation buildAccessors: #(
	name qualityOfService queuePriority
)!
NSOperation buildFunctions: #(
	start main cancel waitUntilFinished
	#(#addDependency: #(#(operation handle)))
	#(#removeDependency: #(#(operation handle)))
)!
NSOperation buildTypedAccessors: #(
	#(completionBlock #NSBlock)
)!
NSOperation buildBooleanGetters: #(
	cancelled executing finished
	concurrent asynchronous
	ready
)!

! NSOperation methodsFor: #accessing !
dependencies

	^self handle dependencies collect: [:each| NSOperation @ each ]! !

NSOperation subclass: #NSBlockOperation!
NSBlockOperation buildFunctions: #(
	#(#addExecutionBlock: #(#(block handle)))
)!

! NSBlockOperation class methodsFor: #instantiation !
blockOperationWithBlock: block
	" Return an instance of the receiver. "

	^self @ (self nativeClass blockOperationWithBlock: block handle)! !

! NSBlockOperation methodsFor: #accessing !
executionBlocks

	^self handle executionBlocks collect: [:each| NSBlockOperation @ each ]! !

NSObject subclass: #NSOperationQueue!
NSOperationQueue buildFunctions: #(
	#(#addOperation: #(#(operation handle)))
	#(#addOperations:waitUntilFinished: #(#(operations handles) wait))
	#(#addOperationWithBlock: #(#(block handle)))
	cancelAllOperations
	waitUntilAllOperationsAreFinished
)!
NSOperationQueue buildGetters: #(
	operationCount
	qualityOfService
	suspended
)!
NSOperationQueue buildNumberAccessors: #(
	maxConcurrentOperationCount
)!
NSOperationQueue buildAccessors: #(
	name
)!

! NSOperationQueue methodsFor: #accessing !
operations

	^self handle operations collect: [:each| NSOperation @ each ]! !

! NSOperationQueue class methodsFor: #instantiation !
with: operation
	" Return an instance of the receiver. "

	^self instance
		addOperation: operation;
		yourself! !

! NSOperationQueue class methodsFor: #instantiation !
current
	" Return an instance of the receiver. "

	^self @ (self nativeClass basicAt: #currentQueue)! !

! NSOperationQueue class methodsFor: #instantiation !
main
	" Return an instance of the receiver. "

	^self @ (self nativeClass basicAt: #mainQueue)! !

! NSOperationQueue class methodsFor: #instantiation !
currentQueue
	" Return an instance of the receiver. "

	^self @ (self nativeClass basicAt: #currentQueue)! !

! NSOperationQueue class methodsFor: #instantiation !
mainQueue
	" Return an instance of the receiver. "

	^self @ (self nativeClass basicAt: #mainQueue)! !


NSObject subclass: #NSArray!
NSArray buildGetters: #(
	description
)!
NSArray buildNumberGetters: #(
	count
)!
NSArray buildTypedGetters: #(
	#(firstObject #NSObject)
	#(lastObject #NSObject)
	#(sortedArrayHint #NSData)
	#(#objectEnumerator #NSEnumerator)
	#(#reverseObjectEnumerator #NSEnumerator)
)!
NSArray buildFunctions: #(
	#(#addObserver:forKeyPath:options:context: #(#(observer handle) keyPath options pContext))
	#(#addObserver:toObjectsAtIndexes:forKeyPath:options:context: #(#(observer handle) #(indexes handle) keyPath options pContext))
	#(#arrayByAddingObject: #(#(aNSObject handle)) #NSArray)
	#(#arrayByAddingObjectsFromArray: #(#(aNSArray handle)) #NSArray)
	#(#enumerateObjectsUsingBlock: #( #(block handle) ))
	#(#containsObject: #(#(aNSObject handle)) #Boolean)
	#(#componentsJoinedByString: #(separator))
	#(#descriptionWithLocale: #(#(locale handle)))
	#(#descriptionWithLocale:indent: #(#(locale handle) level))
	#(#firstObjectCommonWithArray: #(#(aNSArray handle)) #NSObject)
	#(#fileteredArrayUsingPredicate: #(#(predicate handle)) #NSArray)
	#(#indexOfObject: #(#(anNSObject handle)) )
	#(#indexOfObject:inRange: #(#(anNSObject handle) #(aNSRange handle)) )
	#(#indexOfObjectIdenticalTo: #(#(anNSObject handle)) )
	#(#indexOfObjectIdenticalTo:inRange: #(#(anNSObject handle) #(aNSRange handle)) )
	#(#isEqualToArray: #(#(aNSArray handle)) #Boolean)
	#(#objectAtIndex: #(index) #NSObject)
	#(#objectAtIndexedSubscript: #(idx) #NSObject)
	#(#objectAtIndexes: #(#(indexes handle)) #NSArray)
	#(#pathsMatchingExtensions: #(#(filterTypes handle)) #NSArray)
	#(#removeObserver:forKeyPath: #(#(observer handle) keyPath))
	#(#removeObserver:forKeyPath:context: #(#(observer handle) keyPath pContext))
	#(#removeObserver:fromObjectsAtIndexes:forKeyPath:context: #(#(observer handle) #(indexes handle) keyPath pContext))
	#(#removeObserver:fromObjectsAtIndexes:forKeyPath: #(#(observer handle) #(indexes handle) keyPath))
	#(#setValue:forKey: #(#(value handle) key))
	#(#sortedArrayUsingDescriptors: #(#(sortDescriptors handle)) #NSArray)
	#(#sortedArrayUsingSelector: #(comparator) #NSArray)
	#(#subarrayWithRange: #(#(aNSRange handle)) #NSArray)
	#(#valueForKey: #(key) #NSObject)
	#(#writeToFile:atomically: #(pathName flag) #Boolean)
	#(#writeToURL:atomically: #(#(aNSURL handle) flag) #Boolean)
)!

! NSArray class methodsFor: #instantiation !
@ aHandle
	" Return an instance of the receiver. "

	((self isObject: aHandle) and: [ aHandle isArray ]) ifTrue: [
		^self withArray: aHandle
	].
	^super @ aHandle! !

! NSArray class methodsFor: #instantiation !
empty
	" Return an instance of the receiver. "

	^self @ (self nativeClass basicAt: #array)! !

! NSArray class methodsFor: #instantiation !
withArray: anArray
	" Return an instance of the receiver. "

	^self @ (self nativeClass arrayWithArray: anArray)! !

! NSArray class methodsFor: #instantiation !
withContentsOfFile: aPath
	" Return an instance of the receiver. "

	^self @ (self nativeClass arrayWithContentsOfFile: aPath)! !

! NSArray class methodsFor: #instantiation !
withContentsOfURL: aNSURL
	" Return an instance of the receiver. "

	^self @ (self nativeClass arrayWithContentsOfURL: aNSURL handle)! !

! NSArray class methodsFor: #instantiation !
withObject: aNSObject
	" Return an instance of the receiver. "

	^self @ (self nativeClass arrayWithObject: aNSObject handle)! !

! NSArray methodsFor: #converting !
asArray
	" Return an Array with the elements of the receiver. "

	| result |
	result := Array new.
	self enumerateObjectsUsingBlock: (S8BlockAdaptor
		for: [:obj :index| result add: obj. false ]
		encoding: 'v@:@N*').
	^result! !

! NSArray methodsFor: #accessing !
size
	" Return the size of the receiver. "

	^self count! !

! Collection methodsFor: 'Foundation-converting' !
asNSArray
	" Return an NSArray with the contents of the receiver. "

	^NSArray withArray: self asArray! !


NSObject subclass: #NSUUID!
! NSUUID class methodsFor: #instantiation !
@ aHandle
	" Return an instance of the receiver. "

	((self isObject: aHandle) and: [ aHandle isString ]) ifTrue: [
		^self withUUIDString: aHandle
	].
	^super @ aHandle! !

! NSUUID class methodsFor: #instantiation !
uuid
	" Return an instance of the receiver. "

	^self @ (self nativeClass basicAt: #UUID)! !

! NSUUID class methodsFor: #instantiation !
withUUIDString: aString
	" Return an instance of the receiver. "

	^self @ (self nativeClass instanceWithUUIDString: aString)! !

! NSUUID methodsFor: #accessing !
uuidString
	" Return the string representation of the receiver. "

	^self handle basicAt: #UUIDString! !

NSObject subclass: #NSData!
! NSData class methodsFor: #instantiation !
empty
	" Return an instance of the receiver. "

	^self @ (self nativeClass basicAt: #data)! !

! NSData class methodsFor: #instantiation !
data
	" Return an instance of the receiver. "

	^self @ (self nativeClass basicAt: #data)! !

! NSData class methodsFor: #instantiation !
withBytes: bytes length: length
	" Return an instance of the receiver. "

	^self @ (self nativeClass
		dataWithBytes: bytes
		length: length)! !

! NSData class methodsFor: #instantiation !
withBytesNoCopy: bytes length: length
	" Return an instance of the receiver. "

	^self @ (self nativeClass
		dataWithBytesNoCopy: bytes
		length: length)! !

! NSData class methodsFor: #instantiation !
withBytesNoCopy: bytes length: length freeWhenDone: aBoolean
	" Return an instance of the receiver. "

	^self @ (self nativeClass
		dataWithBytesNoCopy: bytes
		length: length
		freeWhenDone: aBoolean)! !

! NSData class methodsFor: #instantiation !
withContentsOfFile: absolutePathName
	" Return an instance of the receiver. "

	^self @ (self nativeClass
		dataWithContentsOfFile: absolutePathName)! !

! NSData class methodsFor: #instantiation !
withContentsOfFile: absolutePathName options: mask error: errorPtr
	" Return an instance of the receiver. "

	^self @ (self nativeClass
		dataWithContentsOfFile: absolutePathName
		options: mask error: errorPtr)! !

! NSData class methodsFor: #instantiation !
withContentsOfURL: anURL
	" Return an instance of the receiver. "

	^self @ (self nativeClass
		dataWithContentsOfURL: anURL handle)! !

! NSData class methodsFor: #instantiation !
withContentsOfURL: anURL options: mask error: errorPtr
	" Return an instance of the receiver. "

	^self @ (self nativeClass
		dataWithContentsOfURL: anURL handle
		options: mask error: errorPtr)! !

! NSData class methodsFor: #instantiation !
with: aNSData
	" Return an instance of the receiver. "

	^self @ (self nativeClass dataWithData: aNSData handle)! !

! NSData class methodsFor: #instantiation !
fromPointer: aNSDataPtr
	" Return an instance of the receiver. "

	^self @ (self nativeClass dataWithData: aNSDataPtr)! !

! NSData class methodsFor: #instantiation !
fromString: aString
	" Return an instance of the receiver. "

	^JSCocoaController current dataFromNSString: aString toString! !

NSData buildGetters: #(
	bytes description length
)!
NSData buildFunctions: #(
	#(#enumerateByteRangesUsingBlock: #( #(aNSBlock handle) ))
	#(#getBytes:length: #( buffer length ))
	#(#getBytes:range: #( buffer #(range handle) ))
	#(#subdataWithRange: #( #(range handle) ) #NSData )
	#(#rangeOfData:options:range: #( #(dataToFind handle) mask #(range handle) ) #NSRange )
	#(#base64EncodedDataWithOptions: #( options ) #NSData )
	#(#base64EncodedStringWithOptions: #( options ) )
	#(#isEqualToData: #(#(otherData handle)) #Boolean)
	#(#writeToFile:atomically: #( path aBoolean ) #Boolean )
	#(#writeToFile:options:error: #( path mask errorPtr ) #Boolean )
	#(#writeToURL:atomically: #( #(anURL handle) aBoolean ) #Boolean )
	#(#writeToURL:options:error: #( #(anURL handle) mask errorPtr ) #Boolean )
)!

! NSData methodsFor: #equal !
= aNSData
	" Return true if the receiver is equal to aNSData. "

	^super = aNSData or: [
		(aNSData isKindOf: self class) and: [
			self isEqualToData: aNSData
		]
	]! !

! NSData methodsFor: #converting !
string
	" Return the contents of the receiver converted to (UTF8) String. "

	^(JSCocoaController current stringFromNSData: self) toString! !

NSData subclass: #NSMutableData!
NSMutableData buildGetters: #(
	mutableBytes
)!
NSMutableData buildFunctions: #(
	#(#increaseLengthBy: #( count ))
	#(#appendBytes:length: #( buffer length ))
	#(#appendData: #( #(data handle)))
	#(#replaceBytesInRange:withBytes: #( #(range handle) buffer))
	#(#replaceBytesInRange:withBytes:length: #( #(range handle) buffer length))
	#(#resetBytesInRange: #( #(range handle)))
	#(#setData: #( #(data handle)))
)!

! NSMutableData class methodsFor: #instantiation !
withCapacity: count
	" Return an instance of the receiver. "

	^self @ (self nativeClass dataWithCapacity: count)! !

! NSMutableData class methodsFor: #instantiation !
withLength: count
	" Return an instance of the receiver. "

	^self @ (self nativeClass dataWithLength: count)! !

NSData subclass: #NSPurgeableData!

NSObject
	subclass: #NSAssertionHandler
	category: 'osx/Foundation'!
NSAssertionHandler buildFunctions: #( "mmm sounds wrong in documentation..."
	#(#handleFailureInFunction:file:lineNumber:description: #(functionName object fileName line) )
	#(#handleFailureInMethod:object:file:lineNumber:description: #(selector object fileName line format) )
)!

! NSAssertionHandler class methodsFor: #instantiation !
currentHandler
	" Return an instance of the receiver. "

	^self @ (self nativeClass basicAt: #currentHandler)! !

! NSAssertionHandler class methodsFor: #instantiation !
current
	" Return an instance of the receiver. "

	^self @ (self nativeClass basicAt: #currentHandler)! !

NSObject subclass: #NSAutoreleasePool!
NSAutoreleasePool buildFunctions: #(
	release drain autorelease retain
	#(#addObject: #(#(object handle)))
)!

! NSAutoreleasePool class methodsFor: #instantiation !
addObject: aNSObject
	" Return an instance of the receiver. "

	^self @ (self nativeClass addObject: aNSObject handle)! !


NSObject subclass: #NSLocale!
NSLocale buildGetters:#(
	localeIdentifier
)!
NSLocale buildFunctions: #(
	#(#displayNameForKey:value: #(#(key json) #(value json)))
	#(#objectForKey: #(#(key json)) #NSObject)
)!

! NSLocale methodsFor: #accessing !
identifier
	" Return the identifier of the receiver. "

	^self localeIdentifier! !

! NSLocale class methodsFor: #instantiation !
withLocaleIdentifier: string
	" Return an instance of the receiver. "

	^self @ (self nativeClass instanceWithLocaleIdentifier: string)! !

! NSLocale class methodsFor: #instantiation !
currentLocale
	" Return an instance of the receiver. "

	^self @ (self nativeClass basicAt: #currentLocale)! !

! NSLocale class methodsFor: #instantiation !
current
	" Return an instance of the receiver. "

	^self @ (self nativeClass basicAt: #currentLocale)! !

! NSLocale class methodsFor: #instantiation !
systemLocale
	" Return an instance of the receiver. "

	^self @ (self nativeClass basicAt: #systemLocale)! !

! NSLocale class methodsFor: #instantiation !
system
	" Return an instance of the receiver. "

	^self @ (self nativeClass basicAt: #systemLocale)! !

! NSLocale class methodsFor: #instantiation !
autoupdatingCurrentLocale
	" Return an instance of the receiver. "

	^self @ (self nativeClass basicAt: #autoupdatingCurrentLocale)! !

! NSLocale class methodsFor: #instantiation !
autoupdating
	" Return an instance of the receiver. "

	^self @ (self nativeClass basicAt: #autoupdatingCurrentLocale)! !

! NSLocale class methodsFor: #constants !
availableLocaleIdentifiers
	" Returns an array of NSString objects, each of which identifies a locale available on the system. "

	^self nativeClass basicAt: #availableLocaleIdentifiers! !

! NSLocale class methodsFor: #constants !
isoCountryCodes
	" Returns an array of NSString objects that represents all known legal country codes. "

	^self nativeClass basicAt: #ISOCountryCodes! !

! NSLocale class methodsFor: #constants !
isoCurrencyCodes
	" Returns an array of NSString objects that represents all known legal ISO Currency codes. "

	^self nativeClass basicAt: #ISOCurrencyCodes! !

! NSLocale class methodsFor: #constants !
isoLanguageCodes
	" Returns an array of NSString objects that represents all known legal ISO Language codes. "

	^self nativeClass basicAt: #ISOLanguageCodes! !

! NSLocale class methodsFor: #constants !
commonISOCurrencyCodes
	" Returns an array of common ISO currency codes. "

	^self nativeClass basicAt: #commonISOCurrencyCodes! !

! NSLocale class methodsFor: #constants !
canonicalLocaleIdentifierFromString: string
	" Returns the canonical identifier for a given locale identification string. "

	^self nativeClass canonicalLocaleIdentifierFromString: string! !

! NSLocale class methodsFor: #constants !
canonicalLocaleIdentifierFromString: string
	" Returns the canonical identifier for a given locale identification string. "

	^self nativeClass canonicalLocaleIdentifierFromString: string! !

! NSLocale class methodsFor: #constants !
componentsFromLocaleIdentifier: string
	" Returns a dictionary that is the result of parsing a locale ID. "

	^PoolDictionary @
		(self nativeClass componentsFromLocaleIdentifier: string)! !

! NSLocale class methodsFor: #constants !
localeIdentifierFromComponents: aDictionary
	" Returns a locale identifier from the components specified in a given dictionary. "

	^self nativeClass localeIdentifierFromComponents: aDictionary json! !

! NSLocale class methodsFor: #constants !
canonicalLanguageIdentifierFromString: string
	" Returns a canonical language identifier by mapping an arbitrary locale identification string to the canonical identifier. "

	^self nativeClass canonicalLanguageIdentifierFromString: string! !

! NSLocale class methodsFor: #converting !
localeIdentifierFromWindowsLocaleCode: code
	" Returns a locale identifier from a Windows locale code. "

	^self nativeClass localeIdentifierFromWindowsLocaleCode: code! !

! NSLocale class methodsFor: #converting !
windowsLocaleCodeFromLocaleIdentifier: identifier
	" Returns a Window locale code from the locale identifier. "

	^self nativeClass windowsLocaleCodeFromLocaleIdentifier: identifier! !

! NSLocale class methodsFor: #constants !
preferredLanguages
	" Returns the user's language preference order as an array of strings. "

	^self nativeClass preferredLanguages! !

! NSLocale class methodsFor: #constants !
characterDirectionForLanguage: isoLangCode
	" Returns the character direction for the specified ISO language code. "

	^self nativeClass characterDirectionForLanguage: isoLangCode! !

! NSLocale class methodsFor: #constants !
lineDirectionForLanguage: isoLangCode
	" Returns the line direction for the specified ISO language code. "

	^self nativeClass lineDirectionForLanguage: isoLangCode! !



NSObject subclass: #NSCalendar!
NSCalendar buildNumberAccessors: #(
	firstWeekday
	minimumDaysInFirstWeek
)!
NSCalendar buildTypedAccessors: #(
	#(locale #NSLocale)
	#(timeZone #NSTimeZone)
)!
NSCalendar buildGetters: #(
	calendarIdentifier
)!
NSCalendar buildFunctions: #(
	#(#maximumRangeOfUnit: #(unit) #NSRange)
	#(#minimumRangeOfUnit: #(unit) #NSRange)
	#(#ordinalityOfUnit:inUnit:forDate: #( smaller larget #(date handle) ) )
	#(#rangeOfUnit:inUnit:forDate: #( smaller larget #(date handle) ) #NSRange)
	#(#rangeOfUnit:startDate:interval:forDate: #( unit #(datep handle) tip #(date handle) ) )
	#(#components:fromDate: #(unit #(date handle)) #NSDateComponents)
	#(#components:fromDate:toDate:options: #(unit #(fromDate handle) #(toDate handle) options) #NSDateComponents)
	#(#dateByAddingComponents:toDate:options: #(#(comps handle) #(toDate handle) options) #NSDate)
	#(#dateFromComponents: #(#(comps handle)) #NSDate)
)!

! NSCalendar methodsFor: #accessing !
identifier
	" Return the identifier of the receiver. "

	^self calendarIdentifier! !

! NSCalendar class methodsFor: #instantiation !
currentCalendar
	" Return an instance of the receiver. "

	^self @ (self nativeClass basicAt: #currentCalendar)! !

! NSCalendar class methodsFor: #instantiation !
current
	" Return an instance of the receiver. "

	^self @ (self nativeClass basicAt: #currentCalendar)! !

! NSCalendar class methodsFor: #instantiation !
autoupdatingCurrentCalendar
	" Return an instance of the receiver. "

	^self @ (self nativeClass basicAt: #autoupdatingCurrentCalendar)! !

! NSCalendar class methodsFor: #instantiation !
autoupdating
	" Return an instance of the receiver. "

	^self @ (self nativeClass basicAt: #autoupdatingCurrentCalendar)! !

! NSCalendar class methodsFor: #instantiation !
withCalendarIdentifier: identifier
	" Return an instance of the receiver. "

	^self @ (self nativeClass
		instanceWithCalendarIdentifier: identifier)! !

! NSCalendar class methodsFor: #instantiation !
with: identifier
	" Return an instance of the receiver. "

	^self @ (self nativeClass
		instanceWithCalendarIdentifier: identifier)! !


NSObject subclass: #NSURLRequest!
NSURLRequest buildGetters: #(
	allHTTPHeaderFields
)!
NSURLRequest buildBooleanGetters: #(
	allowsCellularAccess
	
)!
NSURLRequest buildBooleanAccessors: #(
	supportsSecureCoding
	
)!
NSURLRequest buildNumberGetters: #(
	cachePolicy
	timeoutInterval
	networkServiceType
)!
NSURLRequest buildTypedGetters: #(
	#(mainDocumentURL #NSURL )
)!
NSURLRequest buildFunctions: #(
	#(#valueForHTTPHeaderField: #( field ))
)!

! NSURLRequest methodsFor: #accessing !
httpShouldHandleCookies

	^(1 #& (handle basicAt: #HTTPShouldHandleCookies)) notNil! !

! NSURLRequest methodsFor: #accessing !
httpShouldUsePipelining

	^(1 #& (handle basicAt: #HTTPShouldUsePipelining)) notNil! !

! NSURLRequest methodsFor: #accessing !
httpMethod

	^handle basicAt: #HTTPMethod! !

! NSURLRequest methodsFor: #accessing !
httpBodyStream

	^NSInputStream @ (handle basicAt: #HTTPBodyStream)! !

! NSURLRequest methodsFor: #accessing !
httpBody

	^NSData @ (handle basicAt: #HTTPBody)! !

! NSURLRequest methodsFor: #accessing !
url

	^NSURL @ (handle basicAt: #URL)! !

! NSURLRequest class methodsFor: #instantiation !
withURL: theURL
	" Return an instance of the receiver. "

	^self @ (self nativeClass
		requestWithURL: theURL handle)! !

! NSURLRequest class methodsFor: #instantiation !
withURL: theURL cachePolicy: cachePolicy timeoutInterval: timeoutInterval
	" Return an instance of the receiver. "

	^self @ (self nativeClass
		requestWithURL: theURL handle
		cachePolicy: cachePolicy
		timeoutInterval: timeoutInterval)! !

NSObject subclass: #NSURLResponse!
NSURLResponse buildNumberGetters: #(
	#expectedContentLength
)!
NSURLResponse buildGetters: #(
	#suggestedFilename
	#MIMEType
	#textEncodingName
)!

! NSURLResponse methodsFor: #accessing !
mimeType
	^self handle basicAt: #MIMEType! !

! NSURLResponse methodsFor: #accessing !
url
	^NSURL @ (self handle basicAt: #URL)! !

! NSURLResponse class methodsFor: #instantiation !
withURL: aNSURL MIMEType: mimeType expectedContentLength: length textEncodingName: name
	" Returns an instance of the receiver. "

	^self @ (self nativeClass
		instanceWithURL: aNSURL handle
		MIMEType: mimeType
		expectedContentLength: length
		textEncodingName: name)! !

! NSURLResponse class methodsFor: #instantiation !
withURL: aNSURL mimeType: mimeType length: length encoding: name
	" Returns an instance of the receiver. "

	^self	withURL: aNSURL MIMEType: mimeType
		expectedContentLength: length
		textEncodingName: name! !


NSURLResponse subclass: #NSHTTPURLResponse!
NSHTTPURLResponse buildNumberGetters: #(
	#statusCode
)!
NSHTTPURLResponse buildTypedGetters: #(
	#(allHeaderFields #PoolDictionary)
)!

! NSHTTPURLResponse class methodsFor: #instantiation !
withURL: aNSURL statusCode: statusCode HTTPVersion: version headerFields: headerFields
	" Returns an instance of the receiver. "

	^self @ (self nativeClass
		instanceWithURL: aNSURL handle
		statusCode: statusCode
		HTTPVersion: version
		headerFields: headerFields json)! !

! NSHTTPURLResponse class methodsFor: #constants !
localizedStringForStatusCode: statusCode
	" Returns a localized string corresponding to a specified HTTP status code. "

	^self nativeClass localizedStringForStatusCode: statusCode! !

NSObject subclass: #NSUserDefaults!
NSUserDefaults buildFunctions: #(
	#synchronize
	#(#objectForKey: #(defaultName) #NSObject)
	#(#stringForKey: #(defaultName))
	#(#setObject:forKey: #(#(value json) #defaultName))
)!

! NSUserDefaults class methodsFor: #instantiation !
standardUserDefaults

	^self @ (self nativeClass basicAt: #standardUserDefaults)! !

! NSUserDefaults class methodsFor: #accessing !
at: aName
	^self objectForKey: aName! !

! NSUserDefaults class methodsFor: #accessing !
at: aName put: aValue
	^self standardUserDefaults
		setObject: aValue
		forKey: aName! !

! NSUserDefaults class methodsFor: #constants !
objectForKey: aName

	^self standardUserDefaults objectForKey: aName! !

! NSUserDefaults class methodsFor: #constants !
stringForKey: aName

	^self standardUserDefaults stringForKey: aName! !

NSObject subclass: #NSURLCache!

! NSURLCache class methodsFor: #accessing !
sharedURLCache

	^self @ (self nativeClass basicAt: #sharedURLCache)! !

! NSURLCache class methodsFor: #accessing !
sharedURLCache: aNSURLCache

	self nativeClass setSharedURLCache: aNSURLCache handle! !

! NSURLCache class methodsFor: #instantiation !
withMemoryCapacity: memoryCapacity diskCapacity: diskCapacity diskPath: path

	^self @ (self nativeClass
		instanceWithMemoryCapacity: memoryCapacity
		diskCapacity: diskCapacity
		diskPath: path)! !

NSURLCache buildFunctions: #(
	#removeAllCachedResponses
	#(#cachedResponseForRequest: #(#(request handle)) #NSCachedURLResponse)
	#(#storeCachedResponse:forRequest: #(#(cachedResponse handle) #(request handle)))
	#(#removeCachedResponseForRequest: #(#(request handle)))
)!
NSURLCache buildNumberGetters: #(
	#currentDiskUsage
	#diskCapacity
	#currentMemoryUsage
	#memoryCapacity
)!

NSObject subclass: #NSTimeZone!

! NSTimeZone class methodsFor: #instantiation !
withAbbreviation: abbreviation

	^self @ (self nativeClass timeZoneWithAbbreviation: abbreviation)! !

! NSTimeZone class methodsFor: #instantiation !
withName: tzName

	^self @ (self nativeClass timeZoneWithName: tzName)! !

! NSTimeZone class methodsFor: #instantiation !
withName: tzName data: aNSData

	^self @ (self nativeClass timeZoneWithName: tzName data: aNSData handle)! !

! NSTimeZone class methodsFor: #instantiation !
forSecondsFromGMT: seconds

	^self @ (self nativeClass timeZoneForSecondsFromGMT: seconds)! !

! NSTimeZone class methodsFor: #instantiation !
timeZoneDataVersion

	^self nativeClass basicAt: #timeZoneDataVersion! !

! NSTimeZone class methodsFor: #instantiation !
localTimeZone

	^self @ (self nativeClass basicAt: #localTimeZone)! !

! NSTimeZone class methodsFor: #instantiation !
defaultTimeZone

	^self @ (self nativeClass basicAt: #defaultTimeZone)! !

! NSTimeZone class methodsFor: #settings !
setDefaultTimeZone: aTimeZone

	^self @ (self nativeClass setDefaultTimeZone: aTimeZone handle)! !

! NSTimeZone class methodsFor: #settings !
resetSystemTimeZone

	^self nativeClass "basicAt: #"resetSystemTimeZone! !

! NSTimeZone class methodsFor: #instantiation !
systemTimeZone

	^self @ (self nativeClass basicAt: #systemTimeZone)! !

! NSTimeZone class methodsFor: #accessing !
abbreviationDictionary

	^PoolDictionary @ (self nativeClass basicAt: #abbreviationDictionary)! !

! NSTimeZone class methodsFor: #accessing !
knownTimeZoneNames

	^NSArray @ (self nativeClass basicAt: #knownTimeZoneNames)! !

! NSTimeZone class methodsFor: #accessing !
abbreviationDictionary: aPoolDictionary

	self nativeClass setAbbreviationDictionary: aPoolDictionary json! !

NSTimeZone buildGetters: #(
	abbreviation name description
)!
NSTimeZone buildNumberGetters: #(
	secondsFromGMT
)!
NSTimeZone buildIsBooleanGetters: #(
	daylightSavingTime
)!
NSTimeZone buildTypedGetters: #(
	#(data #NSData)
	#(nextDaylightSavingTimeTransition #NSDate)
)!
NSTimeZone buildFunctions: #(
	#(#abbreviationForDate: #(#(aDate handle)))
	#(#isEqualToTimeZone: #(#(aNSTimeZone handle)) #Boolean)
	#(#localizedName:locale: #(style #(locale handle)) )
	#(#isDaylightSavingTimeForDate: #(#(aDate handle)) #Boolean)
	#(#daylightSavingTimeOffsetForDate: #(#(aDate handle)))
	#(#nextDaylightSavingTimeTransitionAfterDate: #(#(aDate handle)) #NSDate)
)!

NSObject subclass: #NSXMLParser !

! NSXMLParser class methodsFor: #instantiation !
withContentsOfURL: anURL
	" Returns an instance of the receiver. "

	^self instance initWithContentsOfURL: anURL! !

! NSXMLParser class methodsFor: #instantiation !
withData: aNSData
	" Returns an instance of the receiver. "

	^self instance initWithData: aNSData! !

NSXMLParser buildAccessors: #(
	delegate
)!
NSXMLParser buildBooleanAccessors: #(
	shouldProcessNamespaces
	shouldReportNamespacePrefixeses
	shouldResolveExternalEntities
)!
NSXMLParser buildBooleanGetters: #(
	parse
)!
NSXMLParser buildTypedGetters: #(
	#(parseError #NSError)
)!
NSXMLParser buildNumberGetters: #(
	columnNumber
	lineNumber 
	publicID
	systemID
)!
NSXMLParser buildFunctions: #(
	#(#initWithData: #(#(aNSData handle)) #NSXMLParser)
	#(#initWithContentsOfURL: #( #(url handle) ) #NSXMLParser)
	abortParsing
)!