comparison ext/json11/json11.hpp @ 242:d607ae858682

Update json11 code
author Chris Cannam <cannam@all-day-breakfast.com>
date Tue, 13 Jun 2017 17:16:03 +0100
parents bf8e3e7dd7de
children
comparison
equal deleted inserted replaced
241:fdab0a246298 242:d607ae858682
53 #include <string> 53 #include <string>
54 #include <vector> 54 #include <vector>
55 #include <map> 55 #include <map>
56 #include <memory> 56 #include <memory>
57 #include <initializer_list> 57 #include <initializer_list>
58
59 #ifdef _MSC_VER
60 #if _MSC_VER <= 1800 // VS 2013
61 #ifndef noexcept
62 #define noexcept throw()
63 #endif
64
65 #ifndef snprintf
66 #define snprintf _snprintf_s
67 #endif
68 #endif
69 #endif
58 70
59 namespace json11 { 71 namespace json11 {
60 72
61 enum JsonParse { 73 enum JsonParse {
62 STANDARD, COMMENTS 74 STANDARD, COMMENTS
163 } 175 }
164 } 176 }
165 // Parse multiple objects, concatenated or separated by whitespace 177 // Parse multiple objects, concatenated or separated by whitespace
166 static std::vector<Json> parse_multi( 178 static std::vector<Json> parse_multi(
167 const std::string & in, 179 const std::string & in,
180 std::string::size_type & parser_stop_pos,
168 std::string & err, 181 std::string & err,
169 JsonParse strategy = JsonParse::STANDARD); 182 JsonParse strategy = JsonParse::STANDARD);
183
184 static inline std::vector<Json> parse_multi(
185 const std::string & in,
186 std::string & err,
187 JsonParse strategy = JsonParse::STANDARD) {
188 std::string::size_type parser_stop_pos;
189 return parse_multi(in, parser_stop_pos, err, strategy);
190 }
170 191
171 bool operator== (const Json &rhs) const; 192 bool operator== (const Json &rhs) const;
172 bool operator< (const Json &rhs) const; 193 bool operator< (const Json &rhs) const;
173 bool operator!= (const Json &rhs) const { return !(*this == rhs); } 194 bool operator!= (const Json &rhs) const { return !(*this == rhs); }
174 bool operator<= (const Json &rhs) const { return !(rhs < *this); } 195 bool operator<= (const Json &rhs) const { return !(rhs < *this); }