]>
git.proxmox.com Git - ceph.git/blob - ceph/src/json_spirit/json_spirit_reader.cpp
1 // Copyright John W. Wilkinson 2007 - 2011
2 // Distributed under the MIT License, see accompanying file LICENSE.txt
4 // json spirit version 4.05
6 #include "json_spirit_reader.h"
7 #include "json_spirit_reader_template.h"
9 using namespace json_spirit
;
11 #ifdef JSON_SPIRIT_VALUE_ENABLED
12 bool json_spirit::read( const std::string
& s
, Value
& value
)
14 return read_string( s
, value
);
17 void json_spirit::read_or_throw( const std::string
& s
, Value
& value
)
19 read_string_or_throw( s
, value
);
22 bool json_spirit::read( std::istream
& is
, Value
& value
)
24 return read_stream( is
, value
);
27 void json_spirit::read_or_throw( std::istream
& is
, Value
& value
)
29 read_stream_or_throw( is
, value
);
32 bool json_spirit::read( std::string::const_iterator
& begin
, std::string::const_iterator end
, Value
& value
)
34 return read_range( begin
, end
, value
);
37 void json_spirit::read_or_throw( std::string::const_iterator
& begin
, std::string::const_iterator end
, Value
& value
)
39 begin
= read_range_or_throw( begin
, end
, value
);
43 #if defined( JSON_SPIRIT_WVALUE_ENABLED ) && !defined( BOOST_NO_STD_WSTRING )
44 bool json_spirit::read( const std::wstring
& s
, wValue
& value
)
46 return read_string( s
, value
);
49 void json_spirit::read_or_throw( const std::wstring
& s
, wValue
& value
)
51 read_string_or_throw( s
, value
);
54 bool json_spirit::read( std::wistream
& is
, wValue
& value
)
56 return read_stream( is
, value
);
59 void json_spirit::read_or_throw( std::wistream
& is
, wValue
& value
)
61 read_stream_or_throw( is
, value
);
64 bool json_spirit::read( std::wstring::const_iterator
& begin
, std::wstring::const_iterator end
, wValue
& value
)
66 return read_range( begin
, end
, value
);
69 void json_spirit::read_or_throw( std::wstring::const_iterator
& begin
, std::wstring::const_iterator end
, wValue
& value
)
71 begin
= read_range_or_throw( begin
, end
, value
);
75 #ifdef JSON_SPIRIT_MVALUE_ENABLED
76 bool json_spirit::read( const std::string
& s
, mValue
& value
)
78 return read_string( s
, value
);
81 void json_spirit::read_or_throw( const std::string
& s
, mValue
& value
)
83 read_string_or_throw( s
, value
);
86 bool json_spirit::read( std::istream
& is
, mValue
& value
)
88 return read_stream( is
, value
);
91 void json_spirit::read_or_throw( std::istream
& is
, mValue
& value
)
93 read_stream_or_throw( is
, value
);
96 bool json_spirit::read( std::string::const_iterator
& begin
, std::string::const_iterator end
, mValue
& value
)
98 return read_range( begin
, end
, value
);
101 void json_spirit::read_or_throw( std::string::const_iterator
& begin
, std::string::const_iterator end
, mValue
& value
)
103 begin
= read_range_or_throw( begin
, end
, value
);
107 #if defined( JSON_SPIRIT_WMVALUE_ENABLED ) && !defined( BOOST_NO_STD_WSTRING )
108 bool json_spirit::read( const std::wstring
& s
, wmValue
& value
)
110 return read_string( s
, value
);
113 void json_spirit::read_or_throw( const std::wstring
& s
, wmValue
& value
)
115 read_string_or_throw( s
, value
);
118 bool json_spirit::read( std::wistream
& is
, wmValue
& value
)
120 return read_stream( is
, value
);
123 void json_spirit::read_or_throw( std::wistream
& is
, wmValue
& value
)
125 read_stream_or_throw( is
, value
);
128 bool json_spirit::read( std::wstring::const_iterator
& begin
, std::wstring::const_iterator end
, wmValue
& value
)
130 return read_range( begin
, end
, value
);
133 void json_spirit::read_or_throw( std::wstring::const_iterator
& begin
, std::wstring::const_iterator end
, wmValue
& value
)
135 begin
= read_range_or_throw( begin
, end
, value
);