mirror of
https://github.com/Tencent/rapidjson.git
synced 2025-10-28 03:20:15 +01:00
Add templated accessors for C string
This commit is contained in:
@@ -768,6 +768,11 @@ TEST(Value, String) {
|
||||
EXPECT_STREQ("World", w.GetString());
|
||||
EXPECT_EQ(5u, w.GetStringLength());
|
||||
|
||||
// templated functions
|
||||
EXPECT_TRUE(z.Is<const char*>());
|
||||
EXPECT_STREQ(cstr, z.Get<const char*>());
|
||||
EXPECT_STREQ("Apple", z.Set<const char*>("Apple").Get<const char*>());
|
||||
|
||||
#if RAPIDJSON_HAS_STDSTRING
|
||||
{
|
||||
std::string str = "Hello World";
|
||||
|
||||
Reference in New Issue
Block a user