[29007] users/rhwood/MacPorts.Framework

source_changes at macosforge.org source_changes at macosforge.org
Wed Sep 12 18:13:43 PDT 2007


Revision: 29007
          http://trac.macosforge.org/projects/macports/changeset/29007
Author:   rhwood at macports.org
Date:     2007-09-12 18:13:43 -0700 (Wed, 12 Sep 2007)

Log Message:
-----------
Create two new classes, MPIndex and MPPort, which represent an aggregate index of the information in ALL PortIndex files referenced by [MPMacPorts sources] and a Port, respectively.
Add constants supporting the MPPort class
Add both classes to the MacPorts header file

Modified Paths:
--------------
    users/rhwood/MacPorts.Framework/MPConstants.h
    users/rhwood/MacPorts.Framework/MacPorts.h

Added Paths:
-----------
    users/rhwood/MacPorts.Framework/MPIndex.h
    users/rhwood/MacPorts.Framework/MPIndex.m
    users/rhwood/MacPorts.Framework/MPPort.h
    users/rhwood/MacPorts.Framework/MPPort.m

Modified: users/rhwood/MacPorts.Framework/MPConstants.h
===================================================================
--- users/rhwood/MacPorts.Framework/MPConstants.h	2007-09-12 23:32:27 UTC (rev 29006)
+++ users/rhwood/MacPorts.Framework/MPConstants.h	2007-09-13 01:13:43 UTC (rev 29007)
@@ -8,4 +8,9 @@
  */
 
 #define	MPPackage			@"macports"
-#define MPPackageVersion	@"1.0"
\ No newline at end of file
+#define MPPackageVersion	@"1.0"
+
+#define	MPPortStateUnknown	@"Unknown"
+#define MPPortStateActive	@"Active"
+#define MPPortStateInstalled	@"Installed"
+#define MPPortStateOutdated	@"Outdated"
\ No newline at end of file

Added: users/rhwood/MacPorts.Framework/MPIndex.h
===================================================================
--- users/rhwood/MacPorts.Framework/MPIndex.h	                        (rev 0)
+++ users/rhwood/MacPorts.Framework/MPIndex.h	2007-09-13 01:13:43 UTC (rev 29007)
@@ -0,0 +1,22 @@
+//
+//  MPIndex.h
+//  MacPorts.Framework
+//
+//  Created by Randall Hansen Wood on 12/9/2007.
+//  Copyright 2007 __MyCompanyName__. All rights reserved.
+//
+
+#import <Cocoa/Cocoa.h>
+#import "MPPort.h"
+
+
+ at interface MPIndex : NSMutableDictionary {
+
+}
+
+- (MPPort *)port:(NSString *)name;
+- (NSEnumerator *)portEnumerator;
+- (void)removePort:(NSString *)name;
+- (void)setPort:(MPPort *)port;
+
+ at end

Added: users/rhwood/MacPorts.Framework/MPIndex.m
===================================================================
--- users/rhwood/MacPorts.Framework/MPIndex.m	                        (rev 0)
+++ users/rhwood/MacPorts.Framework/MPIndex.m	2007-09-13 01:13:43 UTC (rev 29007)
@@ -0,0 +1,42 @@
+//
+//  MPIndex.m
+//  MacPorts.Framework
+//
+//  Created by Randall Hansen Wood on 12/9/2007.
+//  Copyright 2007 __MyCompanyName__. All rights reserved.
+//
+
+#import "MPIndex.h"
+
+
+ at implementation MPIndex
+
+- (id) init {
+	self = [super init];
+	if (self != nil) {
+	}
+	return self;
+}
+
+- (void) dealloc {
+	[super dealloc];
+}
+
+
+- (MPPort *)port:(NSString *)name {
+	return [self objectForKey:name];
+}
+
+- (NSEnumerator *)portEnumerator {
+	return [self objectEnumerator];
+}
+
+- (void)removePort:(NSString *)name {
+	[self removeObjectForKey:name];
+}
+
+- (void)setPort:(MPPort *)port {
+	[self setObject:port forKey:[port name]];
+}
+
+ at end

Added: users/rhwood/MacPorts.Framework/MPPort.h
===================================================================
--- users/rhwood/MacPorts.Framework/MPPort.h	                        (rev 0)
+++ users/rhwood/MacPorts.Framework/MPPort.h	2007-09-13 01:13:43 UTC (rev 29007)
@@ -0,0 +1,19 @@
+//
+//  MPPort.h
+//  MacPorts.Framework
+//
+//  Created by Randall Hansen Wood on 12/9/2007.
+//  Copyright 2007 __MyCompanyName__. All rights reserved.
+//
+
+#import <Cocoa/Cocoa.h>
+
+
+ at interface MPPort : NSMutableDictionary {
+
+}
+
+- (NSString *)name;
+- (NSString *)version;
+
+ at end

Added: users/rhwood/MacPorts.Framework/MPPort.m
===================================================================
--- users/rhwood/MacPorts.Framework/MPPort.m	                        (rev 0)
+++ users/rhwood/MacPorts.Framework/MPPort.m	2007-09-13 01:13:43 UTC (rev 29007)
@@ -0,0 +1,35 @@
+//
+//  MPPort.m
+//  MacPorts.Framework
+//
+//  Created by Randall Hansen Wood on 12/9/2007.
+//  Copyright 2007 __MyCompanyName__. All rights reserved.
+//
+
+#import "MPPort.h"
+
+
+ at implementation MPPort
+
+- (id) init {
+	self = [super init];
+	if (self != nil) {
+		[self setObject:MPPortStateUnknown forKey:@"state"];
+	}
+	return self;
+}
+
+- (void) dealloc {
+	[super dealloc];
+}
+
+
+- (NSString *)name {
+	return [self objectForKey:@"name"];
+}
+
+- (NSString *)version {
+	return [self objectForKey:@"version"];
+}
+
+ at end

Modified: users/rhwood/MacPorts.Framework/MacPorts.h
===================================================================
--- users/rhwood/MacPorts.Framework/MacPorts.h	2007-09-12 23:32:27 UTC (rev 29006)
+++ users/rhwood/MacPorts.Framework/MacPorts.h	2007-09-13 01:13:43 UTC (rev 29007)
@@ -8,5 +8,7 @@
  */
 
 #import <MacPorts/MPConstants.h>;
+#import <MacPorts/MPIndex.h>;
 #import <MacPorts/MPInterpreter.h>;
 #import <MacPorts/MPMacPorts.h>;
+#import <MacPorts/MPPort.h>;

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20070912/8873c955/attachment.html


More information about the macports-changes mailing list