Skip to content

Commit

Permalink
edit docs
Browse files Browse the repository at this point in the history
  • Loading branch information
peteroupc committed Apr 22, 2015
1 parent afad7c1 commit 3279c7e
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 13 deletions.
11 changes: 6 additions & 5 deletions PeterO/Cbor/CBORObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2454,7 +2454,7 @@ public static void Write(string str, Stream stream) {
/// <summary>Writes a string in CBOR format to a data stream.</summary>
/// <param name='str'>The string to write. Can be null.</param>
/// <param name='stream'>A writable data stream.</param>
/// <param name='options'>A CBOREncodeOptions object.</param>
/// <param name='options'>Options for encoding the data to CBOR.</param>
/// <exception cref='ArgumentNullException'>The parameter <paramref
/// name='stream'/> is null.</exception>
/// <exception cref='System.IO.IOException'>An I/O error occurred.</exception>
Expand All @@ -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
Expand Down Expand Up @@ -2721,7 +2722,7 @@ public void WriteTo(Stream stream) {

/// <summary>Writes this CBOR object to a data stream.</summary>
/// <param name='stream'>A writable data stream.</param>
/// <param name='options'>A CBOREncodeOptions object.</param>
/// <param name='options'>Options for encoding the data to CBOR.</param>
/// <exception cref='ArgumentNullException'>The parameter <paramref
/// name='stream'/> is null.</exception>
/// <exception cref='System.IO.IOException'>An I/O error occurred.</exception>
Expand Down Expand Up @@ -2986,7 +2987,7 @@ public byte[] EncodeToBytes() {
}

/// <summary>Gets the binary representation of this data item.</summary>
/// <param name='options'>A CBOREncodeOptions object.</param>
/// <param name='options'>Options for encoding the data to CBOR.</param>
/// <returns>A byte array in CBOR format.</returns>
public byte[] EncodeToBytes(CBOREncodeOptions options) {
// For some types, a memory stream is a lot of
Expand Down Expand Up @@ -3130,7 +3131,7 @@ public static void Write(object objValue, Stream stream) {
/// </summary>
/// <param name='objValue'>The value to write.</param>
/// <param name='stream'>A writable data stream.</param>
/// <param name='options'>A CBOREncodeOptions object.</param>
/// <param name='options'>Options for encoding the data to CBOR.</param>
/// <exception cref='ArgumentException'>The object's type is not
/// supported.</exception>
/// <exception cref='ArgumentNullException'>The parameter <paramref
Expand Down
2 changes: 1 addition & 1 deletion docs/APIDocs.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* [PeterO.Cbor.CBORDataUtilities](PeterO.Cbor.CBORDataUtilities.md) - Contains methods useful for reading and writing data, with a focus on CBOR.
* [PeterO.Cbor.CBOREncodeOptions](PeterO.Cbor.CBOREncodeOptions.md) - Specifies options for encoding CBOR objects to bytes.
* [PeterO.Cbor.CBORException](PeterO.Cbor.CBORException.md) - Exception thrown for errors involving CBOR data.
* [PeterO.Cbor.CBORObject](PeterO.Cbor.CBORObject.md) - Represents an object in Concise Binary Object Representation (CBOR) and contains methods for reading and writing CBOR data.
* [PeterO.Cbor.CBORObject](PeterO.Cbor.CBORObject.md) - Represents an object in Concise Binary Object Representation (CBOR) and contains methods for reading and writing CBOR data.
* [PeterO.Cbor.CBORType](PeterO.Cbor.CBORType.md) - Represents a type that a CBOR object can have.
* [PeterO.Cbor.CBORTypeFilter](PeterO.Cbor.CBORTypeFilter.md) - Specifies what kinds of CBOR objects a tag can be.
* [PeterO.Cbor.ICBORConverter&lt;T&gt;](PeterO.Cbor.ICBORConverter-T.md) - Interface implemented by classes that convert objects of arbitrary types to CBOR objects.
Expand Down
20 changes: 20 additions & 0 deletions docs/PeterO.Cbor.CBOREncodeOptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,37 @@ Always encode strings with a definite-length encoding. Value: 1.

Combines the flags of this options object with another options object.

<b>Parameters:</b>

* <i>o</i>: A CBOREncodeOptions object. (2).

<b>Returns:</b>

A CBOREncodeOptions object.

### And

public PeterO.Cbor.CBOREncodeOptions And(
PeterO.Cbor.CBOREncodeOptions o);

Returns an options object whose flags are shared by this and another options object.

<b>Parameters:</b>

* <i>o</i>: A CBOREncodeOptions object. (2).

<b>Returns:</b>

A CBOREncodeOptions object.

### Value

public int Value { get; }

Gets this options object's value.

<b>Returns:</b>

This options object's value.


20 changes: 13 additions & 7 deletions docs/PeterO.Cbor.CBORObject.md
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ This object is not an array.

* System.ArgumentException:
The type of <i>obj</i>
is not supported.
is not supported.

### Remove

Expand Down Expand Up @@ -910,7 +910,7 @@ Writes a string in CBOR format to a data stream.

* <i>stream</i>: A writable data stream.

* <i>options</i>: A CBOREncodeOptions object.
* <i>options</i>: Options for encoding the data to CBOR.

<b>Exceptions:</b>

Expand Down Expand Up @@ -1061,7 +1061,7 @@ Writes this CBOR object to a data stream.

* <i>stream</i>: A writable data stream.

* <i>options</i>: A CBOREncodeOptions object.
* <i>options</i>: Options for encoding the data to CBOR.

<b>Exceptions:</b>

Expand Down Expand Up @@ -1279,7 +1279,7 @@ Gets the binary representation of this data item.

<b>Parameters:</b>

* <i>options</i>: A CBOREncodeOptions object.
* <i>options</i>: Options for encoding the data to CBOR.

<b>Returns:</b>

Expand Down Expand Up @@ -1313,6 +1313,12 @@ The parameter <i>stream</i>

Not documented yet.

<b>Parameters:</b>

* <i>objValue</i>: An arbitrary object.

* <i>stream</i>: A writable data stream.

### Write

public static void Write(
Expand All @@ -1336,7 +1342,7 @@ Writes an arbitrary object to a CBOR data stream. Currently, the following objec

* <i>stream</i>: A writable data stream.

* <i>options</i>: A CBOREncodeOptions object.
* <i>options</i>: Options for encoding the data to CBOR.

<b>Exceptions:</b>

Expand Down Expand Up @@ -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.).

Expand Down Expand Up @@ -2002,7 +2008,7 @@ Generates a CBOR object from an arbitrary object and gives the resulting object
<b>Returns:</b>

A CBOR object where the object <i>valueObValue</i>
is converted to a CBOR object and given the tag <i>smallTag</i>
is converted to a CBOR object and given the tag <i>smallTag</i>
.

<b>Exceptions:</b>
Expand Down

0 comments on commit 3279c7e

Please sign in to comment.