Lines Matching refs:string_t
1498 using string_t = typename Json::string_t;
1501 // test assumes string_t and object_t::key_type are the same
1502 REQUIRE(std::is_same<string_t, typename Json::object_t::key_type>::value);
1512 string_t str = "default";
1593 SECTION("string_t/object_t::key_type key")
1595 string_t key = "foo";
1596 string_t key2 = "baz";
1597 string_t key_notfound = "bar";
1650 CHECK(j.template value<string_t>("foo", "default") == "bar");
1651 CHECK(j.template value<string_t>("foo", cpstr) == "bar");
1652 CHECK(j.template value<string_t>("foo", castr) == "bar");
1653 CHECK(j.template value<string_t>("foo", str) == "bar");
1661 CHECK(j.template value<string_t>("bar", "default") == "default");
1669 CHECK_THROWS_WITH_AS(Json().template value<string_t>("foo", "default"), "[json.exception.type_error.306] cannot use value() with null", typename Json::type_error&);
1670 CHECK_THROWS_WITH_AS(Json().template value<string_t>("foo", str), "[json.exception.type_error.306] cannot use value() with null", typename Json::type_error&);
1679 CHECK(j.template value<string_t>(key, "default") == "bar");
1680 CHECK(j.template value<string_t>(key, cpstr) == "bar");
1681 CHECK(j.template value<string_t>(key, castr) == "bar");
1682 CHECK(j.template value<string_t>(key, str) == "bar");
1690 CHECK(j.template value<string_t>(key_notfound, "default") == "default");
1698 CHECK_THROWS_WITH_AS(Json().template value<string_t>(key, "default"), "[json.exception.type_error.306] cannot use value() with null", typename Json::type_error&);
1699 CHECK_THROWS_WITH_AS(Json().template value<string_t>(key, str), "[json.exception.type_error.306] cannot use value() with null", typename Json::type_error&);
1708 CHECK(j.template value<string_t>(key, "default") == "bar");
1709 CHECK(j.template value<string_t>(key, cpstr) == "bar");
1710 CHECK(j.template value<string_t>(key, castr) == "bar");
1711 CHECK(j.template value<string_t>(key, str) == "bar");
1719 CHECK(j.template value<string_t>(key_notfound, "default") == "default");
1727 CHECK_THROWS_WITH_AS(Json().template value<string_t>(key, "default"), "[json.exception.type_error.306] cannot use value() with null", typename Json::type_error&);
1728 CHECK_THROWS_WITH_AS(Json().template value<string_t>(key, str), "[json.exception.type_error.306] cannot use value() with null", typename Json::type_error&);
1731 SECTION("string_t/object_t::key_type key")
1733 string_t key = "foo";
1734 string_t key2 = "baz";
1735 string_t key_notfound = "bar";
1737 CHECK(j.template value<string_t>(key, "default") == "bar");
1738 CHECK(j.template value<string_t>(key, cpstr) == "bar");
1739 CHECK(j.template value<string_t>(key, castr) == "bar");
1740 CHECK(j.template value<string_t>(key, str) == "bar");
1746 CHECK(j.template value<string_t>(key_notfound, "default") == "default");
1752 CHECK_THROWS_WITH_AS(Json().template value<string_t>(key, "default"), "[json.exception.type_error.306] cannot use value() with null", typename Json::type_error&);
1753 CHECK_THROWS_WITH_AS(Json().template value<string_t>(key, str), "[json.exception.type_error.306] cannot use value() with null", typename Json::type_error&);
1763 CHECK(j.template value<string_t>(key, "default") == "bar");
1764 CHECK(j.template value<string_t>(key, cpstr) == "bar");
1765 CHECK(j.template value<string_t>(key, castr) == "bar");
1766 CHECK(j.template value<string_t>(key, str) == "bar");
1774 CHECK(j.template value<string_t>(key_notfound, "default") == "default");
1789 CHECK_THROWS_WITH_AS(Json().template value<string_t>(key, "default"), "[json.exception.type_error.306] cannot use value() with null", typename Json::type_error&);
1790 CHECK_THROWS_WITH_AS(Json().template value<string_t>(key, str), "[json.exception.type_error.306] cannot use value() with null", typename Json::type_error&);