Added C-Style array support.

Existing mapping:
  convert:
  pack:
    char[N]       => STR
    const char[N] => STR
  object:
    char[N]       => STR (v1 only)
    const char[N] => STR (v1 only)
  object_with_zone:
    char[N]       => STR
    const char[N] => STR

Additional mapping:

  convert:
    STR        => char[N]
    ARRAY      => T[N]
  pack:
    T[N]       => ARRAY
    const T[N] => ARRAY
  object:
  object_with_zone:
    T[N]       => ARRAY
    const T[N] => ARRAY
This commit is contained in:
Takatoshi Kondo
2016-05-16 17:18:26 +09:00
parent 068041f05e
commit cc02da0ccf
22 changed files with 869 additions and 143 deletions

View File

@@ -341,6 +341,8 @@ TEST(object_with_zone, char_ptr)
EXPECT_EQ(obj.as<string>()[0], 'a');
}
#if MSGPACK_DEFAULT_API_VERSION == 1
TEST(object_without_zone, char_ptr)
{
char v[] = "abc";
@@ -351,6 +353,7 @@ TEST(object_without_zone, char_ptr)
EXPECT_EQ(obj.as<string>()[0], 'd');
}
#endif // MSGPACK_DEFAULT_API_VERSION == 1
// raw_ref
TEST(object_with_zone, raw_ref)