Platforms to show: All Mac Windows Linux Cross-Platform
NSFileWrapperMBS class
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
class | Cocoa Text | MBS MacBase Plugin | 15.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
A file-system node is a file, directory, or symbolic link. Instances of this class are known as file wrappers.
File wrappers represent a file-system node as an object that can be displayed as an image (and possibly edited in place), saved to the file system, or transmitted to another application.
There are three types of file wrappers:
- Regular-file file wrapper: Represents a regular file.
- Directory file wrapper: Represents a directory.
- Symbolic-link file wrapper: Represents a symbolic link.
A file wrapper has these attributes:
- Filename. Name of the file-system node the file wrapper represents.
- file-system attributes. See NSFileManager Class Reference for information on the contents of the attributes dictionary.
- Regular-file contents. Applicable only to regular-file file wrappers.
- File wrappers. Applicable only to directory file wrappers.
- Destination node. Applicable only to symbolic-link file wrappers.
- 12 properties
- property Directory as Boolean
- property fileAttributes as Dictionary
- property filename as String
- property fileWrappers as Dictionary
- property Handle as Integer
- property icon as NSImageMBS
- property preferredFilename as String
- property RegularFile as Boolean
- property regularFileContents as MemoryBlock
- property serializedRepresentation as MemoryBlock
- property SymbolicLink as Boolean
- property symbolicLinkDestinationURL as String
- 11 methods
- method addFileWrapper(child as NSFileWrapperMBS) as String
- method addRegularFileWithContents(Data as MemoryBlock, preferredFilename as string) as String
- method Constructor
- method keyForFileWrapper(child as NSFileWrapperMBS) as String
- method matchesContentsOfFile(File as FolderItem) as Boolean
- method matchesContentsOfURL(URL as String) as Boolean
- method readFromFile(File as FolderItem, Options as Integer = 0, byref Error as NSErrorMBS) as Boolean
- method readFromURL(URL as String, Options as Integer = 0, byref Error as NSErrorMBS) as Boolean
- method removeFileWrapper(child as NSFileWrapperMBS)
- method writeToFile(File as FolderItem, Options as Integer = 0, originalContentsURL as FolderItem = nil, byref Error as NSErrorMBS) as Boolean
- method writeToURL(URL as String, Options as Integer = 0, originalContentsURL as String = "", byref Error as NSErrorMBS) as Boolean
- 5 shared methods
- shared method initDirectoryWithFileWrappers(childrenByPreferredName as Dictionary) as NSFileWrapperMBS
- shared method initRegularFileWithContents(data as MemoryBlock) as NSFileWrapperMBS
- shared method initWithFile(File as folderItem, Options as Integer, byref error as NSErrorMBS) as NSFileWrapperMBS
- shared method initWithSerializedRepresentation(data as MemoryBlock) as NSFileWrapperMBS
- shared method initWithURL(URL as string, Options as Integer, byref error as NSErrorMBS) as NSFileWrapperMBS
- 4 constants
Reading Options
Constant | Value | Description |
---|---|---|
NSFileWrapperReadingImmediate | 1 | If reading with this option succeeds, then subsequent uses of fileWrappers, regularFileContents, symbolicLinkDestinationURL, and serializedRepresentation sent to the file wrapper and all its child file wrappers will fail and return nil only if an actual error occurs (for example, the volume has disappeared or the file server is unreachable)—not as a result of the user moving or deleting files. more |
NSFileWrapperReadingWithoutMapping | 2 | Whether file mapping for regular file wrappers is disallowed. more |
Writing Options
Constant | Value | Description |
---|---|---|
NSFileWrapperWritingAtomic | 1 | Whether writing is done atomically. more |
NSFileWrapperWritingWithNameUpdating | 2 | Whether descendant file wrappers’filename properties are set if the writing succeeds. more |
This class has no sub classes.
Some methods using this class:
- NSAttributedStringMBS.fileWrapperFromRange(offset as Integer, length as Integer, documentAttributes as dictionary = nil, byref Error as NSErrorMBS) as NSFileWrapperMBS
- NSAttributedStringMBS.RTFDFileWrapperFromRange(offset as Integer, length as Integer, documentAttributes as dictionary = nil) as NSFileWrapperMBS
- NSTextAttachmentMBS.Constructor(fileWrapper as NSFileWrapperMBS)
Some properties using for this class:
- NSTextAttachmentMBS.fileWrapper as NSFileWrapperMBS
Blog Entries
- MBS Xojo / Real Studio Plugins, version 16.0pr6
- MonkeyBread Software Releases the MBS Xojo / Real Studio plug-ins in version 15.0
- MBS Xojo / Real Studio Plugins, version 14.5pr4
The items on this page are in the following plugins: MBS MacBase Plugin.
NSFileVersionMBS - NSFontDescriptorMBS