Flow123d  JS_before_hm-1755-g6249b9fc1
json_spirit_stream_reader.h
Go to the documentation of this file.
1 #ifndef JSON_SPIRIT_READ_STREAM
2 #define JSON_SPIRIT_READ_STREAM
3 
4 // Copyright John W. Wilkinson 2007 - 2011
5 // Distributed under the MIT License, see accompanying file LICENSE.txt
6 
7 // json spirit version 4.05
8 
9 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
10 # pragma once
11 #endif
12 
14 
15 namespace json_spirit
16 {
17  // these classes allows you to read multiple top level contiguous values from a stream,
18  // the normal stream read functions have a bug that prevent multiple top level values
19  // from being read unless they are separated by spaces
20 
21  template< class Istream_type, class Value_type >
23  {
24  public:
25 
26  Stream_reader( Istream_type& is )
27  : iters_( is )
28  {
29  }
30 
32  {
34  }
35 
36  private:
37 
39 
41  };
42 
43  template< class Istream_type, class Value_type >
45  {
46  public:
47 
48  Stream_reader_thrower( Istream_type& is )
49  : iters_( is )
50  , posn_begin_( iters_.begin_, iters_.end_ )
51  , posn_end_( iters_.end_, iters_.end_ )
52  {
53  }
54 
56  {
58  }
59 
60  private:
61 
63  typedef spirit_namespace::position_iterator< typename Mp_iters::Mp_iter > Posn_iter_t;
64 
67  };
68 }
69 
70 #endif
json_spirit::Stream_reader_thrower
Definition: json_spirit_stream_reader.h:44
json_spirit::Stream_reader
Definition: json_spirit_stream_reader.h:22
json_spirit_reader_template.h
json_spirit::Stream_reader_thrower::posn_end_
Posn_iter_t posn_end_
Definition: json_spirit_stream_reader.h:66
value
static constexpr bool value
Definition: json.hpp:87
json_spirit::read_range
bool read_range(Iter_type &begin, Iter_type end, Value_type &value)
Definition: json_spirit_reader_template.h:615
json_spirit::Stream_reader::read_next
bool read_next(Value_type &value)
Definition: json_spirit_stream_reader.h:31
json_spirit::Stream_reader_thrower::Stream_reader_thrower
Stream_reader_thrower(Istream_type &is)
Definition: json_spirit_stream_reader.h:48
json_spirit::Stream_reader::Mp_iters
Multi_pass_iters< Istream_type > Mp_iters
Definition: json_spirit_stream_reader.h:38
json_spirit::Multi_pass_iters::end_
Mp_iter end_
Definition: json_spirit_reader_template.h:576
json_spirit::Stream_reader_thrower::posn_begin_
Posn_iter_t posn_begin_
Definition: json_spirit_stream_reader.h:66
json_spirit::Stream_reader::Stream_reader
Stream_reader(Istream_type &is)
Definition: json_spirit_stream_reader.h:26
json_spirit::read_range_or_throw
Iter_type read_range_or_throw(Iter_type begin, Iter_type end, Value_type &value)
Definition: json_spirit_reader_template.h:588
json_spirit::Value_type
Value_type
Definition: json_spirit_value.h:32
json_spirit::Stream_reader_thrower::iters_
Mp_iters iters_
Definition: json_spirit_stream_reader.h:65
json_spirit::Stream_reader_thrower::Mp_iters
Multi_pass_iters< Istream_type > Mp_iters
Definition: json_spirit_stream_reader.h:62
json_spirit
Definition: json_spirit_error_position.h:15
json_spirit::Stream_reader_thrower::Posn_iter_t
spirit_namespace::position_iterator< typename Mp_iters::Mp_iter > Posn_iter_t
Definition: json_spirit_stream_reader.h:63
json_spirit::Stream_reader::iters_
Mp_iters iters_
Definition: json_spirit_stream_reader.h:40
json_spirit::Multi_pass_iters
Definition: json_spirit_reader_template.h:561
json_spirit::Stream_reader_thrower::read_next
void read_next(Value_type &value)
Definition: json_spirit_stream_reader.h:55
json_spirit::Multi_pass_iters::begin_
Mp_iter begin_
Definition: json_spirit_reader_template.h:575