mirror of
https://github.com/nlohmann/json.git
synced 2024-12-21 03:47:52 +08:00
add detail/iterators/internal_iterator.hpp
This commit is contained in:
parent
51ecc31db7
commit
3e65a65290
3
Makefile
3
Makefile
@ -13,7 +13,8 @@ SRCS = ${SRCDIR}/json.hpp \
|
|||||||
${SRCDIR}/detail/parsing/input_adapters.hpp \
|
${SRCDIR}/detail/parsing/input_adapters.hpp \
|
||||||
${SRCDIR}/detail/parsing/lexer.hpp \
|
${SRCDIR}/detail/parsing/lexer.hpp \
|
||||||
${SRCDIR}/detail/parsing/parser.hpp \
|
${SRCDIR}/detail/parsing/parser.hpp \
|
||||||
${SRCDIR}/detail/iterators/primitive_iterator.hpp
|
${SRCDIR}/detail/iterators/primitive_iterator.hpp \
|
||||||
|
${SRCDIR}/detail/iterators/internal_iterator.hpp
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
28
src/detail/iterators/internal_iterator.hpp
Normal file
28
src/detail/iterators/internal_iterator.hpp
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
#ifndef NLOHMANN_JSON_DETAIL_ITERATORS_INTERNAL_ITERATOR_HPP
|
||||||
|
#define NLOHMANN_JSON_DETAIL_ITERATORS_INTERNAL_ITERATOR_HPP
|
||||||
|
|
||||||
|
#include "detail/iterators/primitive_iterator.hpp"
|
||||||
|
|
||||||
|
namespace nlohmann
|
||||||
|
{
|
||||||
|
namespace detail
|
||||||
|
{
|
||||||
|
/*!
|
||||||
|
@brief an iterator value
|
||||||
|
|
||||||
|
@note This structure could easily be a union, but MSVC currently does not allow
|
||||||
|
unions members with complex constructors, see https://github.com/nlohmann/json/pull/105.
|
||||||
|
*/
|
||||||
|
template<typename BasicJsonType> struct internal_iterator
|
||||||
|
{
|
||||||
|
/// iterator for JSON objects
|
||||||
|
typename BasicJsonType::object_t::iterator object_iterator {};
|
||||||
|
/// iterator for JSON arrays
|
||||||
|
typename BasicJsonType::array_t::iterator array_iterator {};
|
||||||
|
/// generic iterator for all other types
|
||||||
|
primitive_iterator_t primitive_iterator {};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
17
src/json.hpp
17
src/json.hpp
@ -61,6 +61,7 @@ SOFTWARE.
|
|||||||
#include "detail/parsing/lexer.hpp"
|
#include "detail/parsing/lexer.hpp"
|
||||||
#include "detail/parsing/parser.hpp"
|
#include "detail/parsing/parser.hpp"
|
||||||
#include "detail/iterators/primitive_iterator.hpp"
|
#include "detail/iterators/primitive_iterator.hpp"
|
||||||
|
#include "detail/iterators/internal_iterator.hpp"
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@brief namespace for Niels Lohmann
|
@brief namespace for Niels Lohmann
|
||||||
@ -75,22 +76,6 @@ namespace detail
|
|||||||
// iterators //
|
// iterators //
|
||||||
///////////////
|
///////////////
|
||||||
|
|
||||||
/*!
|
|
||||||
@brief an iterator value
|
|
||||||
|
|
||||||
@note This structure could easily be a union, but MSVC currently does not allow
|
|
||||||
unions members with complex constructors, see https://github.com/nlohmann/json/pull/105.
|
|
||||||
*/
|
|
||||||
template<typename BasicJsonType> struct internal_iterator
|
|
||||||
{
|
|
||||||
/// iterator for JSON objects
|
|
||||||
typename BasicJsonType::object_t::iterator object_iterator {};
|
|
||||||
/// iterator for JSON arrays
|
|
||||||
typename BasicJsonType::array_t::iterator array_iterator {};
|
|
||||||
/// generic iterator for all other types
|
|
||||||
primitive_iterator_t primitive_iterator {};
|
|
||||||
};
|
|
||||||
|
|
||||||
template<typename IteratorType> class iteration_proxy;
|
template<typename IteratorType> class iteration_proxy;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
Loading…
Reference in New Issue
Block a user