mirror of
https://github.com/claunia/plist-cil.git
synced 2025-12-16 19:14:26 +00:00
Prettify documentation.
This commit is contained in:
@@ -29,13 +29,14 @@ using System.IO;
|
||||
namespace Claunia.PropertyList
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Parses property lists that are in Apple's binary format.
|
||||
/// Use this class when you are sure about the format of the property list.
|
||||
/// Otherwise use the PropertyListParser class.
|
||||
///
|
||||
/// </para><para>
|
||||
/// Parsing is done by calling the static <see cref="Parse(byte[])"/>,
|
||||
/// <see cref="Parse(FileInfo)"/> and <see cref="Parse(Stream)"/> methods.
|
||||
///
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// @author Daniel Dreibrodt
|
||||
/// @author Natalia Portillo
|
||||
|
||||
@@ -29,10 +29,14 @@ using System.Collections.Generic;
|
||||
namespace Claunia.PropertyList
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// A BinaryPropertyListWriter is a helper class for writing out
|
||||
/// binary property list files. It contains an output stream and
|
||||
/// various structures for keeping track of which NSObjects have
|
||||
/// already been serialized, and where they were put in the file.
|
||||
/// binary property list files.
|
||||
/// </para><para>
|
||||
/// It contains an output stream and various structures for keeping track
|
||||
/// of which NSObjects have already been serialized, and where they were
|
||||
/// put in the file.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// @author Keith Randall
|
||||
/// @author Natalia Portillo
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
2015-02-20 Natalia Portillo <claunia@claunia.com>
|
||||
|
||||
* UID.cs:
|
||||
* NSSet.cs:
|
||||
* NSData.cs:
|
||||
* NSArray.cs:
|
||||
* NSString.cs:
|
||||
* NSNumber.cs:
|
||||
* NSObject.cs:
|
||||
* NSDictionary.cs:
|
||||
* PropertyListParser.cs:
|
||||
* BinaryPropertyListWriter.cs:
|
||||
* BinaryPropertyListParser.cs:
|
||||
Prettify documentation.
|
||||
|
||||
2015-02-20 Natalia Portillo <claunia@claunia.com>
|
||||
|
||||
* NSObject.cs:
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace Claunia.PropertyList
|
||||
/// <summary>
|
||||
/// Creates a array from an existing one
|
||||
/// </summary>
|
||||
/// <param name="a">The array which should be wrapped by the NSArray</param>
|
||||
/// <param name="a">The array which should be wrapped by the NSArray.</param>
|
||||
public NSArray(params NSObject[] a)
|
||||
{
|
||||
array = a;
|
||||
@@ -266,10 +266,14 @@ namespace Claunia.PropertyList
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Generates a valid ASCII property list which has this NSArray as its
|
||||
/// root object. The generated property list complies with the format as
|
||||
/// described in <a href="https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/PropertyLists/OldStylePlists/OldStylePLists.html">
|
||||
/// Property List Programming Guide - Old-Style ASCII Property Lists</a>.
|
||||
/// root object.
|
||||
/// </para><para>
|
||||
/// The generated property list complies with the format as
|
||||
/// described in https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/PropertyLists/OldStylePlists/OldStylePLists.html
|
||||
/// Property List Programming Guide - Old-Style ASCII Property Lists.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <returns>ASCII representation of this object.</returns>
|
||||
public string ToASCIIPropertyList()
|
||||
@@ -281,11 +285,14 @@ namespace Claunia.PropertyList
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Generates a valid ASCII property list in GnuStep format which has this
|
||||
/// NSArray as its root object. The generated property list complies with
|
||||
/// the format as described in <a href="http://www.gnustep.org/resources/documentation/Developer/Base/Reference/NSPropertyList.html">
|
||||
/// GnuStep - NSPropertyListSerialization class documentation
|
||||
/// </a>
|
||||
/// NSArray as its root object.
|
||||
/// </para><para>
|
||||
/// The generated property list complies with
|
||||
/// the format as described in http://www.gnustep.org/resources/documentation/Developer/Base/Reference/NSPropertyList.html
|
||||
/// GnuStep - NSPropertyListSerialization class documentation.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <returns>GnuStep ASCII representation of this object.</returns>
|
||||
public string ToGnuStepASCIIPropertyList()
|
||||
|
||||
@@ -95,7 +95,7 @@ namespace Claunia.PropertyList
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Loads the bytes from this NSData object into a byte buffer
|
||||
/// Loads the bytes from this NSData object into a byte buffer.
|
||||
/// </summary>
|
||||
/// <param name="buf">The byte buffer which will contain the data</param>
|
||||
/// <param name="length">The amount of data to copy</param>
|
||||
@@ -105,7 +105,7 @@ namespace Claunia.PropertyList
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Loads the bytes from this NSData object into a byte buffer
|
||||
/// Loads the bytes from this NSData object into a byte buffer.
|
||||
/// </summary>
|
||||
/// <param name="buf">The byte buffer which will contain the data</param>
|
||||
/// <param name="rangeStart">The start index.</param>
|
||||
|
||||
@@ -29,12 +29,15 @@ using System.Text;
|
||||
namespace Claunia.PropertyList
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// A NSDictionary is a collection of keys and values, essentially a Dictionary.
|
||||
/// The keys are simple Strings whereas the values can be any kind of NSObject.
|
||||
///
|
||||
/// You can access the keys through the function <code>AllKeys()</code>. Access
|
||||
/// to the objects stored for each key is given through the function
|
||||
/// <code>ObjectoForKey(String key)</code>.
|
||||
/// </para><para>
|
||||
/// You can access the keys through the function <see cref="Keys"/>.
|
||||
/// </para><para>
|
||||
/// Access to the objects stored for each key is given through the function
|
||||
/// <see cref="ObjectForKey"/>.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// @author Daniel Dreibrodt
|
||||
/// @author Natalia Portillo
|
||||
@@ -85,7 +88,7 @@ namespace Claunia.PropertyList
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks if the specified object key is contained in the current instance
|
||||
/// 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>
|
||||
@@ -108,7 +111,7 @@ namespace Claunia.PropertyList
|
||||
/// 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>
|
||||
/// <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)
|
||||
@@ -383,8 +386,8 @@ namespace Claunia.PropertyList
|
||||
/// <summary>
|
||||
/// Generates a valid ASCII property list which has this NSDictionary as its
|
||||
/// root object. The generated property list complies with the format as
|
||||
/// described in <a href="https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/PropertyLists/OldStylePlists/OldStylePLists.html">
|
||||
/// Property List Programming Guide - Old-Style ASCII Property Lists</a>.
|
||||
/// described in https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/PropertyLists/OldStylePlists/OldStylePLists.html
|
||||
/// Property List Programming Guide - Old-Style ASCII Property Lists.
|
||||
/// </summary>
|
||||
/// <returns>ASCII representation of this object.</returns>
|
||||
public string ToASCIIPropertyList()
|
||||
@@ -398,8 +401,8 @@ namespace Claunia.PropertyList
|
||||
/// <summary>
|
||||
/// Generates a valid ASCII property list in GnuStep format which has this
|
||||
/// NSDictionary as its root object. The generated property list complies with
|
||||
/// the format as described in <a href="http://www.gnustep.org/resources/documentation/Developer/Base/Reference/NSPropertyList.html">
|
||||
/// GnuStep - NSPropertyListSerialization class documentation</a>
|
||||
/// the format as described in http://www.gnustep.org/resources/documentation/Developer/Base/Reference/NSPropertyList.html
|
||||
/// GnuStep - NSPropertyListSerialization class documentation.
|
||||
/// </summary>
|
||||
/// <returns>GnuStep ASCII representation of this object.</returns>
|
||||
public string ToGnuStepASCIIPropertyList()
|
||||
@@ -482,12 +485,10 @@ namespace Claunia.PropertyList
|
||||
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.
|
||||
/// Checks if there is any item contained in the current instance corresponding with the specified key.
|
||||
/// </summary>
|
||||
/// <returns><c>true</c>, if key was containsed, <c>false</c> otherwise.</returns>
|
||||
/// <returns><c>true</c>, if key was contained, <c>false</c> otherwise.</returns>
|
||||
/// <param name="key">Key.</param>
|
||||
public bool ContainsKey(string key)
|
||||
{
|
||||
@@ -495,13 +496,13 @@ namespace Claunia.PropertyList
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks if there is any item contained in the current instance corresponding with the specified key.
|
||||
/// Checks if there is any item contained in the current instance corresponding with the specified value.
|
||||
/// </summary>
|
||||
/// <returns><c>true</c>, if value is contained, <c>false</c> otherwise.</returns>
|
||||
/// <param name="key">Key.</param>
|
||||
public bool ContainsValue(NSObject key)
|
||||
/// <param name="value">Key.</param>
|
||||
public bool ContainsValue(NSObject value)
|
||||
{
|
||||
return dict.ContainsValue(key);
|
||||
return dict.ContainsValue(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -609,7 +610,7 @@ namespace Claunia.PropertyList
|
||||
/// 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>
|
||||
/// <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);
|
||||
|
||||
@@ -220,7 +220,7 @@ namespace Claunia.PropertyList
|
||||
/// <summary>
|
||||
/// The number's bool value.
|
||||
/// </summary>
|
||||
/// <returns><code>true</code> if the value is true or non-zero, <code>false</code> otherwise.</returns>
|
||||
/// <returns><c>true</c> if the value is true or non-zero, <c>false</c> otherwise.</returns>
|
||||
public bool ToBool()
|
||||
{
|
||||
if (type == BOOLEAN)
|
||||
|
||||
@@ -31,9 +31,12 @@ using System.IO;
|
||||
namespace Claunia.PropertyList
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Abstract interface for any object contained in a property list.
|
||||
/// </para><para>
|
||||
/// The names and functions of the various objects orient themselves
|
||||
/// towards Apple's Cocoa API.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// @author Daniel Dreibrodt
|
||||
/// @author Natalia Portillo
|
||||
@@ -119,8 +122,8 @@ namespace Claunia.PropertyList
|
||||
|
||||
/// <summary>
|
||||
/// Helper method that adds correct identation to the xml output.
|
||||
/// Calling this method will add <code>level</code> number of tab characters
|
||||
/// to the <code>xml</code> string.
|
||||
/// Calling this method will add <c>level</c> number of tab characters
|
||||
/// to the <c>xml</c> string.
|
||||
/// </summary>
|
||||
/// <param name="xml">The string builder for the XML document.</param>
|
||||
/// <param name="level">The level of identation.</param>
|
||||
@@ -215,19 +218,21 @@ namespace Claunia.PropertyList
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Creates a NSObject representing the given .NET Object.
|
||||
///
|
||||
/// </para><para>
|
||||
/// Numerics of type <see cref="bool"/>, <see cref="int"/>, <see cref="long"/>, <see cref="short"/>, <see cref="byte"/>, <see cref="float"/> or <see cref="double"/> are wrapped as NSNumber objects.
|
||||
///
|
||||
/// Strings are wrapped as NSString objects abd byte arrays as NSData objects.
|
||||
///
|
||||
/// Date objects are wrapped as NSDate objects.
|
||||
///
|
||||
/// Serializable classes are serialized and their data is stored in NSData objects.
|
||||
///
|
||||
/// Arrays and Collection objects are converted to NSArrays where each array member is wrapped into a NSObject.
|
||||
///
|
||||
/// Map objects are converted to NSDictionaries. Each key is converted to a string and each value wrapped into a NSObject.
|
||||
/// </para><para>
|
||||
/// Strings are wrapped as <see cref="NSString"/> objects and byte arrays as <see cref="NSData"/> objects.
|
||||
/// </para><para>
|
||||
/// DateTime objects are wrapped as <see cref="NSDate"/> objects.
|
||||
/// </para><para>
|
||||
/// Serializable classes are serialized and their data is stored in <see cref="NSData"/> objects.
|
||||
/// </para><para>
|
||||
/// Arrays and Collection objects are converted to <see cref="NSArray"/> where each array member is wrapped into a <see cref="NSObject"/>.
|
||||
/// </para><para>
|
||||
/// Dictionaries are converted to <see cref="NSDictionary"/>. Each key is converted to a string and each value wrapped into a <see cref="NSObject"/>.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="o">The object to represent.</param>
|
||||
///<returns>A NSObject equivalent to the given object.</returns>
|
||||
@@ -485,7 +490,7 @@ namespace Claunia.PropertyList
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines if the specific NSObject is the same as the NSObject overriding this method
|
||||
/// 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
|
||||
|
||||
@@ -30,9 +30,12 @@ using System.Text;
|
||||
namespace Claunia.PropertyList
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// A set is an interface to an unordered collection of objects.
|
||||
/// </para><para>
|
||||
/// This implementation uses a <see cref="List{NSObject}"/>as the underlying
|
||||
/// data structure.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// @author Daniel Dreibrodt
|
||||
/// @author Natalia Portillo
|
||||
@@ -50,23 +53,10 @@ namespace Claunia.PropertyList
|
||||
set = new List<NSObject>();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an empty set.
|
||||
*
|
||||
* @param ordered Indicates whether the created set should be ordered or unordered.
|
||||
* @see java.util.LinkedHashSet
|
||||
* @see java.util.TreeSet
|
||||
*/
|
||||
// No need for this. It's easier in C# to just follow NSSet unordered as-is
|
||||
/*
|
||||
public NSSet(boolean ordered) {
|
||||
this.ordered = ordered;
|
||||
if (!ordered)
|
||||
set = new LinkedHashSet<NSObject>();
|
||||
else
|
||||
set = new TreeSet<NSObject>();
|
||||
}*/
|
||||
|
||||
/// <summary>
|
||||
/// Creates an empty set.
|
||||
/// </summary>
|
||||
/// <param name="ordered">Should the set be ordered on operations?</param>
|
||||
public NSSet(bool ordered)
|
||||
{
|
||||
this.ordered = ordered;
|
||||
@@ -75,7 +65,7 @@ namespace Claunia.PropertyList
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Create a set and fill it with the given objects.
|
||||
/// Creates a set and fill it with the given objects.
|
||||
/// </summary>
|
||||
/// <param name="objects">The objects to populate the set.</param>
|
||||
public NSSet(params NSObject[] objects)
|
||||
@@ -83,24 +73,11 @@ namespace Claunia.PropertyList
|
||||
set = new List<NSObject>(objects);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a set and fill it with the given objects.
|
||||
*
|
||||
* @param objects The objects to populate the set.
|
||||
* @see java.util.LinkedHashSet
|
||||
* @see java.util.TreeSet
|
||||
*/
|
||||
// No need for this. It's easier in C# to just follow NSSet unordered as-is
|
||||
/*
|
||||
public NSSet(boolean ordered, NSObject... objects) {
|
||||
this.ordered = ordered;
|
||||
if (!ordered)
|
||||
set = new LinkedHashSet<NSObject>();
|
||||
else
|
||||
set = new TreeSet<NSObject>();
|
||||
set.addAll(Arrays.asList(objects));
|
||||
}*/
|
||||
|
||||
/// <summary>
|
||||
/// Creates a set and fill it with the given objects.
|
||||
/// </summary>
|
||||
/// <param name="objects">The objects to populate the set.</param>
|
||||
/// <param name="ordered">Should the set be ordered on operations?</param>
|
||||
public NSSet(bool ordered, params NSObject[] objects)
|
||||
{
|
||||
this.ordered = ordered;
|
||||
@@ -150,10 +127,10 @@ namespace Claunia.PropertyList
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns one of the objects in the set, or <code>null</code>
|
||||
/// Returns one of the objects in the set, or <c>null</c>
|
||||
/// if the set contains no objects.
|
||||
/// </summary>
|
||||
/// <returns>The first object in the set, or <code>null</code> if the set is empty.</returns>
|
||||
/// <returns>The first object in the set, or <c>null</c> if the set is empty.</returns>
|
||||
public NSObject AnyObject()
|
||||
{
|
||||
lock (set)
|
||||
@@ -177,7 +154,7 @@ namespace Claunia.PropertyList
|
||||
/// and returns that object if it is present.
|
||||
/// </summary>
|
||||
/// <param name="obj">The object to look for.</param>
|
||||
/// <returns>The object if it is present, <code>null</code> otherwise.</returns>
|
||||
/// <returns>The object if it is present, <c>null</c> otherwise.</returns>
|
||||
public NSObject Member(NSObject obj)
|
||||
{
|
||||
lock (set)
|
||||
@@ -229,7 +206,7 @@ namespace Claunia.PropertyList
|
||||
|
||||
/// <summary>
|
||||
/// Returns an enumerator object that lets you iterate over all elements of the set.
|
||||
/// This is the equivalent to <code>objectEnumerator</code> in the Cocoa implementation
|
||||
/// This is the equivalent to <c>objectEnumerator</c> in the Cocoa implementation
|
||||
/// of NSSet.
|
||||
/// </summary>
|
||||
/// <returns>The iterator for the set.</returns>
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace Claunia.PropertyList
|
||||
string content;
|
||||
|
||||
/// <summary>
|
||||
/// Creates an NSString from its binary representation.
|
||||
/// Creates a NSString from its binary representation.
|
||||
/// </summary>
|
||||
/// <param name="bytes">The binary representation.</param>
|
||||
/// <param name="encoding">The encoding of the binary representation, the name of a supported charset.</param>
|
||||
|
||||
@@ -334,7 +334,7 @@ namespace Claunia.PropertyList
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Saves a property list with the given object as root into a ASCII file.
|
||||
/// Saves a property list with the given object as root into a GnuStep ASCII file.
|
||||
/// </summary>
|
||||
/// <param name="root">The root object.</param>
|
||||
/// <param name="outFile">The output file.</param>
|
||||
@@ -352,7 +352,7 @@ namespace Claunia.PropertyList
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Saves a property list with the given object as root into a ASCII file.
|
||||
/// Saves a property list with the given object as root into a GnuStep ASCII file.
|
||||
/// </summary>
|
||||
/// <param name="root">The root object.</param>
|
||||
/// <param name="outFile">The output file.</param>
|
||||
@@ -370,7 +370,7 @@ namespace Claunia.PropertyList
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts a given property list file into ASCII format.
|
||||
/// Converts a given property list file into GnuStep ASCII format.
|
||||
/// </summary>
|
||||
/// <param name="inFile">The source file.</param>
|
||||
/// <param name="outFile">The target file.</param>
|
||||
|
||||
@@ -28,7 +28,7 @@ using System.Text;
|
||||
namespace Claunia.PropertyList
|
||||
{
|
||||
/// <summary>
|
||||
/// A UID. Only found in binary property lists that are keyed archives.
|
||||
/// An UID. Only found in binary property lists that are keyed archives.
|
||||
/// </summary>
|
||||
/// @author Daniel Dreibrodt
|
||||
/// @author Natalia Portillo
|
||||
|
||||
Reference in New Issue
Block a user