From 3279c7e36cde8c148a0b97f9bded503e9ae4bc12 Mon Sep 17 00:00:00 2001 From: Peter O Date: Wed, 22 Apr 2015 07:38:43 -0400 Subject: [PATCH] edit docs --- PeterO/Cbor/CBORObject.cs | 11 ++++++----- docs/APIDocs.md | 2 +- docs/PeterO.Cbor.CBOREncodeOptions.md | 20 ++++++++++++++++++++ docs/PeterO.Cbor.CBORObject.md | 20 +++++++++++++------- 4 files changed, 40 insertions(+), 13 deletions(-) diff --git a/PeterO/Cbor/CBORObject.cs b/PeterO/Cbor/CBORObject.cs index da75253c..2e3ba31b 100644 --- a/PeterO/Cbor/CBORObject.cs +++ b/PeterO/Cbor/CBORObject.cs @@ -2454,7 +2454,7 @@ public static void Write(string str, Stream stream) { /// Writes a string in CBOR format to a data stream. /// The string to write. Can be null. /// A writable data stream. - /// A CBOREncodeOptions object. + /// Options for encoding the data to CBOR. /// The parameter is null. /// An I/O error occurred. @@ -2468,7 +2468,8 @@ public static void Write( if (str == null) { stream.WriteByte(0xf6); // Write null instead of string } else { - CBOREncodeOptions noIndef = options.And(CBOREncodeOptions.NoIndefLengthStrings); + CBOREncodeOptions noIndef = + options.And(CBOREncodeOptions.NoIndefLengthStrings); if (noIndef.Value != 0) { // NOTE: Length of a String object won't be higher than the maximum // allowed for definite-length strings @@ -2721,7 +2722,7 @@ public void WriteTo(Stream stream) { /// Writes this CBOR object to a data stream. /// A writable data stream. - /// A CBOREncodeOptions object. + /// Options for encoding the data to CBOR. /// The parameter is null. /// An I/O error occurred. @@ -2986,7 +2987,7 @@ public byte[] EncodeToBytes() { } /// Gets the binary representation of this data item. - /// A CBOREncodeOptions object. + /// Options for encoding the data to CBOR. /// A byte array in CBOR format. public byte[] EncodeToBytes(CBOREncodeOptions options) { // For some types, a memory stream is a lot of @@ -3130,7 +3131,7 @@ public static void Write(object objValue, Stream stream) { /// /// The value to write. /// A writable data stream. - /// A CBOREncodeOptions object. + /// Options for encoding the data to CBOR. /// The object's type is not /// supported. /// The parameter Parameters: + + * o: A CBOREncodeOptions object. (2). + +Returns: + +A CBOREncodeOptions object. + ### And public PeterO.Cbor.CBOREncodeOptions And( @@ -30,10 +38,22 @@ Combines the flags of this options object with another options object. Returns an options object whose flags are shared by this and another options object. +Parameters: + + * o: A CBOREncodeOptions object. (2). + +Returns: + +A CBOREncodeOptions object. + ### Value public int Value { get; } Gets this options object's value. +Returns: + +This options object's value. + diff --git a/docs/PeterO.Cbor.CBORObject.md b/docs/PeterO.Cbor.CBORObject.md index bead514e..9217cf14 100644 --- a/docs/PeterO.Cbor.CBORObject.md +++ b/docs/PeterO.Cbor.CBORObject.md @@ -572,7 +572,7 @@ This object is not an array. * System.ArgumentException: The type of obj -is not supported. + is not supported. ### Remove @@ -910,7 +910,7 @@ Writes a string in CBOR format to a data stream. * stream: A writable data stream. - * options: A CBOREncodeOptions object. + * options: Options for encoding the data to CBOR. Exceptions: @@ -1061,7 +1061,7 @@ Writes this CBOR object to a data stream. * stream: A writable data stream. - * options: A CBOREncodeOptions object. + * options: Options for encoding the data to CBOR. Exceptions: @@ -1279,7 +1279,7 @@ Gets the binary representation of this data item. Parameters: - * options: A CBOREncodeOptions object. + * options: Options for encoding the data to CBOR. Returns: @@ -1313,6 +1313,12 @@ The parameter stream Not documented yet. +Parameters: + + * objValue: An arbitrary object. + + * stream: A writable data stream. + ### Write public static void Write( @@ -1336,7 +1342,7 @@ Writes an arbitrary object to a CBOR data stream. Currently, the following objec * stream: A writable data stream. - * options: A CBOREncodeOptions object. + * options: Options for encoding the data to CBOR. Exceptions: @@ -1942,7 +1948,7 @@ A CBOR object where each key and value of the given map is converted to a CBOR o public static PeterO.Cbor.CBORObject FromObject( object obj); -Generates a CBORObject from an arbitrary object. The following types are specially handled by this method: null , primitive types, strings, CBORObject , ExtendedDecimal , ExtendedFloat , the custom BigInteger , lists, arrays, enumerations ( `Enum` objects), and maps.In the .NET version, if the object is a type not specially handled by this method, returns a CBOR map with the values of each of its read/write properties (or all properties in the case of an anonymous type). Properties are converted to their camel-case names (meaning if a name starts with A to Z, that letter is lower-cased). If the property name begins with the word "Is" , that word is deleted from the name. Also, .NET `Enum` objects will be converted to their integer values, and a multidimensional array is converted to an array of arrays. In the Java version, if the object is a type not specially handled by this method, this method checks the CBOR object for methods starting with the word "get" or "is" that take no parameters, and returns a CBOR map with one entry for each such method found. For each method found, the starting word "get" or "is" is deleted from its name, and the name is converted to camel case (meaning if a name starts with A to Z, that letter is lower-cased). Also, Java `Enum` objects will be converted to the result of their name method. +Generates a CBORObject from an arbitrary object. The following types are specially handled by this method: null , primitive types, strings, CBORObject , ExtendedDecimal , ExtendedFloat , the custom BigInteger , lists, arrays, enumerations ( `Enum` objects), and maps.In the .NET version, if the object is a type not specially handled by this method, returns a CBOR map with the values of each of its read/write properties (or all properties in the case of an anonymous type). Properties are converted to their camel-case names (meaning if a name starts with A to Z, that letter is lower-cased). If the property name begins with the word "Is" , that word is deleted from the name. Also, .NET `Enum` objects will be converted to their integer values, and a multidimensional array is converted to an array of arrays. In the Java version, if the object is a type not specially handled by this method, this method checks the CBOR object for methods starting with the word "get" or "is" that take no parameters, and returns a CBOR map with one entry for each such method found. For each method found, the starting word "get" or "is" is deleted from its name, and the name is converted to camel case (meaning if a name starts with A to Z, that letter is lower-cased). Also, Java `Enum` objects will be converted to the result of their name method. If the input is a byte array, the byte array is copied to a new byte array. (This method can't be used to decode CBOR data from a byte array; for that, use the DecodeFromBytes method instead.). @@ -2002,7 +2008,7 @@ Generates a CBOR object from an arbitrary object and gives the resulting object Returns: A CBOR object where the object valueObValue -is converted to a CBOR object and given the tag smallTag + is converted to a CBOR object and given the tag smallTag . Exceptions: