Ticket #13426: MPIndex.h.diff
File MPIndex.h.diff, 1.9 KB (added by kirk.kelsey@…, 17 years ago) |
---|
-
MPIndex.h
33 33 * POSSIBILITY OF SUCH DAMAGE. 34 34 */ 35 35 36 /*! 37 @header 38 The MPIndex maintains an in-memory cache of all available ports and their 39 install status. 40 */ 36 41 #import <Cocoa/Cocoa.h> 37 42 #import "MPMacPorts.h" 38 43 #import "MPPort.h" … … 40 45 #define MPIndexWillSetIndex @"org.macports.framework.index.willSetIndex" 41 46 #define MPIndexDidSetIndex @"org.macports.framework.index.didSetIndex" 42 47 48 /*! 49 @class MPIndex 50 @abstract Index of all ports 51 @discussion Maintains an in-memory cache of all available ports and their 52 install status. The MPIndex class is analogous to the PortIndex files for every 53 port collection (most users have just one collection listed in 54 /opt/local/etc/macports/sources.conf). 55 */ 43 56 @interface MPIndex : MPMutableDictionary { 44 57 45 58 } 46 59 60 /*! 61 @brief Initialize a newly allocated index with enough memory for numItems ports 62 @param numItems The number of ports that the index will initially have capacity for 63 */ 64 - (id)initWithCapacity:(unsigned)numItems; 65 66 /*! 67 @brief Returns a new array conaining of all available ports 68 */ 47 69 - (NSArray *)ports; 70 71 /*! 72 @brief Returns a new array of all port names 73 */ 48 74 - (NSArray *)portNames; 49 75 76 /*! 77 @brief Loads all ports into the index from the MacPorts backend 78 */ 50 79 - (void)setIndex; 51 80 81 /*! 82 @brief Returns the port with the given name 83 @param name The name of the port 84 */ 52 85 - (MPPort *)port:(NSString *)name; 86 87 /*! 88 @brief Returns an enumerator of all ports 89 */ 53 90 - (NSEnumerator *)portEnumerator; 91 92 /*! 93 @brief Removes the port with the given name from the index 94 @param name The name of the port 95 */ 54 96 - (void)removePort:(NSString *)name; 97 98 /*! 99 @brief Adds the port to the index 100 @param port The port 101 @discussion The default state for the port is "not installed" 102 */ 55 103 - (void)setPort:(MPPort *)port; 56 104 57 105 + (Class)classForKeyedUnarchiver;