Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/3party
diff options
context:
space:
mode:
authorcc-engineering <13055392+cc-engineering@users.noreply.github.com>2019-04-09 17:24:01 +0300
committerGitHub <noreply@github.com>2019-04-09 17:24:01 +0300
commitd3c01acd1948d59924b3735add4c593b5cb55b59 (patch)
tree579e559b899b467322f3c10f2ed0710d0abb5ab8 /3party
parent8bc91ab1d991f0540dd7727a2cc670b7a222fec8 (diff)
[generator:geo_objects] Refactor: KeyValueMem -> KeyValueStorage (#10646)
* [generator:geo_objects] Refactor: KeyValueMem -> KeyValueStorage, remove KeyValueMap
Diffstat (limited to '3party')
-rw-r--r--3party/jansson/myjansson.hpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/3party/jansson/myjansson.hpp b/3party/jansson/myjansson.hpp
index 213021445d..31e55bc369 100644
--- a/3party/jansson/myjansson.hpp
+++ b/3party/jansson/myjansson.hpp
@@ -5,6 +5,8 @@
#include "base/exception.hpp"
#include "base/string_utils.hpp"
+#include "std/string_view.hpp"
+
#include <cstdint>
#include <memory>
#include <string>
@@ -35,8 +37,7 @@ public:
DECLARE_EXCEPTION(Exception, RootException);
Json() = default;
- explicit Json(std::string const & s) { ParseFrom(s); }
- explicit Json(char const * s) { ParseFrom(s); }
+ explicit Json(std::string_view const & s) { ParseFrom(s); }
Json GetDeepCopy() const
{
@@ -44,11 +45,10 @@ public:
copy.m_handle.AttachNew(get_deep_copy());
return copy;
}
- void ParseFrom(std::string const & s) { ParseFrom(s.c_str()); }
- void ParseFrom(char const * s)
+ void ParseFrom(std::string_view const & s)
{
json_error_t jsonError;
- m_handle.AttachNew(json_loads(s, 0, &jsonError));
+ m_handle.AttachNew(json_loadb(s.data(), s.size(), 0, &jsonError));
if (!m_handle)
MYTHROW(Exception, (jsonError.line, jsonError.text));
}