diff dwt/internal/cocoa/NSMutableDictionary.d @ 0:380af2bdd8e5

Upload of whole dwt tree
author Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
date Sat, 09 Aug 2008 17:00:02 +0200
parents
children 8b48be5454ce
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/dwt/internal/cocoa/NSMutableDictionary.d	Sat Aug 09 17:00:02 2008 +0200
@@ -0,0 +1,89 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     
+ * Port to the D Programming language:
+ *     Jacob Carlborg <jacob.carlborg@gmail.com>
+ *******************************************************************************/
+module dwt.internal.cocoa.NSMutableDictionary;
+
+import dwt.internal.cocoa.id;
+import dwt.internal.cocoa.NSArray;
+import dwt.internal.cocoa.NSDictionary;
+import dwt.internal.cocoa.NSInteger;
+import dwt.internal.cocoa.NSString;
+import dwt.internal.cocoa.OS;
+import objc = dwt.internal.objc.runtime;
+
+public class NSMutableDictionary : NSDictionary
+{
+
+    public this ()
+    {
+        super();
+    }
+
+    public this (objc.id id)
+    {
+        super(id);
+    }
+
+    public void addEntriesFromDictionary (NSDictionary otherDictionary)
+    {
+        OS.objc_msgSend(this.id, OS.sel_addEntriesFromDictionary_1, otherDictionary !is null ? otherDictionary.id : null);
+    }
+
+    public static NSMutableDictionary dictionaryWithCapacity (NSUInteger numItems)
+    {
+        objc.id result = OS.objc_msgSend(OS.class_NSMutableDictionary, OS.sel_dictionaryWithCapacity_1, numItems);
+        return result !is null ? new NSMutableDictionary(result) : null;
+    }
+
+    public NSMutableDictionary initWithCapacity (NSUInteger numItems)
+    {
+        objc.id result = OS.objc_msgSend(this.id, OS.sel_initWithCapacity_1, numItems);
+        return result !is null ? this : null;
+    }
+
+    public void removeAllObjects ()
+    {
+        OS.objc_msgSend(this.id, OS.sel_removeAllObjects);
+    }
+
+    public void removeObjectForKey (id aKey)
+    {
+        OS.objc_msgSend(this.id, OS.sel_removeObjectForKey_1, aKey !is null ? aKey.id : null);
+    }
+
+    public void removeObjectsForKeys (NSArray keyArray)
+    {
+        OS.objc_msgSend(this.id, OS.sel_removeObjectsForKeys_1, keyArray !is null ? keyArray.id : null);
+    }
+
+    public void setDictionary (NSDictionary otherDictionary)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setDictionary_1, otherDictionary !is null ? otherDictionary.id : null);
+    }
+
+    public void setObject (id anObject, id aKey)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setObject_1forKey_1, anObject !is null ? anObject.id : null, aKey !is null ? aKey.id : null);
+    }
+
+    public void setObject (id anObject, objc.id aKey)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setObject_1forKey_1, anObject !is null ? anObject.id : null, aKey);
+    }
+
+    public void setValue (id value, NSString key)
+    {
+        OS.objc_msgSend(this.id, OS.sel_setValue_1forKey_1, value !is null ? value.id : null, key !is null ? key.id : null);
+    }
+
+}