Ejemplo n.º 1
0
 /// <summary>
 /// <para>Converts this CBOR object to an object of an arbitrary type.
 /// See
 /// <see cref='PeterO.Cbor2.CBORObject.ToObject(System.Type)'/> for
 /// further information.</para></summary>
 /// <param name='mapper'>This parameter controls which data types are
 /// eligible for Plain-Old-Data deserialization and includes custom
 /// converters from CBOR objects to certain data types.</param>
 /// <param name='options'>Specifies options for controlling
 /// deserialization of CBOR objects.</param>
 /// <typeparam name='T'>The type, class, or interface that this
 /// method's return value will belong to. <b>Note:</b> For security
 /// reasons, an application should not base this parameter on user
 /// input or other externally supplied data. Whenever possible, this
 /// parameter should be either a type specially handled by this method
 /// (such as <c>int</c> or <c>String</c> ) or a plain-old-data type
 /// (POCO or POJO type) within the control of the application. If the
 /// plain-old-data type references other data types, those types should
 /// likewise meet either criterion above.</typeparam>
 /// <returns>The converted object.</returns>
 /// <exception cref='NotSupportedException'>The given type "T", or this
 /// object's CBOR type, is not supported.</exception>
 public T ToObject <T>(CBORTypeMapper mapper, PODOptions options)
 {
     return((T)this.ToObject(typeof(T), mapper, options));
 }
Ejemplo n.º 2
0
 /// <summary>
 /// <para>Converts this CBOR object to an object of an arbitrary type.
 /// See
 /// <see cref='PeterO.Cbor2.CBORObject.ToObject(System.Type)'/> for
 /// further information.</para></summary>
 /// <param name='options'>Specifies options for controlling
 /// deserialization of CBOR objects.</param>
 /// <typeparam name='T'>The type, class, or interface that this
 /// method's return value will belong to. <b>Note:</b> For security
 /// reasons, an application should not base this parameter on user
 /// input or other externally supplied data. Whenever possible, this
 /// parameter should be either a type specially handled by this method
 /// (such as <c>int</c> or <c>String</c> ) or a plain-old-data type
 /// (POCO or POJO type) within the control of the application. If the
 /// plain-old-data type references other data types, those types should
 /// likewise meet either criterion above.</typeparam>
 /// <returns>The converted object.</returns>
 /// <exception cref='NotSupportedException'>The given type "T", or this
 /// object's CBOR type, is not supported.</exception>
 public T ToObject <T>(PODOptions options)
 {
     return((T)this.ToObject(typeof(T), options));
 }