[30438] users/rhwood/MacPorts.Framework

source_changes at macosforge.org source_changes at macosforge.org
Sat Oct 27 18:10:28 PDT 2007


Revision: 30438
          http://trac.macosforge.org/projects/macports/changeset/30438
Author:   rhwood at macports.org
Date:     2007-10-27 18:10:27 -0700 (Sat, 27 Oct 2007)

Log Message:
-----------
Add class MPReceipt that represents a receipt from the MacPorts registry,

Modified Paths:
--------------
    users/rhwood/MacPorts.Framework/MacPorts.Framework.xcodeproj/project.pbxproj

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

Added: users/rhwood/MacPorts.Framework/MPReceipt.h
===================================================================
--- users/rhwood/MacPorts.Framework/MPReceipt.h	                        (rev 0)
+++ users/rhwood/MacPorts.Framework/MPReceipt.h	2007-10-28 01:10:27 UTC (rev 30438)
@@ -0,0 +1,62 @@
+/*
+ *	$Id:$
+ *	MacPorts.Framework
+ *
+ *	Authors:
+ * 	Randall H. Wood <rhwood at macports.org>
+ *
+ *	Copyright (c) 2007 Randall H. Wood <rhwood at macports.org>
+ *	All rights reserved.
+ *
+ *	Redistribution and use in source and binary forms, with or without
+ *	modification, are permitted provided that the following conditions
+ *	are met:
+ *	1.	Redistributions of source code must retain the above copyright
+ *		notice, this list of conditions and the following disclaimer.
+ *	2.	Redistributions in binary form must reproduce the above copyright
+ *		notice, this list of conditions and the following disclaimer in the
+ *		documentation and/or other materials provided with the distribution.
+ *	3.	Neither the name of the copyright owner nor the names of contributors
+ *		may be used to endorse or promote products derived from this software
+ *		without specific prior written permission.
+ * 
+ *	THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ *	AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ *	IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ *	ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ *	LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ *	CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ *	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ *	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ *	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ *	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ *	POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import <Cocoa/Cocoa.h>
+#import "MPConstants.h"
+#import "MPInterpreter.h"
+#import "MPRegistery.h"
+
+ at interface MPReceipt : NSMutableDictionary {
+
+	NSMutableDictionary *embeddedDictionary;
+	
+}
+
+- (id)init;
+- (id)initWithCapacity:(unsigned)numItems;
+- (id)initWithContentsOfArray:(NSArray *)array;
+
+- (unsigned)count;
+- (NSEnumerator *)keyEnumerator;
+- (id)objectForKey:(id)aKey;
+- (void)removeObjectForKey:(id)aKey;
+- (void)setObject:(id)anObject forKey:(id)aKey;
+- (void)setDictionary:(NSDictionary *)otherDictionary;
+- (NSString *)description;
+
++ (Class)classForKeyedUnarchiver;
+- (Class)classForKeyedArchiver;
+
+ at end

Added: users/rhwood/MacPorts.Framework/MPReceipt.m
===================================================================
--- users/rhwood/MacPorts.Framework/MPReceipt.m	                        (rev 0)
+++ users/rhwood/MacPorts.Framework/MPReceipt.m	2007-10-28 01:10:27 UTC (rev 30438)
@@ -0,0 +1,118 @@
+/*
+ *	$Id:$
+ *	MacPorts.Framework
+ *
+ *	Authors:
+ * 	Randall H. Wood <rhwood at macports.org>
+ *
+ *	Copyright (c) 2007 Randall H. Wood <rhwood at macports.org>
+ *	All rights reserved.
+ *
+ *	Redistribution and use in source and binary forms, with or without
+ *	modification, are permitted provided that the following conditions
+ *	are met:
+ *	1.	Redistributions of source code must retain the above copyright
+ *		notice, this list of conditions and the following disclaimer.
+ *	2.	Redistributions in binary form must reproduce the above copyright
+ *		notice, this list of conditions and the following disclaimer in the
+ *		documentation and/or other materials provided with the distribution.
+ *	3.	Neither the name of the copyright owner nor the names of contributors
+ *		may be used to endorse or promote products derived from this software
+ *		without specific prior written permission.
+ * 
+ *	THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ *	AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ *	IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ *	ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ *	LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ *	CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ *	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ *	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ *	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ *	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ *	POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "MPReceipt.h"
+
+
+ at implementation MPReceipt
+
+- (id)init {
+	self = [super init];
+	if (self != nil) {
+		embeddedDictionary = [[NSMutableDictionary alloc] initWithCapacity:6];
+	}
+	return self;
+}
+
+- (id)initWithCapacity:(unsigned)numItems {
+	self = [super init];
+	if (self != nil) {
+		embeddedDictionary = [[NSMutableDictionary alloc] initWithCapacity:numItems];
+	}
+	return self;
+}
+
+- (id)initWithContentsOfArray:(NSArray *)array {
+	self = [super init];
+	if (self != nil) {
+		embeddedDictionary = [[NSMutableDictionary alloc] initWithObjects:array 
+																  forKeys:[NSArray arrayWithObjects:
+																	  @"name",
+																	  @"version",
+																	  @"revision",
+																	  @"variants",
+																	  @"active",
+																	  @"whatIsThis",
+																	  nil]];
+	}
+	return self;
+}
+
+- (void) dealloc {
+	[embeddedDictionary release];
+	[super dealloc];
+}
+
+#pragma NSMutableDictionary Protocal
+
+- (unsigned)count {
+	return [embeddedDictionary count];
+}
+
+- (NSEnumerator *)keyEnumerator {
+	return [embeddedDictionary keyEnumerator];
+}
+
+- (id)objectForKey:(id)aKey {
+	return [embeddedDictionary objectForKey:aKey];
+}
+
+- (void)removeObjectForKey:(id)aKey {
+	[embeddedDictionary removeObjectForKey:aKey];
+}
+
+- (void)setObject:(id)anObject forKey:(id)aKey {
+	[self willChangeValueForKey:aKey];
+	[embeddedDictionary setObject:anObject forKey:aKey];
+	[self didChangeValueForKey:aKey];
+}
+
+- (void)setDictionary:(NSDictionary *)otherDictionary {
+	[embeddedDictionary setDictionary:otherDictionary];
+}
+
+- (NSString *)description {
+	return [embeddedDictionary description];
+}
+
+- (Class)classForKeyedArchiver {
+	return [MPPort class];
+}
+
++ (Class)classForKeyedUnarchiver {
+	return [MPPort class];
+}
+
+ at end

Modified: users/rhwood/MacPorts.Framework/MacPorts.Framework.xcodeproj/project.pbxproj
===================================================================
--- users/rhwood/MacPorts.Framework/MacPorts.Framework.xcodeproj/project.pbxproj	2007-10-28 01:06:05 UTC (rev 30437)
+++ users/rhwood/MacPorts.Framework/MacPorts.Framework.xcodeproj/project.pbxproj	2007-10-28 01:10:27 UTC (rev 30438)
@@ -17,6 +17,8 @@
 		48906AFE0C4230B700A3ED8A /* MPInterpreter.m in Sources */ = {isa = PBXBuildFile; fileRef = 48906AFC0C4230B700A3ED8A /* MPInterpreter.m */; };
 		48906B100C42364200A3ED8A /* MPConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = 48906B0F0C42364200A3ED8A /* MPConstants.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		489DD92F0C94674B00595506 /* MPInterpreterTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 489DD92E0C94674B00595506 /* MPInterpreterTest.m */; };
+		48A866AA0CD364F700B521BC /* MPReceipt.h in Headers */ = {isa = PBXBuildFile; fileRef = 48A866A80CD364F700B521BC /* MPReceipt.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		48A866AB0CD364F700B521BC /* MPReceipt.m in Sources */ = {isa = PBXBuildFile; fileRef = 48A866A90CD364F700B521BC /* MPReceipt.m */; };
 		48E9925C0C82C45800219DDF /* MacPorts.h in Headers */ = {isa = PBXBuildFile; fileRef = 48E9925B0C82C45800219DDF /* MacPorts.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		48E992980C82C98C00219DDF /* Tcl.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 48E992970C82C98C00219DDF /* Tcl.framework */; };
 		48E993940C82CAAE00219DDF /* MPMacPorts.h in Headers */ = {isa = PBXBuildFile; fileRef = 48E993920C82CAAE00219DDF /* MPMacPorts.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -54,6 +56,8 @@
 		489DD8F50C94365F00595506 /* Test-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = "Test-Info.plist"; sourceTree = "<group>"; };
 		489DD92D0C94674B00595506 /* MPInterpreterTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPInterpreterTest.h; sourceTree = "<group>"; };
 		489DD92E0C94674B00595506 /* MPInterpreterTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPInterpreterTest.m; sourceTree = "<group>"; };
+		48A866A80CD364F700B521BC /* MPReceipt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPReceipt.h; sourceTree = "<group>"; };
+		48A866A90CD364F700B521BC /* MPReceipt.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPReceipt.m; sourceTree = "<group>"; };
 		48E9925B0C82C45800219DDF /* MacPorts.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacPorts.h; sourceTree = "<group>"; };
 		48E992970C82C98C00219DDF /* Tcl.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Tcl.framework; path = /System/Library/Frameworks/Tcl.framework; sourceTree = "<absolute>"; };
 		48E993920C82CAAE00219DDF /* MPMacPorts.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPMacPorts.h; sourceTree = "<group>"; };
@@ -135,6 +139,8 @@
 				489DD92E0C94674B00595506 /* MPInterpreterTest.m */,
 				48E993920C82CAAE00219DDF /* MPMacPorts.h */,
 				48E993930C82CAAE00219DDF /* MPMacPorts.m */,
+				48A866A80CD364F700B521BC /* MPReceipt.h */,
+				48A866A90CD364F700B521BC /* MPReceipt.m */,
 				487679670C98C55E00577C59 /* MPPort.h */,
 				487679680C98C55E00577C59 /* MPPort.m */,
 				488182580CC04EB300489B37 /* MPRegistery.h */,
@@ -184,6 +190,7 @@
 				487679550C98C2EB00577C59 /* MPIndex.h in Headers */,
 				487679690C98C55E00577C59 /* MPPort.h in Headers */,
 				4881825A0CC04EB300489B37 /* MPRegistery.h in Headers */,
+				48A866AA0CD364F700B521BC /* MPReceipt.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -298,6 +305,7 @@
 				487679560C98C2EB00577C59 /* MPIndex.m in Sources */,
 				4876796A0C98C55E00577C59 /* MPPort.m in Sources */,
 				4881825B0CC04EB300489B37 /* MPRegistery.m in Sources */,
+				48A866AB0CD364F700B521BC /* MPReceipt.m in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20071027/89461be8/attachment.html


More information about the macports-changes mailing list