Merge branch 'json-view/13-view-dump' into json-view/14-view-compare
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
3 files changed
+10
No files matched your search
@@ -40,6 +40,8 @@ class string_ref
|
|||||||
using const_iterator = const char*;
|
using const_iterator = const char*;
|
||||||
|
|
||||||
string_ref() noexcept = default;
|
string_ref() noexcept = default;
|
||||||
|
// s must be null-terminated, as for std::string_view(const char*)
|
||||||
|
// flawfinder: ignore
|
||||||
string_ref(const char* s) : m_data(s), m_size(std::strlen(s)) {} // NOLINT(google-explicit-constructor,hicpp-explicit-conversions)
|
string_ref(const char* s) : m_data(s), m_size(std::strlen(s)) {} // NOLINT(google-explicit-constructor,hicpp-explicit-conversions)
|
||||||
string_ref(const char* s, std::size_t n) noexcept : m_data(s), m_size(n) {}
|
string_ref(const char* s, std::size_t n) noexcept : m_data(s), m_size(n) {}
|
||||||
template<typename Traits, typename Alloc>
|
template<typename Traits, typename Alloc>
|
||||||
|
|||||||
@@ -870,6 +870,7 @@ class basic_json_document
|
|||||||
|
|
||||||
/// parse into this document, reusing its memory
|
/// parse into this document, reusing its memory
|
||||||
template<typename InputType>
|
template<typename InputType>
|
||||||
|
// flawfinder: ignore (a member function, not POSIX read())
|
||||||
void read(InputType&& input,
|
void read(InputType&& input,
|
||||||
const bool allow_exceptions = true,
|
const bool allow_exceptions = true,
|
||||||
const bool ignore_comments = false,
|
const bool ignore_comments = false,
|
||||||
@@ -1036,6 +1037,8 @@ class basic_json_document
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const char* cs = reinterpret_cast<const char*>(s); // NOLINT(cppcoreguidelines-pro-type-reinterpret-cast)
|
const char* cs = reinterpret_cast<const char*>(s); // NOLINT(cppcoreguidelines-pro-type-reinterpret-cast)
|
||||||
|
// C strings are null-terminated, as for json::parse(const char*)
|
||||||
|
// flawfinder: ignore
|
||||||
build(cs, std::strlen(cs), ae, c, tc, false, true);
|
build(cs, std::strlen(cs), ae, c, tc, false, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3355,6 +3355,8 @@ class string_ref
|
|||||||
using const_iterator = const char*;
|
using const_iterator = const char*;
|
||||||
|
|
||||||
string_ref() noexcept = default;
|
string_ref() noexcept = default;
|
||||||
|
// s must be null-terminated, as for std::string_view(const char*)
|
||||||
|
// flawfinder: ignore
|
||||||
string_ref(const char* s) : m_data(s), m_size(std::strlen(s)) {} // NOLINT(google-explicit-constructor,hicpp-explicit-conversions)
|
string_ref(const char* s) : m_data(s), m_size(std::strlen(s)) {} // NOLINT(google-explicit-constructor,hicpp-explicit-conversions)
|
||||||
string_ref(const char* s, std::size_t n) noexcept : m_data(s), m_size(n) {}
|
string_ref(const char* s, std::size_t n) noexcept : m_data(s), m_size(n) {}
|
||||||
template<typename Traits, typename Alloc>
|
template<typename Traits, typename Alloc>
|
||||||
@@ -4350,6 +4352,7 @@ class basic_json_document
|
|||||||
|
|
||||||
/// parse into this document, reusing its memory
|
/// parse into this document, reusing its memory
|
||||||
template<typename InputType>
|
template<typename InputType>
|
||||||
|
// flawfinder: ignore (a member function, not POSIX read())
|
||||||
void read(InputType&& input,
|
void read(InputType&& input,
|
||||||
const bool allow_exceptions = true,
|
const bool allow_exceptions = true,
|
||||||
const bool ignore_comments = false,
|
const bool ignore_comments = false,
|
||||||
@@ -4516,6 +4519,8 @@ class basic_json_document
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const char* cs = reinterpret_cast<const char*>(s); // NOLINT(cppcoreguidelines-pro-type-reinterpret-cast)
|
const char* cs = reinterpret_cast<const char*>(s); // NOLINT(cppcoreguidelines-pro-type-reinterpret-cast)
|
||||||
|
// C strings are null-terminated, as for json::parse(const char*)
|
||||||
|
// flawfinder: ignore
|
||||||
build(cs, std::strlen(cs), ae, c, tc, false, true);
|
build(cs, std::strlen(cs), ae, c, tc, false, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user