addFilesMatchingPrefix:forChildrenOfDirectory:toMutableArray: |
- ( void ) addFilesMatchingPrefix: (NSString *) partialName forChildrenOfDirectory: (NSString *) dirPath toMutableArray: (NSMutableArray *) matches;
Collects children of the given directory that start with the given prefix. Looking at every file in the given directory, finds any that start with the given prefix. Case-sensitive matches are looked for first, but if none are found, case-insensitive is allowed.
- partialName
- The partial name that the children are required to match. If this is nil, then all children are considered to match.
- dirPath
- The path to the directory to look in.
- matches
- An NSMutableArray to add any matches to.
appendsSlashOnDirectoryMatch |
- ( BOOL ) appendsSlashOnDirectoryMatch;
Returns whether a slash should be appended after a directory completion. If YES, then after a complete directory completion, a slash will be appended. Default is YES.
appendsSpaceOnFileMatch |
- ( BOOL ) appendsSpaceOnFileMatch;
Returns whether a space should be appended after a non-directory completion. If YES, then after a complete plain filename completion, a space will be appended. Default is NO.
basePathFromProposedBasePath:path: |
- ( NSString *) basePathFromProposedBasePath: (NSString *) basePath path: (NSString *) path;
Calculates the base path to use for the given path. This returns a standardized copy of basePath if path is not absolute, otherwise it returns nil.
- basePath
- The basePath passed into the main entry point methods.
- path
- The path prefix passed in as the prefix string to the main entry point methods.
fullStringForPrefixString:completionString:isInitialPrefixMatch:basePath: |
- ( NSString *) fullStringForPrefixString: (NSString *) prefixStr completionString: (NSString *) completionStr isInitialPrefixMatch: (BOOL ) initialPrefixMatch basePath: (NSString *) basePath;
MOFileCompletionStrategy overrides this method to append the prefix and completion together as path components. Also, if initialPrefixMatch is NO then the appendsSpaceOnFileMatch or appendsSlashOnDirectoryMatch setting is taken into account and a space or slash is added if needed.
- prefixStr
- The prefix string (directory path).
- completionStr
- The completion string (last path component).
- initialPrefixMatch
- If this is NO, then the appendsSpaceOnFileMatch or appendsSlashOnDirectoryMatch settings are taken into account and a space or slash may be appended to the resulting full string.
- basePath
- MOFileCompletionStrategy uses this as a path that serves as the base for evaluating relative paths.
matchesForPrefixString:newPrefixString:basePath: |
- ( NSArray *) matchesForPrefixString: (NSString *) path newPrefixString: (NSString **) newStr basePath: (NSString *) basePath;
This method first splits the prefix string into two pieces. The first is the prefix up to the last path separator character and the second is the last (partial) path component. Then, the first part (the directory path) and the base path are passed to -basePathFromProposedBasePath:path: to find the effective basePath to use. Then, the effective basePath is prepended to the directory path and the result, along with the partial last path component are passed to -addFilesMatchingPrefix:forChildrenOfDirectory:toMutableArray: to generate the actual matches. Finally, the new prefix string (the directory path) is assigned to *newStr.
- str
- The prefix string (path) that completions should be done against.
- newStr
- MOFileCompletionStrategy changes the prefix to remove the last partial path component. Then the results array is returned containing full path components.
- basePath
- MOFileCompletionStrategy uses this as a path that serves as the base for evaluating relative paths.
setAppendsSlashOnDirectoryMatch: |
- ( void ) setAppendsSlashOnDirectoryMatch: (BOOL ) flag;
Sets whether a slash should be appended after a directory completion. If YES, then after a complete directory completion, a slash will be appended. Default is YES.
- flag
- Whether a slash should be appended after a directory completion.
setAppendsSpaceOnFileMatch: |
- ( void ) setAppendsSpaceOnFileMatch: (BOOL ) flag;
Sets whether a space should be appended after a non-directory completion. If YES, then after a complete plain filename completion, a space will be appended. Default is NO.
- flag
- Whether a space should be appended after a non-directory completion.
(Last Updated 3/20/2005)