Added all missing documentation for public methods.

This commit is contained in:
2015-02-20 02:23:39 +00:00
parent b03717e877
commit d4b593dab0
13 changed files with 404 additions and 32 deletions

View File

@@ -91,44 +91,140 @@ namespace Claunia.PropertyList
return parser.Parse();
}
/// <summary>
/// A space
/// </summary>
public const char WHITESPACE_SPACE = ' ';
/// <summary>
/// A tabulator
/// </summary>
public const char WHITESPACE_TAB = '\t';
/// <summary>
/// A newline
/// </summary>
public const char WHITESPACE_NEWLINE = '\n';
/// <summary>
/// A carriage return
/// </summary>
public const char WHITESPACE_CARRIAGE_RETURN = '\r';
/// <summary>
/// Token of NSArray start
/// </summary>
public const char ARRAY_BEGIN_TOKEN = '(';
/// <summary>
/// Token of NSArray end
/// </summary>
public const char ARRAY_END_TOKEN = ')';
/// <summary>
/// Token of NSArray item delimiter
/// </summary>
public const char ARRAY_ITEM_DELIMITER_TOKEN = ',';
/// <summary>
/// Token of NSDictionary start
/// </summary>
public const char DICTIONARY_BEGIN_TOKEN = '{';
/// <summary>
/// Token of NSDictionary end
/// </summary>
public const char DICTIONARY_END_TOKEN = '}';
/// <summary>
/// Token of NSDictionary assignment
/// </summary>
public const char DICTIONARY_ASSIGN_TOKEN = '=';
/// <summary>
/// Token of NSDictionary item delimiter
/// </summary>
public const char DICTIONARY_ITEM_DELIMITER_TOKEN = ';';
/// <summary>
/// Token of quoted NSString start
/// </summary>
public const char QUOTEDSTRING_BEGIN_TOKEN = '"';
/// <summary>
/// Token of quoted NSString end
/// </summary>
public const char QUOTEDSTRING_END_TOKEN = '"';
/// <summary>
/// Token of quoted NSString escaped character
/// </summary>
public const char QUOTEDSTRING_ESCAPE_TOKEN = '\\';
/// <summary>
/// Token of NSData start
/// </summary>
public const char DATA_BEGIN_TOKEN = '<';
/// <summary>
/// Token of NSData end
/// </summary>
public const char DATA_END_TOKEN = '>';
/// <summary>
/// Token of GSObject start
/// </summary>
public const char DATA_GSOBJECT_BEGIN_TOKEN = '*';
/// <summary>
/// Token of GSDate start
/// </summary>
public const char DATA_GSDATE_BEGIN_TOKEN = 'D';
/// <summary>
/// Token of GSBoolean start
/// </summary>
public const char DATA_GSBOOL_BEGIN_TOKEN = 'B';
/// <summary>
/// Token for GSBoolen's <c>true</c>
/// </summary>
public const char DATA_GSBOOL_TRUE_TOKEN = 'Y';
/// <summary>
/// Token for GSBoolen's <c>false</c>
/// </summary>
public const char DATA_GSBOOL_FALSE_TOKEN = 'N';
/// <summary>
/// Token for GSInteger
/// </summary>
public const char DATA_GSINT_BEGIN_TOKEN = 'I';
/// <summary>
/// Token for GSReal
/// </summary>
public const char DATA_GSREAL_BEGIN_TOKEN = 'R';
/// <summary>
/// Token for NSDate date field delimited
/// </summary>
public const char DATE_DATE_FIELD_DELIMITER = '-';
/// <summary>
/// Token for NSDate time field delimiter
/// </summary>
public const char DATE_TIME_FIELD_DELIMITER = ':';
/// <summary>
/// Token for GSDate date and time delimiter
/// </summary>
public const char DATE_GS_DATE_TIME_DELIMITER = ' ';
/// <summary>
/// Token for NSDate date and time delimiter
/// </summary>
public const char DATE_APPLE_DATE_TIME_DELIMITER = 'T';
/// <summary>
/// Token for NSDate end
/// </summary>
public const char DATE_APPLE_END_TOKEN = 'Z';
/// <summary>
/// Token for comment start
/// </summary>
public const char COMMENT_BEGIN_TOKEN = '/';
/// <summary>
/// Second token for multiline comment
/// </summary>
public const char MULTILINE_COMMENT_SECOND_TOKEN = '*';
/// <summary>
/// Second token for singleline comment
/// </summary>
public const char SINGLELINE_COMMENT_SECOND_TOKEN = '/';
/// <summary>
/// End token for multiline comment
/// </summary>
public const char MULTILINE_COMMENT_END_TOKEN = '/';
/**

View File

@@ -33,7 +33,8 @@ namespace Claunia.PropertyList
/// Use this class when you are sure about the format of the property list.
/// Otherwise use the PropertyListParser class.
///
/// Parsing is done by calling the static <see cref="Parse"/> methods.
/// Parsing is done by calling the static <see cref="Parse(byte[])"/>,
/// <see cref="Parse(FileInfo)"/> and <see cref="Parse(Stream)"/> methods.
///
/// </summary>
/// @author Daniel Dreibrodt
@@ -42,33 +43,39 @@ namespace Claunia.PropertyList
{
int majorVersion, minorVersion;
/**
* property list in bytes *
*/
/// <summary>
/// Property list in bytes
/// </summary>
byte[] bytes;
/**
* Length of an offset definition in bytes *
*/
/// <summary>
/// Length of an offset definition in bytes
/// </summary>
int offsetSize;
/**
* Length of an object reference in bytes *
*/
/// <summary>
/// Length of an object reference in bytes
/// </summary>
int objectRefSize;
/**
* Number of objects stored in this property list *
*/
/// <summary>
/// Number of objects stored in this property list
/// </summary>
int numObjects;
/**
* Reference to the top object of the property list *
*/
/// <summary>
/// Reference to the top object of the property list
/// </summary>
int topObject;
/**
* Offset of the offset table from the beginning of the file *
*/
/// <summary>
/// Offset of the offset table from the beginning of the file
/// </summary>
int offsetTableOffset;
/**
* The table holding the information at which offset each object is found *
*/
/// <summary>
/// The table holding the information at which offset each object is found
/// </summary>
int[] offsetTable;
/// <summary>
@@ -78,7 +85,6 @@ namespace Claunia.PropertyList
/// <see cref="Parse(byte[])"/>
protected BinaryPropertyListParser()
{
/** empty **/
}
/// <summary>

View File

@@ -38,9 +38,21 @@ namespace Claunia.PropertyList
/// @author Natalia Portillo
public class BinaryPropertyListWriter
{
/// <summary>
/// Binary property list version 0.0
/// </summary>
public const int VERSION_00 = 0;
/// <summary>
/// Binary property list version 1.0
/// </summary>
public const int VERSION_10 = 10;
/// <summary>
/// Binary property list version 1.5
/// </summary>
public const int VERSION_15 = 15;
/// <summary>
/// Binary property list version 2.0
/// </summary>
public const int VERSION_20 = 20;
/// <summary>

View File

@@ -1,3 +1,19 @@
2015-02-20 Natalia Portillo <claunia@claunia.com>
* UID.cs:
* NSSet.cs:
* NSDate.cs:
* NSData.cs:
* NSArray.cs:
* NSString.cs:
* NSObject.cs:
* NSNumber.cs:
* NSDictionary.cs:
* ASCIIPropertyListParser.cs:
* BinaryPropertyListParser.cs:
* BinaryPropertyListWriter.cs:
Added all missing documentation for public methods.
2015-02-20 Natalia Portillo <claunia@claunia.com>
* NSDate.cs:

View File

@@ -198,6 +198,12 @@ namespace Claunia.PropertyList
return result;
}
/// <summary>
/// Determines whether the specified <see cref="System.Object"/> is equal to the current <see cref="Claunia.PropertyList.NSArray"/>.
/// </summary>
/// <param name="obj">The <see cref="System.Object"/> to compare with the current <see cref="Claunia.PropertyList.NSArray"/>.</param>
/// <returns><c>true</c> if the specified <see cref="System.Object"/> is equal to the current
/// <see cref="Claunia.PropertyList.NSArray"/>; otherwise, <c>false</c>.</returns>
public override bool Equals(Object obj)
{
if (obj.GetType().Equals(typeof(NSArray)))
@@ -215,6 +221,11 @@ namespace Claunia.PropertyList
return false;
}
/// <summary>
/// Serves as a hash function for a <see cref="Claunia.PropertyList.NSArray"/> object.
/// </summary>
/// <returns>A hash code for this instance that is suitable for use in hashing algorithms and data structures such as a
/// hash table.</returns>
public override int GetHashCode()
{
int hash = 7;
@@ -353,6 +364,12 @@ namespace Claunia.PropertyList
ascii.Append(ASCIIPropertyListParser.ARRAY_END_TOKEN);
}
/// <summary>
/// Determines whether the specified <see cref="Claunia.PropertyList.NSObject"/> is equal to the current <see cref="Claunia.PropertyList.NSArray"/>.
/// </summary>
/// <param name="obj">The <see cref="Claunia.PropertyList.NSObject"/> to compare with the current <see cref="Claunia.PropertyList.NSArray"/>.</param>
/// <returns><c>true</c> if the specified <see cref="Claunia.PropertyList.NSObject"/> is equal to the current
/// <see cref="Claunia.PropertyList.NSArray"/>; otherwise, <c>false</c>.</returns>
public override bool Equals(NSObject obj)
{
if (!(obj is NSArray))

View File

@@ -124,11 +124,22 @@ namespace Claunia.PropertyList
return Convert.ToBase64String(bytes, Base64FormattingOptions.InsertLineBreaks);
}
/// <summary>
/// Determines whether the specified <see cref="System.Object"/> is equal to the current <see cref="Claunia.PropertyList.NSData"/>.
/// </summary>
/// <param name="obj">The <see cref="System.Object"/> to compare with the current <see cref="Claunia.PropertyList.NSData"/>.</param>
/// <returns><c>true</c> if the specified <see cref="System.Object"/> is equal to the current
/// <see cref="Claunia.PropertyList.NSData"/>; otherwise, <c>false</c>.</returns>
public override bool Equals(Object obj)
{
return obj.GetType().Equals(GetType()) && ArrayEquals(((NSData)obj).bytes, bytes);
}
/// <summary>
/// Serves as a hash function for a <see cref="Claunia.PropertyList.NSData"/> object.
/// </summary>
/// <returns>A hash code for this instance that is suitable for use in hashing algorithms and data structures such as a
/// hash table.</returns>
public override int GetHashCode()
{
int hash = 5;
@@ -185,6 +196,12 @@ namespace Claunia.PropertyList
ToASCII(ascii, level);
}
/// <summary>
/// Determines whether the specified <see cref="Claunia.PropertyList.NSObject"/> is equal to the current <see cref="Claunia.PropertyList.NSData"/>.
/// </summary>
/// <param name="obj">The <see cref="Claunia.PropertyList.NSObject"/> to compare with the current <see cref="Claunia.PropertyList.NSData"/>.</param>
/// <returns><c>true</c> if the specified <see cref="Claunia.PropertyList.NSObject"/> is equal to the current
/// <see cref="Claunia.PropertyList.NSData"/>; otherwise, <c>false</c>.</returns>
public override bool Equals(NSObject obj)
{
if (!(obj is NSData))

View File

@@ -126,11 +126,22 @@ namespace Claunia.PropertyList
}
}
/// <summary>
/// Determines whether the specified <see cref="System.Object"/> is equal to the current <see cref="Claunia.PropertyList.NSDate"/>.
/// </summary>
/// <param name="obj">The <see cref="System.Object"/> to compare with the current <see cref="Claunia.PropertyList.NSDate"/>.</param>
/// <returns><c>true</c> if the specified <see cref="System.Object"/> is equal to the current
/// <see cref="Claunia.PropertyList.NSDate"/>; otherwise, <c>false</c>.</returns>
public override bool Equals(Object obj)
{
return obj.GetType().Equals(GetType()) && date.Equals(((NSDate)obj).Date);
}
/// <summary>
/// Serves as a hash function for a <see cref="Claunia.PropertyList.NSDate"/> object.
/// </summary>
/// <returns>A hash code for this instance that is suitable for use in hashing algorithms and data structures such as a
/// hash table.</returns>
public override int GetHashCode()
{
return date.GetHashCode();
@@ -175,6 +186,12 @@ namespace Claunia.PropertyList
ascii.Append(">");
}
/// <summary>
/// Determines whether the specified <see cref="Claunia.PropertyList.NSObject"/> is equal to the current <see cref="Claunia.PropertyList.NSDate"/>.
/// </summary>
/// <param name="obj">The <see cref="Claunia.PropertyList.NSObject"/> to compare with the current <see cref="Claunia.PropertyList.NSDate"/>.</param>
/// <returns><c>true</c> if the specified <see cref="Claunia.PropertyList.NSObject"/> is equal to the current
/// <see cref="Claunia.PropertyList.NSDate"/>; otherwise, <c>false</c>.</returns>
public override bool Equals(NSObject obj)
{
if (!(obj is NSDate))

View File

@@ -72,6 +72,10 @@ namespace Claunia.PropertyList
return dict.TryGetValue(key, out nso) ? nso : null;
}
/// <summary>
/// Gets a value indicating whether this instance is empty.
/// </summary>
/// <value><c>true</c> if this instance is empty; otherwise, <c>false</c>.</value>
public bool IsEmpty
{
get
@@ -80,16 +84,31 @@ namespace Claunia.PropertyList
}
}
/// <summary>
/// Checks if the specified object key is contained in the current instance
/// </summary>
/// <returns><c>true</c>, if key is contained, <c>false</c> otherwise.</returns>
/// <param name="key">Key.</param>
public bool ContainsKey(Object key)
{
return key is string && dict.ContainsKey((string)key);
}
/// <summary>
/// Removes the item corresponding to the specified key from the current instance, if found.
/// </summary>
/// <param name="key">Key.</param>
/// <returns><c>true</c>, if removed, <c>false</c> otherwise.</returns>
public bool Remove(Object key)
{
return key is string && dict.Remove((string)key);
}
/// <summary>
/// Gets the <see cref="NSObject"/> corresponding to the specified key from the current instance.
/// </summary>
/// <param name="key">Key.</param>
/// <returns>The object corresponding to the specified key, null if not found in the current instance</returns>
public NSObject Get(Object key)
{
if (key is string)
@@ -97,6 +116,11 @@ namespace Claunia.PropertyList
return null;
}
/// <summary>
/// Checks if the current instance contains the object corresponding to the specified key.
/// </summary>
/// <returns><c>true</c>, if value is contained, <c>false</c> otherwise.</returns>
/// <param name="value">Object to search up in the current instance.</param>
public bool ContainsValue(Object value)
{
if (value == null)
@@ -262,6 +286,12 @@ namespace Claunia.PropertyList
return false;
}
/// <summary>
/// Determines whether the specified <see cref="Claunia.PropertyList.NSObject"/> is equal to the current <see cref="Claunia.PropertyList.NSDictionary"/>.
/// </summary>
/// <param name="obj">The <see cref="Claunia.PropertyList.NSObject"/> to compare with the current <see cref="Claunia.PropertyList.NSDictionary"/>.</param>
/// <returns><c>true</c> if the specified <see cref="Claunia.PropertyList.NSObject"/> is equal to the current
/// <see cref="Claunia.PropertyList.NSDictionary"/>; otherwise, <c>false</c>.</returns>
public override bool Equals(NSObject obj)
{
if (!(obj is NSDictionary))
@@ -285,6 +315,11 @@ namespace Claunia.PropertyList
return true;
}
/// <summary>
/// Serves as a hash function for a <see cref="Claunia.PropertyList.NSDictionary"/> object.
/// </summary>
/// <returns>A hash code for this instance that is suitable for use in hashing algorithms and data structures such as a
/// hash table.</returns>
public override int GetHashCode()
{
int hash = 7;
@@ -437,31 +472,62 @@ namespace Claunia.PropertyList
#region IDictionary implementation
/// <summary>
/// Add the specified key and value.
/// </summary>
/// <param name="key">Key.</param>
/// <param name="value">Value.</param>
public void Add(string key, NSObject value)
{
dict.Add(key, value);
}
/// <Docs>The key to locate in the current instance.</Docs>
/// <para>Determines whether the current instance contains an entry with the specified key.</para>
/// <summary>
/// Containses the key.
/// </summary>
/// <returns><c>true</c>, if key was containsed, <c>false</c> otherwise.</returns>
/// <param name="key">Key.</param>
public bool ContainsKey(string key)
{
return dict.ContainsKey(key);
}
/// <summary>
/// Checks if there is any item contained in the current instance corresponding with the specified key.
/// </summary>
/// <returns><c>true</c>, if value is contained, <c>false</c> otherwise.</returns>
/// <param name="key">Key.</param>
public bool ContainsValue(NSObject key)
{
return dict.ContainsValue(key);
}
/// <summary>
/// Removes the item belonging to the specified key.
/// </summary>
/// <param name="key">Key.</param>
public bool Remove(string key)
{
return dict.Remove(key);
}
/// <summary>
/// Tries to get the item corresponding to the specified key
/// </summary>
/// <returns><c>true</c>, if get value was successfully found and retrieved, <c>false</c> otherwise.</returns>
/// <param name="key">Key.</param>
/// <param name="value">Where to store the value.</param>
public bool TryGetValue(string key, out NSObject value)
{
return dict.TryGetValue(key, out value);
}
/// <summary>
/// Gets or sets the <see cref="Claunia.PropertyList.NSObject"/> at the specified index.
/// </summary>
/// <param name="index">Index.</param>
public NSObject this [string index]
{
get
@@ -474,6 +540,10 @@ namespace Claunia.PropertyList
}
}
/// <summary>
/// Gets an array with all the keys contained in the current instance.
/// </summary>
/// <value>The keys.</value>
public ICollection<string> Keys
{
get
@@ -482,6 +552,10 @@ namespace Claunia.PropertyList
}
}
/// <summary>
/// Gets an array with all the objects contained in the current instance.
/// </summary>
/// <value>The objects.</value>
public ICollection<NSObject> Values
{
get
@@ -493,32 +567,57 @@ namespace Claunia.PropertyList
#endregion
#region ICollection implementation
/// <summary>
/// Adds the specified item.
/// </summary>
/// <param name="item">Item.</param>
public void Add(KeyValuePair<string, NSObject> item)
{
dict.Add(item.Key, item.Value);
}
/// <summary>
/// Clears this instance.
/// </summary>
public void Clear()
{
dict.Clear();
}
/// <summary>
/// Checks if the current instance contains the specified item.
/// </summary>
/// <param name="item">Item.</param>
/// <returns><c>true</c> if it is found, <c>false</c> otherwise.</returns>
public bool Contains(KeyValuePair<string, NSObject> item)
{
return dict.ContainsKey(item.Key);
}
/// <summary>
/// Copies the <see cref="Dictionary{TKey, TValue}.ValueCollection"/> elements to an existing one-dimensional <see cref="Array"/>, starting at the specified array index.
/// </summary>
/// <param name="array">The one-dimensional <see cref="Array"/> that is the destination of the elements copied from <see cref="Dictionary{TKey, TValue}.ValueCollection"/>. The <see cref="Array"/> must have zero-based indexing.</param>
/// <param name="arrayIndex">The zero-based index in array at which copying begins.</param>
public void CopyTo(KeyValuePair<string, NSObject>[] array, int arrayIndex)
{
throw new NotImplementedException();
}
/// <summary>
/// Removes the specified item.
/// </summary>
/// <param name="item">Item to remove.</param>
/// <returns><c>true</c> if successfully removed, <c>false</c> if not, or if item is not in current instance</returns>
public bool Remove(KeyValuePair<string, NSObject> item)
{
return dict.Remove(item.Key);
}
/// <summary>
/// Gets the count of items in the current instance.
/// </summary>
/// <value>How many items are contained in the current instance.</value>
public int Count
{
get
@@ -527,6 +626,10 @@ namespace Claunia.PropertyList
}
}
/// <summary>
/// Gets a value indicating whether this instance is read only.
/// </summary>
/// <value><c>true</c> if this instance is read only; otherwise, <c>false</c>.</value>
public bool IsReadOnly
{
get
@@ -538,7 +641,10 @@ namespace Claunia.PropertyList
#endregion
#region IEnumerable implementation
/// <summary>
/// Gets the enumerator.
/// </summary>
/// <returns>The enumerator.</returns>
public IEnumerator<KeyValuePair<string, NSObject>> GetEnumerator()
{
return dict.GetEnumerator();

View File

@@ -96,9 +96,9 @@ namespace Claunia.PropertyList
/// Creates a number from its textual representation.
/// </summary>
/// <param name="text">The textual representation of the number.</param>
/// <seealso cref="bool.Parse"/>
/// <seealso cref="long.Parse"/>
/// <seealso cref="double.Parse"/>
/// <seealso cref="bool.Parse(string)"/>
/// <seealso cref="long.Parse(string)"/>
/// <seealso cref="double.Parse(string, IFormatProvider)"/>
public NSNumber(string text)
{
if (text == null)
@@ -281,6 +281,11 @@ namespace Claunia.PropertyList
return type == n.type && longValue == n.longValue && doubleValue == n.doubleValue && boolValue == n.boolValue;
}
/// <summary>
/// Serves as a hash function for a <see cref="Claunia.PropertyList.NSNumber"/> object.
/// </summary>
/// <returns>A hash code for this instance that is suitable for use in hashing algorithms and data structures such as a
/// hash table.</returns>
public override int GetHashCode()
{
int hash = type;
@@ -290,6 +295,10 @@ namespace Claunia.PropertyList
return hash;
}
/// <summary>
/// Returns a <see cref="System.String"/> that represents the current <see cref="Claunia.PropertyList.NSNumber"/>.
/// </summary>
/// <returns>A <see cref="System.String"/> that represents the current <see cref="Claunia.PropertyList.NSNumber"/>.</returns>
public override string ToString()
{
switch (type)
@@ -437,6 +446,12 @@ namespace Claunia.PropertyList
}
}
/// <summary>
/// Compares the current <see cref="Claunia.PropertyList.NSNumber"/> to the specified object.
/// </summary>
/// <returns>0 if the numbers are equal, 1 if the current <see cref="Claunia.PropertyList.NSNumber"/> is greater
/// than the argument and -1 if it is less, or the argument is not a number.</returns>
/// <param name="o">Object to compare to the current <see cref="Claunia.PropertyList.NSNumber"/>.</param>
public int CompareTo(Object o)
{
double x = ToDouble();
@@ -457,7 +472,7 @@ namespace Claunia.PropertyList
/// <summary>
/// Determines if an object is a number.
/// Substitutes Java's Number class comparison
/// Substitutes .NET's Number class comparison
/// </summary>
/// <returns><c>true</c> if it is a number.</returns>
/// <param name="o">Object.</param>
@@ -504,6 +519,12 @@ namespace Claunia.PropertyList
return (double)0;
}
/// <summary>
/// Determines whether the specified <see cref="Claunia.PropertyList.NSObject"/> is equal to the current <see cref="Claunia.PropertyList.NSNumber"/>.
/// </summary>
/// <param name="obj">The <see cref="Claunia.PropertyList.NSObject"/> to compare with the current <see cref="Claunia.PropertyList.NSNumber"/>.</param>
/// <returns><c>true</c> if the specified <see cref="Claunia.PropertyList.NSObject"/> is equal to the current
/// <see cref="Claunia.PropertyList.NSNumber"/>; otherwise, <c>false</c>.</returns>
public override bool Equals(NSObject obj)
{
if (!(obj is NSNumber))

View File

@@ -377,8 +377,8 @@ namespace Claunia.PropertyList
/// of the .NET Runtime Environment.
/// <ul>
/// <li><see cref="NSArray"/> objects are converted to arrays.</li>
/// <li><see cref="NSDictionary"/> objects are converted to objects extending the <see cref="System.Collections.Generic.Dictionary"/> class.</li>
/// <li><see cref="NSSet"/> objects are converted to objects extending the <see cref="System.Collections.Generic.List"/> class.</li>
/// <li><see cref="NSDictionary"/> objects are converted to objects extending the <see cref="Dictionary{TKey, TValue}"/> class.</li>
/// <li><see cref="NSSet"/> objects are converted to objects extending the <see cref="List{NSObject}"/> class.</li>
/// <li><see cref="NSNumber"/> objects are converted to primitive number values (<see cref="int"/>, <see cref="long"/>, <see cref="double"/> or <see cref="bool"/>).</li>
/// <li><see cref="NSString"/> objects are converted to <see cref="string"/> objects.</li>
/// <li><see cref="NSData"/> objects are converted to <see cref="byte"/> arrays.</li>
@@ -486,6 +486,12 @@ namespace Claunia.PropertyList
return false;
}
/// <summary>
/// Determines if the specific NSObject is the same as the NSObject overriding this method
/// </summary>
/// <param name="obj">The <see cref="Claunia.PropertyList.NSObject"/> to compare with the current <see cref="Claunia.PropertyList.NSObject"/>.</param>
/// <returns><c>true</c> if the specified <see cref="Claunia.PropertyList.NSObject"/> is equal to the current
/// <see cref="Claunia.PropertyList.NSObject"/>; otherwise, <c>false</c>.</returns>
public abstract bool Equals(NSObject obj);
}
}

View File

@@ -31,7 +31,7 @@ namespace Claunia.PropertyList
{
/// <summary>
/// A set is an interface to an unordered collection of objects.
/// This implementation uses a <see cref="List"/>as the underlying
/// This implementation uses a <see cref="List{NSObject}"/>as the underlying
/// data structure.
/// </summary>
/// @author Daniel Dreibrodt
@@ -250,6 +250,11 @@ namespace Claunia.PropertyList
return set;
}
/// <summary>
/// Serves as a hash function for a <see cref="Claunia.PropertyList.NSSet"/> object.
/// </summary>
/// <returns>A hash code for this instance that is suitable for use in hashing algorithms and data structures such as a
/// hash table.</returns>
public override int GetHashCode()
{
int hash = 7;
@@ -257,6 +262,12 @@ namespace Claunia.PropertyList
return hash;
}
/// <summary>
/// Determines whether the specified <see cref="System.Object"/> is equal to the current <see cref="Claunia.PropertyList.NSSet"/>.
/// </summary>
/// <param name="obj">The <see cref="System.Object"/> to compare with the current <see cref="Claunia.PropertyList.NSSet"/>.</param>
/// <returns><c>true</c> if the specified <see cref="System.Object"/> is equal to the current
/// <see cref="Claunia.PropertyList.NSSet"/>; otherwise, <c>false</c>.</returns>
public override bool Equals(Object obj)
{
if (obj == null)
@@ -423,6 +434,12 @@ namespace Claunia.PropertyList
ascii.Append(ASCIIPropertyListParser.ARRAY_END_TOKEN);
}
/// <summary>
/// Determines whether the specified <see cref="Claunia.PropertyList.NSObject"/> is equal to the current <see cref="Claunia.PropertyList.NSSet"/>.
/// </summary>
/// <param name="obj">The <see cref="Claunia.PropertyList.NSObject"/> to compare with the current <see cref="Claunia.PropertyList.NSSet"/>.</param>
/// <returns><c>true</c> if the specified <see cref="Claunia.PropertyList.NSObject"/> is equal to the current
/// <see cref="Claunia.PropertyList.NSSet"/>; otherwise, <c>false</c>.</returns>
public override bool Equals(NSObject obj)
{
if (!(obj is NSSet))

View File

@@ -111,6 +111,12 @@ namespace Claunia.PropertyList
Prepend(s.GetContent());
}
/// <summary>
/// Determines whether the specified <see cref="System.Object"/> is equal to the current <see cref="Claunia.PropertyList.NSString"/>.
/// </summary>
/// <param name="obj">The <see cref="System.Object"/> to compare with the current <see cref="Claunia.PropertyList.NSString"/>.</param>
/// <returns><c>true</c> if the specified <see cref="System.Object"/> is equal to the current
/// <see cref="Claunia.PropertyList.NSString"/>; otherwise, <c>false</c>.</returns>
public override bool Equals(Object obj)
{
if (!(obj is NSString))
@@ -118,6 +124,11 @@ namespace Claunia.PropertyList
return content.Equals(((NSString)obj).content);
}
/// <summary>
/// Serves as a hash function for a <see cref="Claunia.PropertyList.NSString"/> object.
/// </summary>
/// <returns>A hash code for this instance that is suitable for use in hashing algorithms and data structures such as a
/// hash table.</returns>
public override int GetHashCode()
{
return content.GetHashCode();
@@ -271,6 +282,11 @@ namespace Claunia.PropertyList
return outString;
}
/// <summary>
/// Compares the current <see cref="Claunia.PropertyList.NSString"/> to the specified object.
/// </summary>
/// <returns>A 32-bit signed integer that indicates the lexical relationship between the two comparands.</returns>
/// <param name="o">Object to compare to the current <see cref="Claunia.PropertyList.NSString"/>.</param>
public int CompareTo(Object o)
{
if (o is NSString)
@@ -280,6 +296,12 @@ namespace Claunia.PropertyList
return -1;
}
/// <summary>
/// Determines whether the specified <see cref="Claunia.PropertyList.NSObject"/> is equal to the current <see cref="Claunia.PropertyList.NSString"/>.
/// </summary>
/// <param name="obj">The <see cref="Claunia.PropertyList.NSObject"/> to compare with the current <see cref="Claunia.PropertyList.NSString"/>.</param>
/// <returns><c>true</c> if the specified <see cref="Claunia.PropertyList.NSObject"/> is equal to the current
/// <see cref="Claunia.PropertyList.NSString"/>; otherwise, <c>false</c>.</returns>
public override bool Equals(NSObject obj)
{
if (!(obj is NSString))

View File

@@ -37,12 +37,21 @@ namespace Claunia.PropertyList
readonly byte[] bytes;
readonly string name;
/// <summary>
/// Initializes a new instance of the <see cref="Claunia.PropertyList.UID"/> class.
/// </summary>
/// <param name="name">Name.</param>
/// <param name="bytes">Bytes.</param>
public UID(String name, byte[] bytes)
{
this.name = name;
this.bytes = bytes;
}
/// <summary>
/// Gets the bytes.
/// </summary>
/// <value>The bytes.</value>
public byte[] Bytes
{
get
@@ -51,6 +60,10 @@ namespace Claunia.PropertyList
}
}
/// <summary>
/// Gets the name.
/// </summary>
/// <value>The name.</value>
public string Name
{
get
@@ -94,6 +107,12 @@ namespace Claunia.PropertyList
ToASCII(ascii, level);
}
/// <summary>
/// Determines whether the specified <see cref="Claunia.PropertyList.NSObject"/> is equal to the current <see cref="Claunia.PropertyList.UID"/>.
/// </summary>
/// <param name="obj">The <see cref="Claunia.PropertyList.NSObject"/> to compare with the current <see cref="Claunia.PropertyList.UID"/>.</param>
/// <returns><c>true</c> if the specified <see cref="Claunia.PropertyList.NSObject"/> is equal to the current
/// <see cref="Claunia.PropertyList.UID"/>; otherwise, <c>false</c>.</returns>
public override bool Equals(NSObject obj)
{
if (!(obj is UID))