1 /* Definition of class NSFileVersion 2 Copyright (C) 2019 Free Software Foundation, Inc. 3 4 Implemented by: Gregory Casamento <greg.casamento@gmail.com> 5 Date: Sep 2019 6 Original File by: Daniel Ferreira 7 8 This file is part of the GNUstep Library. 9 10 This library is free software; you can redistribute it and/or 11 modify it under the terms of the GNU Lesser General Public 12 License as published by the Free Software Foundation; either 13 version 2 of the License, or (at your option) any later version. 14 15 This library is distributed in the hope that it will be useful, 16 but WITHOUT ANY WARRANTY; without even the implied warranty of 17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 Lesser General Public License for more details. 19 20 You should have received a copy of the GNU Lesser General Public 21 License along with this library; if not, write to the Free 22 Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 23 Boston, MA 02110 USA. 24 */ 25 26 #ifndef __NSFileVersion_h_GNUSTEP_BASE_INCLUDE 27 #define __NSFileVersion_h_GNUSTEP_BASE_INCLUDE 28 29 #import <Foundation/NSObject.h> 30 31 @class NSArray, NSDate, NSDictionary, NSError, NSString, NSURL, NSPersonNameComponents; 32 33 #if OS_API_VERSION(MAC_OS_X_VERSION_10_7,GS_API_LATEST) 34 35 enum { 36 NSFileVersionReplacingByMoving = 1 << 0 37 }; 38 typedef NSUInteger NSFileVersionReplacingOptions; 39 40 enum { 41 NSFileVersionAddingByMoving = 1 << 0 42 }; 43 typedef NSUInteger NSFileVersionAddingOptions; 44 45 @interface NSFileVersion : NSObject 46 { 47 @private 48 NSURL *_fileURL; 49 NSURL *_contentsURL; 50 id _persistentIdentifier; 51 id _nonLocalVersion; 52 BOOL _isResolved; 53 BOOL _isDiscardable; 54 BOOL _hasThumbnail; 55 BOOL _hasLocalContents; 56 BOOL _conflict; 57 NSString *_localizedName; 58 NSString *_localizedNameOfSavingComputer; 59 NSDate *_modificationDate; 60 } 61 62 // Initializers 63 + (NSFileVersion *)currentVersionOfItemAtURL: (NSURL *)url; 64 + (NSArray *)otherVersionsOfItemAtURL: (NSURL *)url; 65 + (NSFileVersion *)versionOfItemAtURL: (NSURL *)url 66 forPersistentIdentifier: (id)persistentIdentifier; 67 + (NSURL *)temporaryDirectoryURLForNewVersionOfItemAtURL: (NSURL *)url; 68 + (NSFileVersion *)addVersionOfItemAtURL: (NSURL *)url 69 withContentsOfURL: (NSURL *)contentsURL 70 options: (NSFileVersionAddingOptions)options 71 error: (NSError **)outError; 72 + (NSArray *)unresolvedConflictVersionsOfItemAtURL: (NSURL *)url; 73 + (BOOL)removeOtherVersionsOfItemAtURL: (NSURL *)url 74 error: (NSError **)outError; 75 76 // instance methods... 77 - (BOOL) isDiscardable; 78 - (void) setDiscardable: (BOOL)flag; 79 - (BOOL) isResolved; 80 - (void) setResolved: (BOOL)flag; 81 - (NSDate *) modificationDate; 82 - (NSPersonNameComponents *) originatorNameComponents; 83 - (NSString *) localizedName; 84 - (NSString *) localizedNameOfSavingComputer; 85 - (BOOL) hasLocalContents; 86 - (BOOL) hasThumbnail; 87 - (NSURL *) URL; 88 - (BOOL) conflict; 89 - (id<NSCoding>) persistentIdentifier; 90 91 - (BOOL) removeAndReturnError: (NSError **)outError; 92 - (NSURL *) replaceItemAtURL: (NSURL *)url 93 options: (NSFileVersionReplacingOptions)options 94 error: (NSError **)error; 95 96 @end 97 98 #endif 99 #endif 100