-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4edb7b0
commit 4f230ab
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// | ||
// File.swift | ||
// | ||
// | ||
// Created by Miguel de Icaza on 9/23/23. | ||
// | ||
|
||
import Foundation | ||
|
||
public extension GDictionary { | ||
/// Convenience subscript that uses a String as the key to access the | ||
/// elements in the dictionary. Merely wraps this on a Variant. | ||
public subscript (key: String) -> Variant? { | ||
get { | ||
return self [Variant (key)] | ||
} | ||
set { | ||
self [Variant (key)] = newValue | ||
} | ||
} | ||
|
||
/// Convenience subscript that uses a StringName as the key to access the | ||
/// elements in the dictionary. Merely wraps this on a Variant. | ||
public subscript (key: StringName) -> Variant? { | ||
get { | ||
return self [Variant (key)] | ||
} | ||
set { | ||
self [Variant (key)] = newValue | ||
} | ||
} | ||
} |