MPIndex


Index of all ports

Superclass: MPMutableDictionary
Declared In: MPIndex.h

Discussion

Maintains an in-memory cache of all available ports and their install status. The MPIndex class is analogous to the PortIndex files for every port collection (most users have just one collection listed in /opt/local/etc/macports/sources.conf).



Methods

-initWithCapacity:
Initialize a newly allocated index with enough memory for numItems ports
-ports
Returns a new array conaining of all available ports
-portNames
Returns a new array of all port names
-setIndex
Loads all ports into the index from the MacPorts backend
-port:
Returns the port with the given name
-portEnumerator
Returns an enumerator of all ports
-removePort:
Removes the port with the given name from the index
-setPort:
Adds the port to the index

initWithCapacity:


Initialize a newly allocated index with enough memory for numItems ports

- (id)initWithCapacity:(unsigned)numItems;
Parameters
numItems
The number of ports that the index will initially have capacity for


ports


Returns a new array conaining of all available ports

- (NSArray *)ports; 


portNames


Returns a new array of all port names

- (NSArray *)portNames; 


setIndex


Loads all ports into the index from the MacPorts backend

- (void)setIndex; 


port:


Returns the port with the given name

- (MPPort *)port:(NSString *)name; 
Parameters
name
The name of the port


portEnumerator


Returns an enumerator of all ports

- (NSEnumerator *)portEnumerator; 


removePort:


Removes the port with the given name from the index

- (void)removePort:(NSString *)name; 
Parameters
name
The name of the port


setPort:


Adds the port to the index

- (void)setPort:(MPPort *)port; 
Parameters
port
The port
Discussion

The default state for the port is "not installed"

Last Updated: Sunday, July 13, 2008