diff --git a/examples/universal/z_delete.cxx b/examples/universal/z_delete.cxx index 316b7ce6..677895c9 100644 --- a/examples/universal/z_delete.cxx +++ b/examples/universal/z_delete.cxx @@ -48,7 +48,7 @@ int _main(int argc, char **argv) { if (locator) { #ifdef ZENOHCXX_ZENOHC auto locator_json_str_list = std::string("[\"") + locator + "\"]"; - config.insert_json(Z_CONFIG_CONNECT_KEY, locator_json_str_list.c_str(), &err); + config.insert_json5(Z_CONFIG_CONNECT_KEY, locator_json_str_list.c_str(), &err); #elif ZENOHCXX_ZENOHPICO config.insert(Z_CONFIG_CONNECT_KEY, locator, &err); #else diff --git a/examples/universal/z_get.cxx b/examples/universal/z_get.cxx index fc4da7cd..e4959b8c 100644 --- a/examples/universal/z_get.cxx +++ b/examples/universal/z_get.cxx @@ -46,7 +46,7 @@ int _main(int argc, char **argv) { if (locator) { #ifdef ZENOHCXX_ZENOHC auto locator_json_str_list = std::string("[\"") + locator + "\"]"; - config.insert_json(Z_CONFIG_CONNECT_KEY, locator_json_str_list.c_str(), &err); + config.insert_json5(Z_CONFIG_CONNECT_KEY, locator_json_str_list.c_str(), &err); #elif ZENOHCXX_ZENOHPICO config.insert(Z_CONFIG_CONNECT_KEY, locator, &err); #else diff --git a/examples/universal/z_get_channel.cxx b/examples/universal/z_get_channel.cxx index 734eb356..33a50d89 100644 --- a/examples/universal/z_get_channel.cxx +++ b/examples/universal/z_get_channel.cxx @@ -42,7 +42,7 @@ int _main(int argc, char **argv) { if (locator) { #ifdef ZENOHCXX_ZENOHC auto locator_json_str_list = std::string("[\"") + locator + "\"]"; - config.insert_json(Z_CONFIG_CONNECT_KEY, locator_json_str_list.c_str(), &err); + config.insert_json5(Z_CONFIG_CONNECT_KEY, locator_json_str_list.c_str(), &err); #elif ZENOHCXX_ZENOHPICO config.insert(Z_CONFIG_CONNECT_KEY, locator, &err); #else diff --git a/examples/universal/z_get_channel_non_blocking.cxx b/examples/universal/z_get_channel_non_blocking.cxx index b9f7e0df..d34914c2 100644 --- a/examples/universal/z_get_channel_non_blocking.cxx +++ b/examples/universal/z_get_channel_non_blocking.cxx @@ -45,7 +45,7 @@ int _main(int argc, char **argv) { if (locator) { #ifdef ZENOHCXX_ZENOHC auto locator_json_str_list = std::string("[\"") + locator + "\"]"; - config.insert_json(Z_CONFIG_CONNECT_KEY, locator_json_str_list.c_str(), &err); + config.insert_json5(Z_CONFIG_CONNECT_KEY, locator_json_str_list.c_str(), &err); #elif ZENOHCXX_ZENOHPICO config.insert(Z_CONFIG_CONNECT_KEY, locator, &err); #else diff --git a/examples/universal/z_info.cxx b/examples/universal/z_info.cxx index 52c02838..18c8ea25 100644 --- a/examples/universal/z_info.cxx +++ b/examples/universal/z_info.cxx @@ -39,7 +39,7 @@ int _main(int argc, char** argv) { if (locator) { #ifdef ZENOHCXX_ZENOHC auto locator_json_str_list = std::string("[\"") + locator + "\"]"; - config.insert_json(Z_CONFIG_CONNECT_KEY, locator_json_str_list.c_str(), &err); + config.insert_json5(Z_CONFIG_CONNECT_KEY, locator_json_str_list.c_str(), &err); #elif ZENOHCXX_ZENOHPICO config.insert(Z_CONFIG_CONNECT_KEY, locator, &err); #else diff --git a/examples/universal/z_pub.cxx b/examples/universal/z_pub.cxx index 258836f1..db911910 100644 --- a/examples/universal/z_pub.cxx +++ b/examples/universal/z_pub.cxx @@ -60,7 +60,7 @@ int _main(int argc, char **argv) { if (locator) { #ifdef ZENOHCXX_ZENOHC auto locator_json_str_list = std::string("[\"") + locator + "\"]"; - config.insert_json(Z_CONFIG_CONNECT_KEY, locator_json_str_list.c_str(), &err); + config.insert_json5(Z_CONFIG_CONNECT_KEY, locator_json_str_list.c_str(), &err); #elif ZENOHCXX_ZENOHPICO config.insert(Z_CONFIG_CONNECT_KEY, locator, &err); #else diff --git a/examples/universal/z_pub_delete.cxx b/examples/universal/z_pub_delete.cxx index c59b1650..5ca42aa4 100644 --- a/examples/universal/z_pub_delete.cxx +++ b/examples/universal/z_pub_delete.cxx @@ -49,7 +49,7 @@ int _main(int argc, char **argv) { if (locator) { #ifdef ZENOHCXX_ZENOHC auto locator_json_str_list = std::string("[\"") + locator + "\"]"; - config.insert_json(Z_CONFIG_CONNECT_KEY, locator_json_str_list.c_str(), &err); + config.insert_json5(Z_CONFIG_CONNECT_KEY, locator_json_str_list.c_str(), &err); #elif ZENOHCXX_ZENOHPICO config.insert(Z_CONFIG_CONNECT_KEY, locator, &err); #else diff --git a/examples/universal/z_pub_thr.cxx b/examples/universal/z_pub_thr.cxx index 95a07dac..54ecb76a 100644 --- a/examples/universal/z_pub_thr.cxx +++ b/examples/universal/z_pub_thr.cxx @@ -46,7 +46,7 @@ int _main(int argc, char **argv) { if (locator) { #ifdef ZENOHCXX_ZENOHC auto locator_json_str_list = std::string("[\"") + locator + "\"]"; - config.insert_json(Z_CONFIG_CONNECT_KEY, locator_json_str_list.c_str(), &err); + config.insert_json5(Z_CONFIG_CONNECT_KEY, locator_json_str_list.c_str(), &err); #elif ZENOHCXX_ZENOHPICO config.insert(Z_CONFIG_CONNECT_KEY, locator, &err); #else diff --git a/examples/universal/z_put.cxx b/examples/universal/z_put.cxx index a2ba8aa0..b097cbb7 100644 --- a/examples/universal/z_put.cxx +++ b/examples/universal/z_put.cxx @@ -52,7 +52,7 @@ int _main(int argc, char **argv) { if (locator) { #ifdef ZENOHCXX_ZENOHC auto locator_json_str_list = std::string("[\"") + locator + "\"]"; - config.insert_json(Z_CONFIG_CONNECT_KEY, locator_json_str_list.c_str(), &err); + config.insert_json5(Z_CONFIG_CONNECT_KEY, locator_json_str_list.c_str(), &err); #elif ZENOHCXX_ZENOHPICO config.insert(Z_CONFIG_CONNECT_KEY, locator, &err); #else diff --git a/examples/universal/z_queryable.cxx b/examples/universal/z_queryable.cxx index 92fdf83d..6591301a 100644 --- a/examples/universal/z_queryable.cxx +++ b/examples/universal/z_queryable.cxx @@ -54,7 +54,7 @@ int _main(int argc, char **argv) { if (locator) { #ifdef ZENOHCXX_ZENOHC auto locator_json_str_list = std::string("[\"") + locator + "\"]"; - config.insert_json(Z_CONFIG_CONNECT_KEY, locator_json_str_list.c_str(), &err); + config.insert_json5(Z_CONFIG_CONNECT_KEY, locator_json_str_list.c_str(), &err); #elif ZENOHCXX_ZENOHPICO config.insert(Z_CONFIG_CONNECT_KEY, locator, &err); #else diff --git a/examples/universal/z_scout.cxx b/examples/universal/z_scout.cxx index 4f51f0b0..d25eff19 100644 --- a/examples/universal/z_scout.cxx +++ b/examples/universal/z_scout.cxx @@ -66,7 +66,7 @@ int _main(int argc, char **argv) { if (locator) { #ifdef ZENOHCXX_ZENOHC auto locator_json_str_list = std::string("[\"") + locator + "\"]"; - config.insert_json(Z_CONFIG_CONNECT_KEY, locator_json_str_list.c_str(), &err); + config.insert_json5(Z_CONFIG_CONNECT_KEY, locator_json_str_list.c_str(), &err); #elif ZENOHCXX_ZENOHPICO config.insert(Z_CONFIG_CONNECT_KEY, locator, &err); #else diff --git a/examples/universal/z_sub.cxx b/examples/universal/z_sub.cxx index 4ce1ea65..b3c00f28 100644 --- a/examples/universal/z_sub.cxx +++ b/examples/universal/z_sub.cxx @@ -63,7 +63,7 @@ int _main(int argc, char **argv) { if (locator) { #ifdef ZENOHCXX_ZENOHC auto locator_json_str_list = std::string("[\"") + locator + "\"]"; - config.insert_json(Z_CONFIG_CONNECT_KEY, locator_json_str_list.c_str(), &err); + config.insert_json5(Z_CONFIG_CONNECT_KEY, locator_json_str_list.c_str(), &err); #elif ZENOHCXX_ZENOHPICO config.insert(Z_CONFIG_CONNECT_KEY, locator, &err); #else diff --git a/examples/universal/z_sub_thr.cxx b/examples/universal/z_sub_thr.cxx index 60f6f305..31d22997 100644 --- a/examples/universal/z_sub_thr.cxx +++ b/examples/universal/z_sub_thr.cxx @@ -87,7 +87,7 @@ int _main(int argc, char **argv) { if (locator) { #ifdef ZENOHCXX_ZENOHC auto locator_json_str_list = std::string("[\"") + locator + "\"]"; - config.insert_json(Z_CONFIG_CONNECT_KEY, locator_json_str_list.c_str(), &err); + config.insert_json5(Z_CONFIG_CONNECT_KEY, locator_json_str_list.c_str(), &err); #elif ZENOHCXX_ZENOHPICO config.insert(Z_CONFIG_CONNECT_KEY, locator, &err); #else diff --git a/examples/zenohc/z_get_liveliness.cxx b/examples/zenohc/z_get_liveliness.cxx index 404a63a3..6a5b8712 100644 --- a/examples/zenohc/z_get_liveliness.cxx +++ b/examples/zenohc/z_get_liveliness.cxx @@ -43,7 +43,7 @@ int _main(int argc, char **argv) { if (locator) { #ifdef ZENOHCXX_ZENOHC auto locator_json_str_list = std::string("[\"") + locator + "\"]"; - config.insert_json(Z_CONFIG_CONNECT_KEY, locator_json_str_list.c_str(), &err); + config.insert_json5(Z_CONFIG_CONNECT_KEY, locator_json_str_list.c_str(), &err); #elif ZENOHCXX_ZENOHPICO config.insert(Z_CONFIG_CONNECT_KEY, locator, &err); #else diff --git a/examples/zenohc/z_get_shm.cxx b/examples/zenohc/z_get_shm.cxx index ca63367b..d68c3b83 100644 --- a/examples/zenohc/z_get_shm.cxx +++ b/examples/zenohc/z_get_shm.cxx @@ -39,7 +39,7 @@ int _main(int argc, char **argv) { ZResult err; if (locator) { auto locator_json_str_list = std::string("[\"") + locator + "\"]"; - config.insert_json(Z_CONFIG_CONNECT_KEY, locator_json_str_list.c_str(), &err); + config.insert_json5(Z_CONFIG_CONNECT_KEY, locator_json_str_list.c_str(), &err); if (err != Z_OK) { std::cout << "Invalid locator: " << locator << std::endl; diff --git a/examples/zenohc/z_liveliness.cxx b/examples/zenohc/z_liveliness.cxx index c72a4dfe..ded909b7 100644 --- a/examples/zenohc/z_liveliness.cxx +++ b/examples/zenohc/z_liveliness.cxx @@ -43,7 +43,7 @@ int _main(int argc, char **argv) { ZResult err; if (locator) { auto locator_json_str_list = std::string("[\"") + locator + "\"]"; - config.insert_json(Z_CONFIG_CONNECT_KEY, locator_json_str_list.c_str(), &err); + config.insert_json5(Z_CONFIG_CONNECT_KEY, locator_json_str_list.c_str(), &err); if (err != Z_OK) { std::cout << "Invalid locator: " << locator << std::endl; diff --git a/examples/zenohc/z_pub_shm.cxx b/examples/zenohc/z_pub_shm.cxx index 152f2d3d..ed3d9efc 100644 --- a/examples/zenohc/z_pub_shm.cxx +++ b/examples/zenohc/z_pub_shm.cxx @@ -46,7 +46,7 @@ int _main(int argc, char **argv) { ZResult err; if (locator) { auto locator_json_str_list = std::string("[\"") + locator + "\"]"; - config.insert_json(Z_CONFIG_CONNECT_KEY, locator_json_str_list.c_str(), &err); + config.insert_json5(Z_CONFIG_CONNECT_KEY, locator_json_str_list.c_str(), &err); if (err != Z_OK) { std::cout << "Invalid locator: " << locator << std::endl; diff --git a/examples/zenohc/z_pub_shm_thr.cxx b/examples/zenohc/z_pub_shm_thr.cxx index e22e1842..2874c279 100644 --- a/examples/zenohc/z_pub_shm_thr.cxx +++ b/examples/zenohc/z_pub_shm_thr.cxx @@ -38,7 +38,7 @@ int _main(int argc, char **argv) { ZResult err; if (locator) { auto locator_json_str_list = std::string("[\"") + locator + "\"]"; - config.insert_json(Z_CONFIG_CONNECT_KEY, locator_json_str_list.c_str(), &err); + config.insert_json5(Z_CONFIG_CONNECT_KEY, locator_json_str_list.c_str(), &err); if (err != Z_OK) { std::cout << "Invalid locator: " << locator << std::endl; diff --git a/examples/zenohc/z_queryable_shm.cxx b/examples/zenohc/z_queryable_shm.cxx index a8fbee8d..6a955445 100644 --- a/examples/zenohc/z_queryable_shm.cxx +++ b/examples/zenohc/z_queryable_shm.cxx @@ -41,7 +41,7 @@ int _main(int argc, char **argv) { ZResult err; if (locator) { auto locator_json_str_list = std::string("[\"") + locator + "\"]"; - config.insert_json(Z_CONFIG_CONNECT_KEY, locator_json_str_list.c_str(), &err); + config.insert_json5(Z_CONFIG_CONNECT_KEY, locator_json_str_list.c_str(), &err); if (err != Z_OK) { std::cout << "Invalid locator: " << locator << std::endl; diff --git a/examples/zenohc/z_sub_liveliness.cxx b/examples/zenohc/z_sub_liveliness.cxx index 653fde88..581f3be0 100644 --- a/examples/zenohc/z_sub_liveliness.cxx +++ b/examples/zenohc/z_sub_liveliness.cxx @@ -48,7 +48,7 @@ int _main(int argc, char **argv) { ZResult err; if (locator) { auto locator_json_str_list = std::string("[\"") + locator + "\"]"; - config.insert_json(Z_CONFIG_CONNECT_KEY, locator_json_str_list.c_str(), &err); + config.insert_json5(Z_CONFIG_CONNECT_KEY, locator_json_str_list.c_str(), &err); if (err != Z_OK) { std::cout << "Invalid locator: " << locator << std::endl; diff --git a/examples/zenohc/z_sub_shm.cxx b/examples/zenohc/z_sub_shm.cxx index 66f1a3b7..8bc3af4d 100644 --- a/examples/zenohc/z_sub_shm.cxx +++ b/examples/zenohc/z_sub_shm.cxx @@ -79,7 +79,7 @@ int _main(int argc, char **argv) { ZResult err; if (locator) { auto locator_json_str_list = std::string("[\"") + locator + "\"]"; - config.insert_json(Z_CONFIG_CONNECT_KEY, locator_json_str_list.c_str(), &err); + config.insert_json5(Z_CONFIG_CONNECT_KEY, locator_json_str_list.c_str(), &err); if (err != Z_OK) { std::cout << "Invalid locator: " << locator << std::endl; diff --git a/include/zenoh/api/config.hxx b/include/zenoh/api/config.hxx index 4fa8ebea..7ca5c203 100644 --- a/include/zenoh/api/config.hxx +++ b/include/zenoh/api/config.hxx @@ -110,8 +110,8 @@ class Config : public Owned<::z_owned_config_t> { /// thrown in case of error. /// @return true if the parameter was inserted, false otherwise. /// @note zenoh-c only. - void insert_json(const std::string& key, const std::string& value, ZResult* err = nullptr) { - __ZENOH_RESULT_CHECK(::zc_config_insert_json(interop::as_loaned_c_ptr(*this), key.c_str(), value.c_str()), err, + void insert_json5(const std::string& key, const std::string& value, ZResult* err = nullptr) { + __ZENOH_RESULT_CHECK(::zc_config_insert_json5(interop::as_loaned_c_ptr(*this), key.c_str(), value.c_str()), err, std::string("Failed to insert '") .append(value) .append("' for the key '") @@ -149,4 +149,4 @@ class Config : public Owned<::z_owned_config_t> { } #endif }; -} // namespace zenoh \ No newline at end of file +} // namespace zenoh diff --git a/include/zenoh/api/hello.hxx b/include/zenoh/api/hello.hxx index 1ec28c9f..5b3ef57f 100644 --- a/include/zenoh/api/hello.hxx +++ b/include/zenoh/api/hello.hxx @@ -50,7 +50,7 @@ class Hello : public Owned<::z_owned_hello_t> { ::z_hello_locators(interop::as_loaned_c_ptr(*this), &out); auto out_loaned = ::z_loan(out); #else - auto out_loaned = ::z_hello_locators(interop::as_loaned_c_ptr(*this)); + auto out_loaned = ::zp_hello_locators(interop::as_loaned_c_ptr(*this)); #endif std::vector locators(::z_string_array_len(out_loaned)); for (size_t i = 0; i < ::z_string_array_len(out_loaned); i++) { @@ -83,4 +83,4 @@ class Hello : public Owned<::z_owned_hello_t> { /// @brief Move assignment operator. Hello& operator=(Hello&& other) = default; }; -} // namespace zenoh \ No newline at end of file +} // namespace zenoh diff --git a/tests/zenohc/config.cxx b/tests/zenohc/config.cxx index 7b45e43b..b3916b1f 100644 --- a/tests/zenohc/config.cxx +++ b/tests/zenohc/config.cxx @@ -22,8 +22,8 @@ using namespace zenoh; void test_config_insert() { std::vector peers = {"tcp/192.168.0.1", "tcp/10.0.0.1"}; auto config = Config::create_default(); - config.insert_json("mode", "\"client\""); - config.insert_json("connect/endpoints", "[\"tcp/192.168.0.1\", \"tcp/10.0.0.1\"]"); + config.insert_json5("mode", "\"client\""); + config.insert_json5("connect/endpoints", "[\"tcp/192.168.0.1\", \"tcp/10.0.0.1\"]"); assert(config.get("mode") == "\"client\""); assert(config.get("connect/endpoints") == "[\"tcp/192.168.0.1\",\"tcp/10.0.0.1\"]"); } diff --git a/zenoh-c b/zenoh-c index d05e7a82..7eb05090 160000 --- a/zenoh-c +++ b/zenoh-c @@ -1 +1 @@ -Subproject commit d05e7a823010365014db49c1e9f536ef8394977a +Subproject commit 7eb0509051e271977e9cbf600c82ec0989f06855 diff --git a/zenoh-pico b/zenoh-pico index 0a62ea80..dbaf8cd0 160000 --- a/zenoh-pico +++ b/zenoh-pico @@ -1 +1 @@ -Subproject commit 0a62ea80b48e2e56e910248fc3fe93180e01af93 +Subproject commit dbaf8cd06f9274fae5396d56e14fa31df9ae8221