Skip to content

Commit

Permalink
Doc update
Browse files Browse the repository at this point in the history
  • Loading branch information
danielaparker committed May 18, 2020
1 parent ad91b44 commit f9af44a
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
8 changes: 8 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ Bug fixes:

- Fixed compile error when building with Android SDK level less than 21 [\#240](https://github.com/danielaparker/jsoncons/pull/240)

Changes:

- The factory function `make_array_iterator()` has been replaced by
`staj_array()`.

- The factory function `make_object_iterator()` has been replaced by
`staj_object()`.

Enhancements:

- Generalized `basic_json(byte_string_arg_t, ...` constructor to accomodate any contiguous byte sequence container,
Expand Down
4 changes: 2 additions & 2 deletions doc/ref/staj_object_iterator.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ int main()
{
json_cursor cursor(example);
auto it = make_object_iterator<json>(cursor);
auto view = staj_object<json>(cursor);
for (const auto& kv : it)
for (const auto& kv : view)
{
std::cout << kv.first << ":\n" << pretty_print(kv.second) << "\n";
}
Expand Down
16 changes: 16 additions & 0 deletions include/jsoncons/staj_view.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,22 @@ namespace jsoncons {
return staj_object_view<Json,T>(cursor);
}

#if !defined(JSONCONS_NO_DEPRECATED)
template <class T, class CharT, class Json=typename std::conditional<is_basic_json<T>::value,T,basic_json<CharT>>::type>
JSONCONS_DEPRECATED_MSG("Instead, use staj_array()")
staj_array_view<Json,T> make_array_iterator(basic_staj_cursor<CharT>& cursor)
{
return staj_array_view<Json,T>(cursor);
}

template <class T, class CharT, class Json=typename std::conditional<is_basic_json<T>::value,T,basic_json<CharT>>::type>
JSONCONS_DEPRECATED_MSG("Instead, use staj_object()")
staj_object_view<Json,T> make_object_iterator(basic_staj_cursor<CharT>& cursor)
{
return staj_object_view<Json,T>(cursor);
}
#endif

} // namespace jsoncons

#endif
Expand Down

0 comments on commit f9af44a

Please sign in to comment.