NSFileManager.inc 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. { Parsed from Foundation.framework NSFileManager.h }
  2. {$ifdef TYPES}
  3. {$ifndef NSFILEMANAGER_PAS_T}
  4. {$define NSFILEMANAGER_PAS_T}
  5. { Defines }
  6. const
  7. NSFoundationVersionWithFileManagerResourceForkSupport = 412;
  8. { Constants }
  9. const
  10. NSVolumeEnumerationSkipHiddenVolumes = 1 shl 1;
  11. NSVolumeEnumerationProduceFileReferenceURLs = 1 shl 2;
  12. const
  13. NSDirectoryEnumerationSkipsSubdirectoryDescendants = 1 shl 0;
  14. NSDirectoryEnumerationSkipsPackageDescendants = 1 shl 1;
  15. NSDirectoryEnumerationSkipsHiddenFiles = 1 shl 2;
  16. const
  17. NSFileManagerItemReplacementUsingNewMetadataOnly = 1 shl 0;
  18. NSFileManagerItemReplacementWithoutDeletingBackupItem = 1 shl 1;
  19. { Types }
  20. type
  21. NSVolumeEnumerationOptions = NSUInteger;
  22. NSVolumeEnumerationOptionsPtr = ^NSVolumeEnumerationOptions;
  23. NSDirectoryEnumerationOptions = NSUInteger;
  24. NSDirectoryEnumerationOptionsPtr = ^NSDirectoryEnumerationOptions;
  25. NSFileManagerItemReplacementOptions = NSUInteger;
  26. NSFileManagerItemReplacementOptionsPtr = ^NSFileManagerItemReplacementOptions;
  27. {$endif}
  28. {$endif}
  29. {$ifdef RECORDS}
  30. {$ifndef NSFILEMANAGER_PAS_R}
  31. {$define NSFILEMANAGER_PAS_R}
  32. {$endif}
  33. {$endif}
  34. {$ifdef FUNCTIONS}
  35. {$ifndef NSFILEMANAGER_PAS_F}
  36. {$define NSFILEMANAGER_PAS_F}
  37. {$endif}
  38. {$endif}
  39. {$ifdef EXTERNAL_SYMBOLS}
  40. {$ifndef NSFILEMANAGER_PAS_S}
  41. {$define NSFILEMANAGER_PAS_S}
  42. { External string constants }
  43. var
  44. NSFileType: NSString; cvar; external;
  45. NSFileTypeDirectory: NSString; cvar; external;
  46. NSFileTypeRegular: NSString; cvar; external;
  47. NSFileTypeSymbolicLink: NSString; cvar; external;
  48. NSFileTypeSocket: NSString; cvar; external;
  49. NSFileTypeCharacterSpecial: NSString; cvar; external;
  50. NSFileTypeBlockSpecial: NSString; cvar; external;
  51. NSFileTypeUnknown: NSString; cvar; external;
  52. NSFileSize: NSString; cvar; external;
  53. NSFileModificationDate: NSString; cvar; external;
  54. NSFileReferenceCount: NSString; cvar; external;
  55. NSFileDeviceIdentifier: NSString; cvar; external;
  56. NSFileOwnerAccountName: NSString; cvar; external;
  57. NSFileGroupOwnerAccountName: NSString; cvar; external;
  58. NSFilePosixPermissions: NSString; cvar; external;
  59. NSFileSystemNumber: NSString; cvar; external;
  60. NSFileSystemFileNumber: NSString; cvar; external;
  61. NSFileExtensionHidden: NSString; cvar; external;
  62. NSFileHFSCreatorCode: NSString; cvar; external;
  63. NSFileHFSTypeCode: NSString; cvar; external;
  64. NSFileImmutable: NSString; cvar; external;
  65. NSFileAppendOnly: NSString; cvar; external;
  66. NSFileCreationDate: NSString; cvar; external;
  67. NSFileOwnerAccountID: NSString; cvar; external;
  68. NSFileGroupOwnerAccountID: NSString; cvar; external;
  69. NSFileBusy: NSString; cvar; external;
  70. NSFileSystemSize: NSString; cvar; external;
  71. NSFileSystemFreeSize: NSString; cvar; external;
  72. NSFileSystemNodes: NSString; cvar; external;
  73. NSFileSystemFreeNodes: NSString; cvar; external;
  74. {$endif}
  75. {$endif}
  76. {$ifdef FORWARD}
  77. NSFileManager = objcclass;
  78. NSFileManagerPointer = ^NSFileManager;
  79. NSFileManagerPtr = NSFileManagerPointer;
  80. NSDirectoryEnumerator = objcclass;
  81. NSDirectoryEnumeratorPointer = ^NSDirectoryEnumerator;
  82. NSDirectoryEnumeratorPtr = NSDirectoryEnumeratorPointer;
  83. {$endif}
  84. {$ifdef CLASSES}
  85. {$ifndef NSFILEMANAGER_PAS_C}
  86. {$define NSFILEMANAGER_PAS_C}
  87. { NSFileManager }
  88. NSFileManager = objcclass external (NSObject)
  89. public
  90. class function defaultManager: NSFileManager; message 'defaultManager';
  91. function mountedVolumeURLsIncludingResourceValuesForKeys_options(propertyKeys: NSArray; options: NSVolumeEnumerationOptions): NSArray; message 'mountedVolumeURLsIncludingResourceValuesForKeys:options:';
  92. function contentsOfDirectoryAtURL_includingPropertiesForKeys_options_error(url: NSURL; keys: NSArray; mask: NSDirectoryEnumerationOptions; error: NSErrorPointer): NSArray; message 'contentsOfDirectoryAtURL:includingPropertiesForKeys:options:error:';
  93. function URLsForDirectory_inDomains(directory: NSSearchPathDirectory; domainMask: NSSearchPathDomainMask): NSArray; message 'URLsForDirectory:inDomains:';
  94. function URLForDirectory_inDomain_appropriateForURL_create_error(directory: NSSearchPathDirectory; domain: NSSearchPathDomainMask; url: NSURL; shouldCreate: Boolean; error: NSErrorPointer): NSURL; message 'URLForDirectory:inDomain:appropriateForURL:create:error:';
  95. procedure setDelegate(delegate_: id); message 'setDelegate:';
  96. function delegate: id; message 'delegate';
  97. function setAttributes_ofItemAtPath_error(attributes: NSDictionary; path: NSString; error: NSErrorPointer): Boolean; message 'setAttributes:ofItemAtPath:error:';
  98. function createDirectoryAtPath_withIntermediateDirectories_attributes_error(path: NSString; createIntermediates: Boolean; attributes: NSDictionary; error: NSErrorPointer): Boolean; message 'createDirectoryAtPath:withIntermediateDirectories:attributes:error:';
  99. function contentsOfDirectoryAtPath_error(path: NSString; error: NSErrorPointer): NSArray; message 'contentsOfDirectoryAtPath:error:';
  100. function subpathsOfDirectoryAtPath_error(path: NSString; error: NSErrorPointer): NSArray; message 'subpathsOfDirectoryAtPath:error:';
  101. function attributesOfItemAtPath_error(path: NSString; error: NSErrorPointer): NSDictionary; message 'attributesOfItemAtPath:error:';
  102. function attributesOfFileSystemForPath_error(path: NSString; error: NSErrorPointer): NSDictionary; message 'attributesOfFileSystemForPath:error:';
  103. function createSymbolicLinkAtPath_withDestinationPath_error(path: NSString; destPath: NSString; error: NSErrorPointer): Boolean; message 'createSymbolicLinkAtPath:withDestinationPath:error:';
  104. function destinationOfSymbolicLinkAtPath_error(path: NSString; error: NSErrorPointer): NSString; message 'destinationOfSymbolicLinkAtPath:error:';
  105. function copyItemAtPath_toPath_error(srcPath: NSString; dstPath: NSString; error: NSErrorPointer): Boolean; message 'copyItemAtPath:toPath:error:';
  106. function moveItemAtPath_toPath_error(srcPath: NSString; dstPath: NSString; error: NSErrorPointer): Boolean; message 'moveItemAtPath:toPath:error:';
  107. function linkItemAtPath_toPath_error(srcPath: NSString; dstPath: NSString; error: NSErrorPointer): Boolean; message 'linkItemAtPath:toPath:error:';
  108. function removeItemAtPath_error(path: NSString; error: NSErrorPointer): Boolean; message 'removeItemAtPath:error:';
  109. function copyItemAtURL_toURL_error(srcURL: NSURL; dstURL: NSURL; error: NSErrorPointer): Boolean; message 'copyItemAtURL:toURL:error:';
  110. function moveItemAtURL_toURL_error(srcURL: NSURL; dstURL: NSURL; error: NSErrorPointer): Boolean; message 'moveItemAtURL:toURL:error:';
  111. function linkItemAtURL_toURL_error(srcURL: NSURL; dstURL: NSURL; error: NSErrorPointer): Boolean; message 'linkItemAtURL:toURL:error:';
  112. function removeItemAtURL_error(URL: NSURL; error: NSErrorPointer): Boolean; message 'removeItemAtURL:error:';
  113. function fileAttributesAtPath_traverseLink(path: NSString; yorn: Boolean): NSDictionary; message 'fileAttributesAtPath:traverseLink:'; deprecated 'in Mac OS X 10.5 and later';
  114. function changeFileAttributes_atPath(attributes: NSDictionary; path: NSString): Boolean; message 'changeFileAttributes:atPath:'; deprecated 'in Mac OS X 10.5 and later';
  115. function directoryContentsAtPath(path: NSString): NSArray; message 'directoryContentsAtPath:'; deprecated 'in Mac OS X 10.5 and later';
  116. function fileSystemAttributesAtPath(path: NSString): NSDictionary; message 'fileSystemAttributesAtPath:'; deprecated 'in Mac OS X 10.5 and later';
  117. function pathContentOfSymbolicLinkAtPath(path: NSString): NSString; message 'pathContentOfSymbolicLinkAtPath:'; deprecated 'in Mac OS X 10.5 and later';
  118. function createSymbolicLinkAtPath_pathContent(path: NSString; otherpath: NSString): Boolean; message 'createSymbolicLinkAtPath:pathContent:'; deprecated 'in Mac OS X 10.5 and later';
  119. function createDirectoryAtPath_attributes(path: NSString; attributes: NSDictionary): Boolean; message 'createDirectoryAtPath:attributes:'; deprecated 'in Mac OS X 10.5 and later';
  120. function linkPath_toPath_handler(src: NSString; dest: NSString; handler: id): Boolean; message 'linkPath:toPath:handler:'; deprecated 'in Mac OS X 10.5 and later';
  121. function copyPath_toPath_handler(src: NSString; dest: NSString; handler: id): Boolean; message 'copyPath:toPath:handler:'; deprecated 'in Mac OS X 10.5 and later';
  122. function movePath_toPath_handler(src: NSString; dest: NSString; handler: id): Boolean; message 'movePath:toPath:handler:'; deprecated 'in Mac OS X 10.5 and later';
  123. function removeFileAtPath_handler(path: NSString; handler: id): Boolean; message 'removeFileAtPath:handler:'; deprecated 'in Mac OS X 10.5 and later';
  124. function currentDirectoryPath: NSString; message 'currentDirectoryPath';
  125. function changeCurrentDirectoryPath(path: NSString): Boolean; message 'changeCurrentDirectoryPath:';
  126. function fileExistsAtPath(path: NSString): Boolean; message 'fileExistsAtPath:';
  127. function fileExistsAtPath_isDirectory(path: NSString; isDirectory: pboolean): Boolean; message 'fileExistsAtPath:isDirectory:';
  128. function isReadableFileAtPath(path: NSString): Boolean; message 'isReadableFileAtPath:';
  129. function isWritableFileAtPath(path: NSString): Boolean; message 'isWritableFileAtPath:';
  130. function isExecutableFileAtPath(path: NSString): Boolean; message 'isExecutableFileAtPath:';
  131. function isDeletableFileAtPath(path: NSString): Boolean; message 'isDeletableFileAtPath:';
  132. function contentsEqualAtPath_andPath(path: NSString; path1: NSString): Boolean; message 'contentsEqualAtPath:andPath:';
  133. function displayNameAtPath(path: NSString): NSString; message 'displayNameAtPath:';
  134. function componentsToDisplayForPath(path: NSString): NSArray; message 'componentsToDisplayForPath:';
  135. function enumeratorAtPath(path: NSString): NSDirectoryEnumerator; message 'enumeratorAtPath:';
  136. function subpathsAtPath(path: NSString): NSArray; message 'subpathsAtPath:';
  137. function contentsAtPath(path: NSString): NSData; message 'contentsAtPath:';
  138. function createFileAtPath_contents_attributes(path: NSString; data: NSData; attr: NSDictionary): Boolean; message 'createFileAtPath:contents:attributes:';
  139. function fileSystemRepresentationWithPath(path: NSString): PChar; message 'fileSystemRepresentationWithPath:';
  140. function stringWithFileSystemRepresentation_length(str: PChar; len: NSUInteger): NSString; message 'stringWithFileSystemRepresentation:length:';
  141. function replaceItemAtURL_withItemAtURL_backupItemName_options_resultingItemURL_error(originalItemURL: NSURL; newItemURL: NSURL; backupItemName: NSString; options: NSFileManagerItemReplacementOptions; resultingURL: NSURLPointer; error: NSErrorPointer): Boolean; message 'replaceItemAtURL:withItemAtURL:backupItemName:options:resultingItemURL:error:';
  142. end;
  143. { NSDirectoryEnumerator }
  144. NSDirectoryEnumerator = objcclass external (NSEnumerator)
  145. public
  146. function fileAttributes: NSDictionary; message 'fileAttributes';
  147. function directoryAttributes: NSDictionary; message 'directoryAttributes';
  148. procedure skipDescendents; message 'skipDescendents';
  149. function level: NSUInteger; message 'level';
  150. procedure skipDescendants; message 'skipDescendants';
  151. end;
  152. { NSCopyLinkMoveHandlerCategory }
  153. NSCopyLinkMoveHandlerCategory = objccategory external (NSObject)
  154. function fileManager_shouldProceedAfterError(fm: NSFileManager; errorInfo: NSDictionary): Boolean; message 'fileManager:shouldProceedAfterError:'; deprecated 'in Mac OS X 10.5 and later';
  155. procedure fileManager_willProcessPath(fm: NSFileManager; path: NSString); message 'fileManager:willProcessPath:'; deprecated 'in Mac OS X 10.5 and later';
  156. end;
  157. { NSFileManagerFileOperationAdditionsCategory }
  158. NSFileManagerFileOperationAdditionsCategory = objccategory external (NSObject)
  159. function fileManager_shouldCopyItemAtPath_toPath(fileManager: NSFileManager; srcPath: NSString; dstPath: NSString): Boolean; message 'fileManager:shouldCopyItemAtPath:toPath:';
  160. function fileManager_shouldCopyItemAtURL_toURL(fileManager: NSFileManager; srcURL: NSURL; dstURL: NSURL): Boolean; message 'fileManager:shouldCopyItemAtURL:toURL:';
  161. function fileManager_shouldProceedAfterError_copyingItemAtPath_toPath(fileManager: NSFileManager; error: NSError; srcPath: NSString; dstPath: NSString): Boolean; message 'fileManager:shouldProceedAfterError:copyingItemAtPath:toPath:';
  162. function fileManager_shouldProceedAfterError_copyingItemAtURL_toURL(fileManager: NSFileManager; error: NSError; srcURL: NSURL; dstURL: NSURL): Boolean; message 'fileManager:shouldProceedAfterError:copyingItemAtURL:toURL:';
  163. function fileManager_shouldMoveItemAtPath_toPath(fileManager: NSFileManager; srcPath: NSString; dstPath: NSString): Boolean; message 'fileManager:shouldMoveItemAtPath:toPath:';
  164. function fileManager_shouldMoveItemAtURL_toURL(fileManager: NSFileManager; srcURL: NSURL; dstURL: NSURL): Boolean; message 'fileManager:shouldMoveItemAtURL:toURL:';
  165. function fileManager_shouldProceedAfterError_movingItemAtPath_toPath(fileManager: NSFileManager; error: NSError; srcPath: NSString; dstPath: NSString): Boolean; message 'fileManager:shouldProceedAfterError:movingItemAtPath:toPath:';
  166. function fileManager_shouldProceedAfterError_movingItemAtURL_toURL(fileManager: NSFileManager; error: NSError; srcURL: NSURL; dstURL: NSURL): Boolean; message 'fileManager:shouldProceedAfterError:movingItemAtURL:toURL:';
  167. function fileManager_shouldLinkItemAtPath_toPath(fileManager: NSFileManager; srcPath: NSString; dstPath: NSString): Boolean; message 'fileManager:shouldLinkItemAtPath:toPath:';
  168. function fileManager_shouldLinkItemAtURL_toURL(fileManager: NSFileManager; srcURL: NSURL; dstURL: NSURL): Boolean; message 'fileManager:shouldLinkItemAtURL:toURL:';
  169. function fileManager_shouldProceedAfterError_linkingItemAtPath_toPath(fileManager: NSFileManager; error: NSError; srcPath: NSString; dstPath: NSString): Boolean; message 'fileManager:shouldProceedAfterError:linkingItemAtPath:toPath:';
  170. function fileManager_shouldProceedAfterError_linkingItemAtURL_toURL(fileManager: NSFileManager; error: NSError; srcURL: NSURL; dstURL: NSURL): Boolean; message 'fileManager:shouldProceedAfterError:linkingItemAtURL:toURL:';
  171. function fileManager_shouldRemoveItemAtPath(fileManager: NSFileManager; path: NSString): Boolean; message 'fileManager:shouldRemoveItemAtPath:';
  172. function fileManager_shouldRemoveItemAtURL(fileManager: NSFileManager; URL: NSURL): Boolean; message 'fileManager:shouldRemoveItemAtURL:';
  173. function fileManager_shouldProceedAfterError_removingItemAtPath(fileManager: NSFileManager; error: NSError; path: NSString): Boolean; message 'fileManager:shouldProceedAfterError:removingItemAtPath:';
  174. function fileManager_shouldProceedAfterError_removingItemAtURL(fileManager: NSFileManager; error: NSError; URL: NSURL): Boolean; message 'fileManager:shouldProceedAfterError:removingItemAtURL:';
  175. end;
  176. { NSFileAttributesCategory }
  177. NSFileAttributesCategory = objccategory external (NSDictionary)
  178. function fileSize: culonglong; message 'fileSize';
  179. function fileModificationDate: NSDate; message 'fileModificationDate';
  180. function fileType: NSString; message 'fileType';
  181. function filePosixPermissions: NSUInteger; message 'filePosixPermissions';
  182. function fileOwnerAccountName: NSString; message 'fileOwnerAccountName';
  183. function fileGroupOwnerAccountName: NSString; message 'fileGroupOwnerAccountName';
  184. function fileSystemNumber: NSInteger; message 'fileSystemNumber';
  185. function fileSystemFileNumber: NSUInteger; message 'fileSystemFileNumber';
  186. function fileExtensionHidden: Boolean; message 'fileExtensionHidden';
  187. function fileHFSCreatorCode: OSType; message 'fileHFSCreatorCode';
  188. function fileHFSTypeCode: OSType; message 'fileHFSTypeCode';
  189. function fileIsImmutable: Boolean; message 'fileIsImmutable';
  190. function fileIsAppendOnly: Boolean; message 'fileIsAppendOnly';
  191. function fileCreationDate: NSDate; message 'fileCreationDate';
  192. function fileOwnerAccountID: NSNumber; message 'fileOwnerAccountID';
  193. function fileGroupOwnerAccountID: NSNumber; message 'fileGroupOwnerAccountID';
  194. end;
  195. {$endif}
  196. {$endif}