The thought here is that std::string is already a collection of 'char',
and a single-length string is a single char.  

I'm curious to see what others have to say, so perhaps this is something
that could be added anyway.

If you push a review to Gerrit, I'd definitely be willing to review and
consider it.

Thanks!
-Erich

On Tue, 2015-04-28 at 16:06 +0800, Han-Lin Li wrote:
> Current iotivity doesn't support char datatype which makes
> transmitting binary data difficult.
> 
> Will char datatype be support in the future?
> 
> diff --git a/resource/include/OCRepresentation.h
> b/resource/include/OCRepresentation.h
> index ef9d1a9..434286b 100644
> --- a/resource/include/OCRepresentation.h
> +++ b/resource/include/OCRepresentation.h
> @@ -250,6 +251,7 @@ namespace OC
>                       std::is_same<T, int>::value ||
>                       std::is_same<T, double>::value ||
>                       std::is_same<T, bool>::value ||
> +                     std::is_same<T, std::vector<char>>::value ||
>                       std::is_same<T, std::string>::value ||
>                       std::is_same<T, OCRepresentation>::value ||
>                       std::is_same<T, std::vector<int>>::value ||
> 
> diff --git a/resource/include/AttributeValue.h
> b/resource/include/AttributeValue.h
> index 327bf13..9f333cd 100644
> --- a/resource/include/AttributeValue.h
> +++ b/resource/include/AttributeValue.h
> @@ -36,6 +36,7 @@
>  #include <boost/variant.hpp>
>  #include <iosfwd>
>  #include <OCUtilities.h>
> +
>  namespace OC
>  {
>      class OCRepresentation;
> @@ -59,8 +60,11 @@ namespace OC
>          std::vector<int>,
>          std::vector<double>,
>          std::vector<bool>,
> +        std::vector<char>,
>          std::vector<std::string>,
>          std::vector<OC::OCRepresentation>,
> +        std::vector<std::vector<char>>,
> +        std::vector<std::vector<std::vector<char>>>,
> 
>          // Nested sequences:
>          std::vector<std::vector<int>>,
> @@ -77,6 +81,7 @@ namespace OC
> 
>          std::vector<std::vector<OC::OCRepresentation>>,
>          std::vector<std::vector<std::vector<OC::OCRepresentation>>>
> +
>      > AttributeValue;
> 
>      enum class AttributeType
> @@ -118,6 +123,12 @@ namespace OC
>      };
> 
>      template<>
> +    struct AttributeTypeConvert<char>
> +    {
> +        constexpr static AttributeType type = AttributeType::Boolean;
> +    };
> +
> +    template<>
>      struct AttributeTypeConvert<std::string>
>      {
>          constexpr static AttributeType type = AttributeType::String;
> _______________________________________________
> iotivity-dev mailing list
> iotivity-dev at lists.iotivity.org
> https://lists.iotivity.org/mailman/listinfo/iotivity-dev

Reply via email to