summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Sotoudeh <matthewsot@outlook.com>2014-06-24 18:10:54 -0400
committerMatthew Sotoudeh <matthewsot@outlook.com>2014-06-24 18:10:54 -0400
commit7ba33a5ccdec7b27832ade0dbd904edcc6387b26 (patch)
tree1c5bf8b2ed6cd2d72f880a52b1bbc5c78095da28
parente5ce82bf56d8e794e3c76e0f7c49310ef6a6a7ce (diff)
re-did NSKeyValueCoding interface
-rw-r--r--CocoaSharp/Foundation/Constants.cs4
-rw-r--r--CocoaSharp/Foundation/NSBlockOperation.cs64
-rw-r--r--CocoaSharp/Foundation/NSCachedURLResponse.cs2
-rw-r--r--CocoaSharp/Foundation/NSCalendar.cs249
-rw-r--r--CocoaSharp/Foundation/Protocols/NSKeyValueCoding.cs252
-rw-r--r--StubGen/StubGen/Scraper.cs18
6 files changed, 417 insertions, 172 deletions
diff --git a/CocoaSharp/Foundation/Constants.cs b/CocoaSharp/Foundation/Constants.cs
index f0f5790b..79bb7877 100644
--- a/CocoaSharp/Foundation/Constants.cs
+++ b/CocoaSharp/Foundation/Constants.cs
@@ -183,7 +183,7 @@ namespace Foundation
[iOSVersion(4)] PreferencePanesDirectory,
/// <summary>
- /// TODO: ApplicationScriptsDirectory
+ /// No info
/// </summary>
ApplicationScriptsDirectory,
@@ -203,7 +203,7 @@ namespace Foundation
[iOSVersion(2)] AllLibrariesDirectory,
/// <summary>
- /// TODO: TrashDirectory
+ /// No info
/// </summary>
TrashDirectory,
}
diff --git a/CocoaSharp/Foundation/NSBlockOperation.cs b/CocoaSharp/Foundation/NSBlockOperation.cs
index 78294558..3dbf7df1 100644
--- a/CocoaSharp/Foundation/NSBlockOperation.cs
+++ b/CocoaSharp/Foundation/NSBlockOperation.cs
@@ -4,37 +4,35 @@ using SwiftSharp.Attributes;
namespace Foundation
{
- //https://developer.apple.com/library/prerelease/ios/documentation/Cocoa/Reference/NSBlockOperation_class/index.html#//apple_ref/occ/cl/NSBlockOperation
- /// <summary>
- /// The NSBlockOperation class is a concrete subclass of NSOperation that manages the concurrent execution of one or more blocks. You can use this object to execute several blocks at once without having to create separate operation objects for each. When executing more than one block, the operation itself is considered finished only when all blocks have finished executing.
- /// </summary>
- [iOSVersion(4)]
- public class NSBlockOperation : NSOperation
- {
- //TODO: check the blocks
-
- /// <summary>
- /// Creates and returns an NSBlockOperation object and adds the specified block to it.
- /// </summary>
- /// <param name="block">The block to add to the new block operation objects list. The block should take no parameters and have no return value.</param>
- /// <returns>A new block operation object.</returns>
- [iOSVersion(4)]
- public NSBlockOperation(Action block) { }
-
- /// <summary>
- /// Adds the specified block to the receivers list of blocks to perform.
- /// </summary>
- /// <param name="block">The block to add to the receivers list. The block should take no parameters and have no return value.</param>
- [iOSVersion(4)]
- [Export("addExecutionBlock")]
- public void AddExecutionBlock(Action block) { }
-
- /// <summary>
- /// Returns an array containing the blocks associated with the receiver.
- /// </summary>
- /// <returns>An array of blocks. The blocks in this array are copies of the ones originally added using the addExecutionBlock: method.</returns>
- [iOSVersion(4)]
- [Export("executionBlocks")]
- public AnyObject[] ExecutionBlocks { get; private set; }
- }
+ //https://developer.apple.com/library/prerelease/ios/documentation/Cocoa/Reference/NSBlockOperation_class/index.html#//apple_ref/occ/cl/NSBlockOperation
+ /// <summary>
+ /// The NSBlockOperation class is a concrete subclass of NSOperation that manages the concurrent execution of one or more blocks. You can use this object to execute several blocks at once without having to create separate operation objects for each. When executing more than one block, the operation itself is considered finished only when all blocks have finished executing.
+ /// </summary>
+ [iOSVersion(4)]
+ public class NSBlockOperation : NSOperation
+ {
+ /// <summary>
+ /// Creates and returns an NSBlockOperation object and adds the specified block to it.
+ /// </summary>
+ /// <param name="block">The block to add to the new block operation objects list. The block should take no parameters and have no return value.</param>
+ /// <returns>A new block operation object.</returns>
+ [iOSVersion(4)]
+ public NSBlockOperation(Action block) { }
+
+ /// <summary>
+ /// Adds the specified block to the receivers list of blocks to perform.
+ /// </summary>
+ /// <param name="block">The block to add to the receivers list. The block should take no parameters and have no return value.</param>
+ [iOSVersion(4)]
+ [Export("addExecutionBlock")]
+ public void AddExecutionBlock(Action block) { }
+
+ /// <summary>
+ /// Returns an array containing the blocks associated with the receiver.
+ /// </summary>
+ /// <returns>An array of blocks. The blocks in this array are copies of the ones originally added using the addExecutionBlock: method.</returns>
+ [iOSVersion(4)]
+ [Export("executionBlocks")]
+ public AnyObject[] ExecutionBlocks { get; private set; }
+ }
} \ No newline at end of file
diff --git a/CocoaSharp/Foundation/NSCachedURLResponse.cs b/CocoaSharp/Foundation/NSCachedURLResponse.cs
index 9c19bfa0..2a12a741 100644
--- a/CocoaSharp/Foundation/NSCachedURLResponse.cs
+++ b/CocoaSharp/Foundation/NSCachedURLResponse.cs
@@ -64,8 +64,6 @@ namespace Foundation
public NSDictionary UserInfo { get; private set; }
}
- //TODO: check if NSURLCacheStoragePolicy enum is correct
-
/// <summary>
/// These constants specify the caching strategy used by an NSCachedURLResponse object.
/// </summary>
diff --git a/CocoaSharp/Foundation/NSCalendar.cs b/CocoaSharp/Foundation/NSCalendar.cs
index 9632b6d1..4ba9a562 100644
--- a/CocoaSharp/Foundation/NSCalendar.cs
+++ b/CocoaSharp/Foundation/NSCalendar.cs
@@ -164,135 +164,134 @@ namespace Foundation
[iOSVersion(2)]
[Export("dateFromComponents")]
public NSDate DateFromComponents(NSDateComponents comps) { return null; }
-
- //TODO: implement NSCalendarOptions
- public enum NSCalendarOptions
- {
-
- }
-
- /// <summary>
- /// Specify calendrical units such as day and month.
- /// </summary>
- public enum NSCalendarUnit
- {
- CalendarUnitEra,
- CalendarUnitYear,
- CalendarUnitMonth,
- CalendarUnitDay,
- CalendarUnitHour,
- CalendarUnitMinute,
- CalendarUnitSecond,
- CalendarUnitWeekday,
- CalendarUnitWeekdayOrdinal,
- CalendarUnitQuarter,
- CalendarUnitWeekOfMonth,
- CalendarUnitWeekOfYear,
- CalendarUnitYearForWeekOfYear,
- CalendarUnitNanosecond,
- CalendarUnitCalendar,
- CalendarUnitTimeZone,
-
- /// <summary>
- /// Specifies the era unit.
- /// </summary>
- [iOSVersion(8)]
- EraCalendarUnit,
-
- /// <summary>
- /// Specifies the year unit.
- /// </summary>
- [iOSVersion(8)]
- YearCalendarUnit,
-
- /// <summary>
- /// Specifies the month unit.
- /// </summary>
- [iOSVersion(8)]
- MonthCalendarUnit,
-
- /// <summary>
- /// Specifies the day unit.
- /// </summary>
- [iOSVersion(8)]
- DayCalendarUnit,
-
- /// <summary>
- /// Specifies the hour unit.
- /// </summary>
- [iOSVersion(8)]
- HourCalendarUnit,
-
- /// <summary>
- /// Specifies the minute unit.
- /// </summary>
- [iOSVersion(8)]
- MinuteCalendarUnit,
-
- /// <summary>
- /// Specifies the second unit.
- /// </summary>
- [iOSVersion(8)]
- SecondCalendarUnit,
-
- /// <summary>
- /// Specifies the week unit.
- /// </summary>
- [iOSVersion(8)]
- WeekCalendarUnit,
-
- /// <summary>
- /// Specifies the weekday unit.
- /// </summary>
- [iOSVersion(8)]
- WeekdayCalendarUnit,
-
- /// <summary>
- /// Specifies the ordinal weekday unit.
- /// </summary>
- [iOSVersion(8)]
- WeekdayOrdinalCalendarUnit,
-
- /// <summary>
- /// Specifies the quarter of the calendar as an kCFCalendarUnitSecond.
- /// </summary>
- [iOSVersion(8)]
- QuarterCalendarUnit,
-
- /// <summary>
- /// Specifies the original week of a month calendar unit.
- /// </summary>
- [iOSVersion(8)]
- WeekOfMonthCalendarUnit,
-
- /// <summary>
- /// Specifies the original week of the year calendar unit.
- /// </summary>
- [iOSVersion(8)]
- WeekOfYearCalendarUnit,
-
- /// <summary>
- /// Specifies the year when the calendar is being interpreted as a week-based calendar.
- /// </summary>
- [iOSVersion(8)]
- YearForWeekOfYearCalendarUnit,
-
- /// <summary>
- /// Specifies the calendar of the calendar.
- /// </summary>
- [iOSVersion(8)]
- CalendarCalendarUnit,
-
- /// <summary>
- /// Specifies the time zone of the calendar as an NSTimeZone.
- /// </summary>
- [iOSVersion(8)]
- TimeZoneCalendarUnit,
- }
/// <summary>
/// The wrapping option specifies wrapping behavior for calculations involving NSDateComponents objects.
/// </summary>
[Export("NSWrapCalendarComponents")]
public int NSWrapCalendarComponents { get; private set; }
}
+
+ public enum NSCalendarOptions
+ {
+ //TODO: Check later for NSCalendarOptions
+ }
+
+ /// <summary>
+ /// Specify calendrical units such as day and month.
+ /// </summary>
+ public enum NSCalendarUnit
+ {
+ CalendarUnitEra,
+ CalendarUnitYear,
+ CalendarUnitMonth,
+ CalendarUnitDay,
+ CalendarUnitHour,
+ CalendarUnitMinute,
+ CalendarUnitSecond,
+ CalendarUnitWeekday,
+ CalendarUnitWeekdayOrdinal,
+ CalendarUnitQuarter,
+ CalendarUnitWeekOfMonth,
+ CalendarUnitWeekOfYear,
+ CalendarUnitYearForWeekOfYear,
+ CalendarUnitNanosecond,
+ CalendarUnitCalendar,
+ CalendarUnitTimeZone,
+
+ /// <summary>
+ /// Specifies the era unit.
+ /// </summary>
+ [iOSVersion(8)]
+ EraCalendarUnit,
+
+ /// <summary>
+ /// Specifies the year unit.
+ /// </summary>
+ [iOSVersion(8)]
+ YearCalendarUnit,
+
+ /// <summary>
+ /// Specifies the month unit.
+ /// </summary>
+ [iOSVersion(8)]
+ MonthCalendarUnit,
+
+ /// <summary>
+ /// Specifies the day unit.
+ /// </summary>
+ [iOSVersion(8)]
+ DayCalendarUnit,
+
+ /// <summary>
+ /// Specifies the hour unit.
+ /// </summary>
+ [iOSVersion(8)]
+ HourCalendarUnit,
+
+ /// <summary>
+ /// Specifies the minute unit.
+ /// </summary>
+ [iOSVersion(8)]
+ MinuteCalendarUnit,
+
+ /// <summary>
+ /// Specifies the second unit.
+ /// </summary>
+ [iOSVersion(8)]
+ SecondCalendarUnit,
+
+ /// <summary>
+ /// Specifies the week unit.
+ /// </summary>
+ [iOSVersion(8)]
+ WeekCalendarUnit,
+
+ /// <summary>
+ /// Specifies the weekday unit.
+ /// </summary>
+ [iOSVersion(8)]
+ WeekdayCalendarUnit,
+
+ /// <summary>
+ /// Specifies the ordinal weekday unit.
+ /// </summary>
+ [iOSVersion(8)]
+ WeekdayOrdinalCalendarUnit,
+
+ /// <summary>
+ /// Specifies the quarter of the calendar as an kCFCalendarUnitSecond.
+ /// </summary>
+ [iOSVersion(8)]
+ QuarterCalendarUnit,
+
+ /// <summary>
+ /// Specifies the original week of a month calendar unit.
+ /// </summary>
+ [iOSVersion(8)]
+ WeekOfMonthCalendarUnit,
+
+ /// <summary>
+ /// Specifies the original week of the year calendar unit.
+ /// </summary>
+ [iOSVersion(8)]
+ WeekOfYearCalendarUnit,
+
+ /// <summary>
+ /// Specifies the year when the calendar is being interpreted as a week-based calendar.
+ /// </summary>
+ [iOSVersion(8)]
+ YearForWeekOfYearCalendarUnit,
+
+ /// <summary>
+ /// Specifies the calendar of the calendar.
+ /// </summary>
+ [iOSVersion(8)]
+ CalendarCalendarUnit,
+
+ /// <summary>
+ /// Specifies the time zone of the calendar as an NSTimeZone.
+ /// </summary>
+ [iOSVersion(8)]
+ TimeZoneCalendarUnit,
+ }
} \ No newline at end of file
diff --git a/CocoaSharp/Foundation/Protocols/NSKeyValueCoding.cs b/CocoaSharp/Foundation/Protocols/NSKeyValueCoding.cs
index 92d67b2f..32c4be78 100644
--- a/CocoaSharp/Foundation/Protocols/NSKeyValueCoding.cs
+++ b/CocoaSharp/Foundation/Protocols/NSKeyValueCoding.cs
@@ -1 +1,251 @@
-using ObjectiveC; using System; using SwiftSharp.Attributes; namespace Foundation { //todo redo //https://developer.apple.com/library/prerelease/ios/documentation/Cocoa/Reference/Foundation/Protocols/NSKeyValueCoding_Protocol/index.html#//apple_ref/doc/uid/TP40003780 /// <summary> /// The NSKeyValueCoding informal protocol defines a mechanism by which you can access the properties of an object indirectly by name (or key), rather than directly through invocation of an accessor method or as instance variables. Thus, all of an object’s properties can be accessed in a consistent manner. /// </summary> [iOSVersion(2)] public interface NSKeyValueCoding { /// <summary> /// Returns the value for the property identified by a given key. /// </summary> /// <param name="key">The name of one of the receiver's properties.</param> /// <returns>The value for the property identified by key.</returns> [iOSVersion(2)] [Export("valueForKey")] AnyObject ValueForKey(string key); /// <summary> /// Returns the value for the derived property identified by a given key path. /// </summary> /// <param name="keyPath">A key path of the form relationship.property (with one or more relationships); for example “department.name” or “department.manager.lastName”.</param> /// <returns>The value for the derived property identified by keyPath.</returns> [iOSVersion(2)] [Export("valueForKeyPath")] AnyObject ValueForKeyPath(string keyPath); /// <summary> /// Returns a dictionary containing the property values identified by each of the keys in a given array. /// </summary> /// <param name="keys">An array containing NSString objects that identify properties of the receiver.</param> /// <returns>A dictionary containing as keys the property names in keys, with corresponding values being the corresponding property values.</returns> [iOSVersion(2)] [Export("dictionaryWithValuesForKeys")] NSDictionary DictionaryWithValuesForKeys(AnyObject[] keys); /// <summary> /// Invoked by valueForKey: when it finds no property corresponding to a given key. /// </summary> /// <param name="key">A string that is not equal to the name of any of the receiver's properties.</param> [iOSVersion(2)] [Export("valueForUndefinedKey")] AnyObject ValueForUndefinedKey(string key); /// <summary> /// Returns a mutable array proxy that provides read-write access to an ordered to-many relationship specified by a given key. /// </summary> /// <param name="key">The name of an ordered to-many relationship.</param> /// <returns>A mutable array proxy that provides read-write access to the ordered to-many relationship specified by key.</returns> [iOSVersion(2)] [Export("mutableArrayValueForKey")] NSMutableArray MutableArrayValueForKey(string key); /// <summary> /// Returns a mutable array that provides read-write access to the ordered to-many relationship specified by a given key path. /// </summary> /// <param name="keyPath">A key path, relative to the receiver, to an ordered to-many relationship.</param> /// <returns>A mutable array that provides read-write access to the ordered to-many relationship specified by keyPath.</returns> [iOSVersion(2)] [Export("mutableArrayValueForKeyPath")] NSMutableArray MutableArrayValueForKeyPath(string keyPath); /// <summary> /// Returns a mutable set proxy that provides read-write access to the unordered to-many relationship specified by a given key. /// </summary> /// <param name="key">The name of an unordered to-many relationship.</param> /// <returns>A mutable set that provides read-write access to the unordered to-many relationship specified by key.</returns> [iOSVersion(2)] [Export("mutableSetValueForKey")] NSMutableSet MutableSetValueForKey(string key); /// <summary> /// Returns a mutable set that provides read-write access to the unordered to-many relationship specified by a given key path. /// </summary> /// <param name="keyPath">A key path, relative to the receiver, to an unordered to-many relationship.</param> /// <returns>A mutable set that provides read-write access to the unordered to-many relationship specified by keyPath.</returns> [iOSVersion(2)] [Export("mutableSetValueForKeyPath")] NSMutableSet MutableSetValueForKeyPath(string keyPath); /// <summary> /// Returns a mutable ordered set that provides read-write access to the uniquing ordered to-many relationship specified by a given key. /// </summary> /// <param name="key">The name of a uniquing ordered to-many relationship.</param> /// <returns>A mutable ordered set that provides read-write access to the uniquing to-many relationship specified by key.</returns> [iOSVersion(5)] [Export("mutableOrderedSetValueForKey")] NSMutableOrderedSet MutableOrderedSetValueForKey(string key); /// <summary> /// Returns a mutable ordered set that provides read-write access to the uniquing ordered to-many relationship specified by a given key path. /// </summary> /// <param name="keyPath">A key path, relative to the receiver, to a uniquing ordered to-many relationship represented by a set.</param> /// <returns>A mutable ordered set that provides read-write access to the uniquing to-many relationship specified by keyPath.</returns> [iOSVersion(5)] [Export("mutableOrderedSetValueForKeyPath")] NSMutableOrderedSet MutableOrderedSetValueForKeyPath(string keyPath); /// <summary> /// Sets the value for the property identified by a given key path to a given value. /// </summary> /// <param name="value">The value for the property identified by keyPath.</param> /// <param name="forKeyPath">A key path of the form relationship.property (with one or more relationships): for example “department.name” or “department.manager.lastName.”</param> [iOSVersion(2)] [Export("setValue")] void ForKeyPathSetValue(AnyObject value, string forKeyPath); /// <summary> /// Sets properties of the receiver with values from a given dictionary, using its keys to identify the properties. /// </summary> /// <param name="keyedValues">A dictionary whose keys identify properties in the receiver. The values of the properties in the receiver are set to the corresponding values in the dictionary.</param> [iOSVersion(2)] [Export("setValuesForKeysWithDictionary")] void SetValuesForKeysWithDictionary(NSDictionary keyedValues); /// <summary> /// Invoked by setValue:forKey: when it’s given a nil value for a scalar value (such as an int or float). /// </summary> /// <param name="key">The name of one of the receiver's properties.</param> [iOSVersion(2)] [Export("setNilValueForKey")] void SetNilValueForKey(string key); /// <summary> /// Sets the property of the receiver specified by a given key to a given value. /// </summary> /// <param name="value">The value for the property identified by key.</param> /// <param name="forKey">The name of one of the receiver's properties.</param> [iOSVersion(2)] [Export("setValue")] void ForKeySetValue(AnyObject value, string forKey); /// <summary> /// Invoked by setValue:forKey: when it finds no property for a given key. /// </summary> /// <param name="value">The value for the key identified by key.</param> /// <param name="forUndefinedKey">A string that is not equal to the name of any of the receiver's properties.</param> [iOSVersion(2)] [Export("setValue")] void SetValue(AnyObject value, string forUndefinedKey); /// <summary> /// Returns a Boolean value that indicates whether the key-value coding methods should access the corresponding instance variable directly on finding no accessor method for a property. /// </summary> /// <returns>true if the key-value coding methods should access the corresponding instance variable directly on finding no accessor method for a property, otherwise false.</returns> //[iOSVersion(2)] //[Export("accessInstanceVariablesDirectly")] //static bool AccessInstanceVariablesDirectly(); /// <summary> /// Returns a Boolean value that indicates whether the value specified by a given pointer is valid for the property identified by a given key. /// </summary> /// <param name="ioValue">A pointer to a new value for the property identified by key. This method may modify or replace the value in order to make it valid.</param> /// <param name="forKey">The name of one of the receiver's properties. The key must specify an attribute or a to-one relationship.</param> /// <param name="error">If validation is necessary and ioValue is not transformed into a valid value, upon return contains an NSError object that describes the reason that ioValue is not a valid value.</param> /// <returns>YES if *ioValue is a valid value for the property identified by key, or if the method is able to modify the value to *ioValue to make it valid; otherwise false.</returns> [iOSVersion(2)] [Export("validateValue")] bool ForKeyValidateValue(AutoreleasingUnsafePointer<AnyObject> ioValue, string forKey, NSErrorPointer error); /// <summary> /// Returns a Boolean value that indicates whether the value specified by a given pointer is valid for a given key path relative to the receiver. /// </summary> /// <param name="ioValue">A pointer to a new value for the property identified by keyPath. This method may modify or replace the value in order to make it valid.</param> /// <param name="forKeyPath">The name of one of the receiver's properties. The key path must specify an attribute or a to-one relationship. The key path has the form relationship.property (with one or more relationships); for example “department.name” or “department.manager.lastName”.</param> /// <param name="error">If validation is necessary and ioValue is not transformed into a valid value, upon return contains an NSError object that describes the reason that ioValue is not a valid value.</param> [iOSVersion(2)] [Export("validateValue")] bool ForKeyPathValidateValue(AutoreleasingUnsafePointer<AnyObject> ioValue, string forKeyPath, NSErrorPointer error); /// <summary> /// This constant defines the name of an exception raised when a key value coding operation fails. /// </summary> [Export("NSUndefinedKeyException")] string NSUndefinedKeyException { get; } /// <summary> /// These constants define the available array operators. See Set and Array Operators for more information. /// </summary> /// <summary> /// The @avg array operator. /// </summary> [iOSVersion(2)] string NSAverageKeyValueOperator { get; } /// <summary> /// The @count array operator. /// </summary> [iOSVersion(2)] string NSCountKeyValueOperator { get; } /// <summary> /// The @distinctUnionOfArrays array operator. /// </summary> [iOSVersion(2)] string NSDistinctUnionOfArraysKeyValueOperator { get; } /// <summary> /// The @distinctUnionOfObjects array operator. /// </summary> [iOSVersion(2)] string NSDistinctUnionOfObjectsKeyValueOperator { get; } /// <summary> /// The @distinctUnionOfSets array operator. /// </summary> [iOSVersion(2)] string NSDistinctUnionOfSetsKeyValueOperator { get; } /// <summary> /// The @max array operator. /// </summary> [iOSVersion(2)] string NSMaximumKeyValueOperator { get; } /// <summary> /// The @min array operator. /// </summary> [iOSVersion(2)] string NSMinimumKeyValueOperator { get; } /// <summary> /// The @sum array operator. /// </summary> [iOSVersion(2)] string NSSumKeyValueOperator { get; } /// <summary> /// The @unionOfArrays array operator. /// </summary> [iOSVersion(2)] string NSUnionOfArraysKeyValueOperator { get; } /// <summary> /// The @unionOfObjects array operator. /// </summary> [iOSVersion(2)] string NSUnionOfObjectsKeyValueOperator { get; } /// <summary> /// The @unionOfSets array operator. /// </summary> [iOSVersion(2)] string NSUnionOfSetsKeyValueOperator { get; } } } \ No newline at end of file
+using ObjectiveC;
+using System;
+using SwiftSharp.Attributes;
+
+namespace Foundation
+{
+ //https://developer.apple.com/library/prerelease/ios/documentation/Cocoa/Reference/Foundation/Protocols/NSKeyValueCoding_Protocol/index.html#//apple_ref/doc/uid/TP40003780
+ /// <summary>
+ /// The NSKeyValueCoding informal protocol defines a mechanism by which you can access the properties of an object indirectly by name (or key), rather than directly through invocation of an accessor method or as instance variables. Thus, all of an object’s properties can be accessed in a consistent manner.
+ /// </summary>
+ [iOSVersion(2)]
+ public interface NSKeyValueCoding
+ {
+ /// <summary>
+ /// Returns the value for the property identified by a given key.
+ /// </summary>
+ /// <param name="key">The name of one of the receiver's properties.</param>
+ /// <returns>The value for the property identified by key.</returns>
+ [iOSVersion(2)]
+ [Export("valueForKey")]
+ AnyObject ValueForKey(string key);
+
+ /// <summary>
+ /// Returns the value for the derived property identified by a given key path.
+ /// </summary>
+ /// <param name="keyPath">A key path of the form relationship.property (with one or more relationships); for example “department.name” or “department.manager.lastName”.</param>
+ /// <returns>The value for the derived property identified by keyPath.</returns>
+ [iOSVersion(2)]
+ [Export("valueForKeyPath")]
+ AnyObject ValueForKeyPath(string keyPath);
+
+ /// <summary>
+ /// Returns a dictionary containing the property values identified by each of the keys in a given array.
+ /// </summary>
+ /// <param name="keys">An array containing NSString objects that identify properties of the receiver.</param>
+ /// <returns>A dictionary containing as keys the property names in keys, with corresponding values being the corresponding property values.</returns>
+ [iOSVersion(2)]
+ [Export("dictionaryWithValuesForKeys")]
+ NSDictionary DictionaryWithValuesForKeys(AnyObject[] keys);
+
+ /// <summary>
+ /// Invoked by valueForKey: when it finds no property corresponding to a given key.
+ /// </summary>
+ /// <param name="key">A string that is not equal to the name of any of the receiver's properties.</param>
+ [iOSVersion(2)]
+ [Export("valueForUndefinedKey")]
+ AnyObject ValueForUndefinedKey(string key);
+
+ /// <summary>
+ /// Returns a mutable array proxy that provides read-write access to an ordered to-many relationship specified by a given key.
+ /// </summary>
+ /// <param name="key">The name of an ordered to-many relationship.</param>
+ /// <returns>A mutable array proxy that provides read-write access to the ordered to-many relationship specified by key.</returns>
+ [iOSVersion(2)]
+ [Export("mutableArrayValueForKey")]
+ NSMutableArray MutableArrayValueForKey(string key);
+
+ /// <summary>
+ /// Returns a mutable array that provides read-write access to the ordered to-many relationship specified by a given key path.
+ /// </summary>
+ /// <param name="keyPath">A key path, relative to the receiver, to an ordered to-many relationship.</param>
+ /// <returns>A mutable array that provides read-write access to the ordered to-many relationship specified by keyPath.</returns>
+ [iOSVersion(2)]
+ [Export("mutableArrayValueForKeyPath")]
+ NSMutableArray MutableArrayValueForKeyPath(string keyPath);
+
+ /// <summary>
+ /// Returns a mutable set proxy that provides read-write access to the unordered to-many relationship specified by a given key.
+ /// </summary>
+ /// <param name="key">The name of an unordered to-many relationship.</param>
+ /// <returns>A mutable set that provides read-write access to the unordered to-many relationship specified by key.</returns>
+ [iOSVersion(2)]
+ [Export("mutableSetValueForKey")]
+ NSMutableSet MutableSetValueForKey(string key);
+
+ /// <summary>
+ /// Returns a mutable set that provides read-write access to the unordered to-many relationship specified by a given key path.
+ /// </summary>
+ /// <param name="keyPath">A key path, relative to the receiver, to an unordered to-many relationship.</param>
+ /// <returns>A mutable set that provides read-write access to the unordered to-many relationship specified by keyPath.</returns>
+ [iOSVersion(2)]
+ [Export("mutableSetValueForKeyPath")]
+ NSMutableSet MutableSetValueForKeyPath(string keyPath);
+
+ /// <summary>
+ /// Returns a mutable ordered set that provides read-write access to the uniquing ordered to-many relationship specified by a given key.
+ /// </summary>
+ /// <param name="key">The name of a uniquing ordered to-many relationship.</param>
+ /// <returns>A mutable ordered set that provides read-write access to the uniquing to-many relationship specified by key.</returns>
+ [iOSVersion(5)]
+ [Export("mutableOrderedSetValueForKey")]
+ NSMutableOrderedSet MutableOrderedSetValueForKey(string key);
+
+ /// <summary>
+ /// Returns a mutable ordered set that provides read-write access to the uniquing ordered to-many relationship specified by a given key path.
+ /// </summary>
+ /// <param name="keyPath">A key path, relative to the receiver, to a uniquing ordered to-many relationship represented by a set.</param>
+ /// <returns>A mutable ordered set that provides read-write access to the uniquing to-many relationship specified by keyPath.</returns>
+ [iOSVersion(5)]
+ [Export("mutableOrderedSetValueForKeyPath")]
+ NSMutableOrderedSet MutableOrderedSetValueForKeyPath(string keyPath);
+
+ /// <summary>
+ /// Sets the value for the property identified by a given key path to a given value.
+ /// </summary>
+ /// <param name="value">The value for the property identified by keyPath.</param>
+ /// <param name="forKeyPath">A key path of the form relationship.property (with one or more relationships): for example “department.name” or “department.manager.lastName.”</param>
+ [iOSVersion(2)]
+ [Export("setValue")]
+ void SetValueForKeyPath(AnyObject value, string forKeyPath);
+
+ /// <summary>
+ /// Sets properties of the receiver with values from a given dictionary, using its keys to identify the properties.
+ /// </summary>
+ /// <param name="keyedValues">A dictionary whose keys identify properties in the receiver. The values of the properties in the receiver are set to the corresponding values in the dictionary.</param>
+ [iOSVersion(2)]
+ [Export("setValuesForKeysWithDictionary")]
+ void SetValuesForKeysWithDictionary(NSDictionary keyedValues);
+
+ /// <summary>
+ /// Invoked by setValue:forKey: when it’s given a nil value for a scalar value (such as an int or float).
+ /// </summary>
+ /// <param name="key">The name of one of the receiver's properties.</param>
+ [iOSVersion(2)]
+ [Export("setNilValueForKey")]
+ void SetNilValueForKey(string key);
+
+ /// <summary>
+ /// Sets the property of the receiver specified by a given key to a given value.
+ /// </summary>
+ /// <param name="value">The value for the property identified by key.</param>
+ /// <param name="forKey">The name of one of the receiver's properties.</param>
+ [iOSVersion(2)]
+ [Export("setValue")]
+ void SetValueForKey(AnyObject value, string forKey);
+
+ /// <summary>
+ /// Invoked by setValue:forKey: when it finds no property for a given key.
+ /// </summary>
+ /// <param name="value">The value for the key identified by key.</param>
+ /// <param name="forUndefinedKey">A string that is not equal to the name of any of the receiver's properties.</param>
+ [iOSVersion(2)]
+ [Export("setValue")]
+ void SetValueForUndefinedKey(AnyObject value, string forUndefinedKey);
+
+ /// <summary>
+ /// Returns a Boolean value that indicates whether the key-value coding methods should access the corresponding instance variable directly on finding no accessor method for a property.
+ /// </summary>
+ /// <returns>true if the key-value coding methods should access the corresponding instance variable directly on finding no accessor method for a property, otherwise false.</returns>
+ //[iOSVersion(2)]
+ //[Export("accessInstanceVariablesDirectly")]
+ //static bool AccessInstanceVariablesDirectly();
+
+ /// <summary>
+ /// Returns a Boolean value that indicates whether the value specified by a given pointer is valid for the property identified by a given key.
+ /// </summary>
+ /// <param name="ioValue">A pointer to a new value for the property identified by key. This method may modify or replace the value in order to make it valid.</param>
+ /// <param name="forKey">The name of one of the receiver's properties. The key must specify an attribute or a to-one relationship.</param>
+ /// <param name="error">If validation is necessary and ioValue is not transformed into a valid value, upon return contains an NSError object that describes the reason that ioValue is not a valid value.</param>
+ /// <returns>YES if *ioValue is a valid value for the property identified by key, or if the method is able to modify the value to *ioValue to make it valid; otherwise false.</returns>
+ [iOSVersion(2)]
+ [Export("validateValue")]
+ bool ValidateValueForKey(AutoreleasingUnsafePointer<AnyObject> ioValue, string forKey, NSErrorPointer error);
+
+ /// <summary>
+ /// Returns a Boolean value that indicates whether the value specified by a given pointer is valid for a given key path relative to the receiver.
+ /// </summary>
+ /// <param name="ioValue">A pointer to a new value for the property identified by keyPath. This method may modify or replace the value in order to make it valid.</param>
+ /// <param name="forKeyPath">The name of one of the receiver's properties. The key path must specify an attribute or a to-one relationship. The key path has the form relationship.property (with one or more relationships); for example “department.name” or “department.manager.lastName”.</param>
+ /// <param name="error">If validation is necessary and ioValue is not transformed into a valid value, upon return contains an NSError object that describes the reason that ioValue is not a valid value.</param>
+ [iOSVersion(2)]
+ [Export("validateValue")]
+ bool ValidateValueForKeyPath(AutoreleasingUnsafePointer<AnyObject> ioValue, string forKeyPath, NSErrorPointer error);
+
+ /// <summary>
+ /// This constant defines the name of an exception raised when a key value coding operation fails.
+ /// </summary>
+ [Export("NSUndefinedKeyException")]
+ string NSUndefinedKeyException { get; }
+
+ /// <summary>
+ /// These constants define the available array operators. See Set and Array Operators for more information.
+ /// </summary>
+
+ /// <summary>
+ /// The @avg array operator.
+ /// </summary>
+ [iOSVersion(2)]
+ string NSAverageKeyValueOperator { get; }
+
+ /// <summary>
+ /// The @count array operator.
+ /// </summary>
+ [iOSVersion(2)]
+ string NSCountKeyValueOperator { get; }
+
+ /// <summary>
+ /// The @distinctUnionOfArrays array operator.
+ /// </summary>
+ [iOSVersion(2)]
+ string NSDistinctUnionOfArraysKeyValueOperator { get; }
+
+ /// <summary>
+ /// The @distinctUnionOfObjects array operator.
+ /// </summary>
+ [iOSVersion(2)]
+ string NSDistinctUnionOfObjectsKeyValueOperator { get; }
+
+ /// <summary>
+ /// The @distinctUnionOfSets array operator.
+ /// </summary>
+ [iOSVersion(2)]
+ string NSDistinctUnionOfSetsKeyValueOperator { get; }
+
+ /// <summary>
+ /// The @max array operator.
+ /// </summary>
+ [iOSVersion(2)]
+ string NSMaximumKeyValueOperator { get; }
+
+ /// <summary>
+ /// The @min array operator.
+ /// </summary>
+ [iOSVersion(2)]
+ string NSMinimumKeyValueOperator { get; }
+
+ /// <summary>
+ /// The @sum array operator.
+ /// </summary>
+ [iOSVersion(2)]
+ string NSSumKeyValueOperator { get; }
+
+ /// <summary>
+ /// The @unionOfArrays array operator.
+ /// </summary>
+ [iOSVersion(2)]
+ string NSUnionOfArraysKeyValueOperator { get; }
+
+ /// <summary>
+ /// The @unionOfObjects array operator.
+ /// </summary>
+ [iOSVersion(2)]
+ string NSUnionOfObjectsKeyValueOperator { get; }
+
+ /// <summary>
+ /// The @unionOfSets array operator.
+ /// </summary>
+ [iOSVersion(2)]
+ string NSUnionOfSetsKeyValueOperator { get; }
+ }
+} \ No newline at end of file
diff --git a/StubGen/StubGen/Scraper.cs b/StubGen/StubGen/Scraper.cs
index dbfd99c7..a5ca35a4 100644
--- a/StubGen/StubGen/Scraper.cs
+++ b/StubGen/StubGen/Scraper.cs
@@ -16,7 +16,7 @@ namespace StubGen
{
var declaration = RemoveHTMLTags(declarationPara.InnerHtml.Trim()).Trim();
var name = Regex.Split(declaration, "enum ")[1].Split(':')[0].Trim();
- var output = summary + /*"public*/ "enum " + name + "\r\n{";
+ var output = summary + "public enum " + name + "\r\n{";
var items = Regex.Split(declaration, "\n");
@@ -143,7 +143,7 @@ namespace StubGen
public static Tuple<string, Dictionary<string, string>> ParseDeclaration(string declaration)
{
- var output = /*"public "*/"";
+ var output = "public ";
if (declaration.StartsWith("@optional"))
{
output = "[Optional]\r\n" + output;
@@ -229,8 +229,8 @@ namespace StubGen
}
output = output.TrimEnd(' ', ',');
- //output += ") { ";
- output += ");";/*
+ output += ") { ";
+ //output += ");";
if (name != "init")
{
switch (typeOfMethod)
@@ -254,7 +254,7 @@ namespace StubGen
break;
}
}
- output += " }";*/
+ output += " }";
}
else if (declaration.StartsWith("var"))
{
@@ -438,14 +438,14 @@ namespace StubGen
doc.LoadHtml(data);
//var desc = RemoveHTMLTags(doc.DocumentNode.SelectSingleNode("/html/body//section[@class='z-class-description section']/p[@class='para']").InnerHtml).Trim();
//var desc = RemoveHTMLTags(doc.DocumentNode.SelectSingleNode("/html/body//section[@class='intro']/p[@class='para']").InnerHtml).Trim();
- var desc = "This document describes the data types and constants found in the Foundation framework.";
+ var desc = "The NSKeyValueCoding informal protocol defines a mechanism by which you can access the properties of an object indirectly by name (or key), rather than directly through invocation of an accessor method or as instance variables. Thus, all of an object’s properties can be accessed in a consistent manner.";
desc = desc.Replace("More...", "").Trim();
output += "/// <summary>\r\n/// " + desc + "\r\n/// </summary>\r\n";
- var availability = "";//RemoveHTMLTags(doc.DocumentNode.SelectSingleNode("/html/body//div[@class='z-reference-info-availability half']/span").InnerHtml).Trim();
+ var availability = RemoveHTMLTags(doc.DocumentNode.SelectSingleNode("/html/body//div[@class='z-reference-info-availability half']/span").InnerHtml).Trim();
- //output += "[iOSVersion(" + Regex.Split(availability, "in iOS ")[1].Split(' ')[0].Trim('.', '0') + ")]\r\n";
- output += "public class " + self /*+ " : " + inherits*/ + "\r\n{\r\n";
+ output += "[iOSVersion(" + Regex.Split(availability, "in iOS ")[1].Split(' ')[0].Trim('.', '0') + ")]\r\n";
+ output += "public interface " + self /*+ " : " + inherits*/ + "\r\n{\r\n";
output += ScrapeWithAgility(data);
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback