Skip to content

Commit f883e5c

Browse files
committed
tidy includes
1 parent c724de6 commit f883e5c

File tree

134 files changed

+157
-313
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+157
-313
lines changed

include/jsoncons/basic_json.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#include <algorithm> // std::swap
1111
#include <cstring>
1212
#include <cstring> // std::memcpy
13-
#include <exception>
1413
#include <initializer_list> // std::initializer_list
1514
#include <istream> // std::basic_istream
1615
#include <limits> // std::numeric_limits
@@ -39,6 +38,7 @@
3938
#include <jsoncons/pretty_print.hpp>
4039
#include <jsoncons/utility/bigint.hpp>
4140
#include <jsoncons/utility/heap_string.hpp>
41+
#include <jsoncons/utility/extension_traits.hpp>
4242

4343
#if defined(JSONCONS_HAS_POLYMORPHIC_ALLOCATOR)
4444
#include <memory_resource> // std::poymorphic_allocator

include/jsoncons/byte_string.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
#include <cmath>
1111
#include <cstring> // std::memcmp
12-
#include <exception>
1312
#include <initializer_list>
1413
#include <iomanip> // std::setw
1514
#include <iterator>
@@ -22,7 +21,6 @@
2221
#include <jsoncons/config/jsoncons_config.hpp>
2322
#include <jsoncons/conv_error.hpp>
2423
#include <jsoncons/utility/extension_traits.hpp>
25-
#include <jsoncons/json_exception.hpp>
2624

2725
namespace jsoncons {
2826

include/jsoncons/chunk_reader.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#ifndef JSONCONS_CHUNK_READER_HPP
88
#define JSONCONS_CHUNK_READER_HPP
99

10+
#include <cstddef>
1011
#include <functional>
1112
#include <system_error>
1213

include/jsoncons/config/compiler_support.hpp

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@
88
#define JSONCONS_CONFIG_COMPILER_SUPPORT_HPP
99

1010
#include <cmath>
11-
#include <exception>
12-
#include <ostream>
13-
#include <stdexcept>
14-
#include <string>
1511
#include <cstring> // std::memcpy
1612
#include <limits> // std::numeric_limits
1713

@@ -238,19 +234,6 @@
238234
#endif
239235
#endif
240236

241-
// allow to disable exceptions
242-
#if !defined(JSONCONS_NO_EXCEPTIONS)
243-
#define JSONCONS_THROW(exception) throw exception
244-
#define JSONCONS_RETHROW throw
245-
#define JSONCONS_TRY try
246-
#define JSONCONS_CATCH(exception) catch(exception)
247-
#else
248-
#define JSONCONS_THROW(exception) std::terminate()
249-
#define JSONCONS_RETHROW std::terminate()
250-
#define JSONCONS_TRY if (true)
251-
#define JSONCONS_CATCH(exception) if (false)
252-
#endif
253-
254237
#if !defined(JSONCONS_HAS_STD_MAKE_UNIQUE)
255238
#if defined(__clang__) && defined(__cplusplus)
256239
#if defined(__APPLE__)

include/jsoncons/config/jsoncons_config.hpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,23 @@
1313
#include <cstdint>
1414
#include <memory>
1515
#include <stdexcept>
16-
#include <type_traits> // std::enable_if
16+
#include <string>
1717

1818
#include <jsoncons/config/compiler_support.hpp>
1919

20+
// allow to disable exceptions
21+
#if !defined(JSONCONS_NO_EXCEPTIONS)
22+
#define JSONCONS_THROW(exception) throw exception
23+
#define JSONCONS_RETHROW throw
24+
#define JSONCONS_TRY try
25+
#define JSONCONS_CATCH(exception) catch(exception)
26+
#else
27+
#define JSONCONS_THROW(exception) std::terminate()
28+
#define JSONCONS_RETHROW std::terminate()
29+
#define JSONCONS_TRY if (true)
30+
#define JSONCONS_CATCH(exception) if (false)
31+
#endif
32+
2033
namespace jsoncons {
2134

2235
class assertion_error : public std::runtime_error

include/jsoncons/conv_error.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
#ifndef JSONCONS_CONV_ERROR_HPP
88
#define JSONCONS_CONV_ERROR_HPP
99

10+
#include <cstddef>
11+
#include <string>
1012
#include <system_error>
1113

1214
#include <jsoncons/config/jsoncons_config.hpp>

include/jsoncons/decode_json.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99

1010
#include <iostream>
1111
#include <istream> // std::basic_istream
12-
#include <memory>
13-
#include <string>
1412
#include <tuple>
1513

1614
#include <jsoncons/allocator_set.hpp>

include/jsoncons/decode_traits.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#define JSONCONS_DECODE_TRAITS_HPP
99

1010
#include <array>
11-
#include <memory>
11+
#include <cstddef>
1212
#include <string>
1313
#include <tuple>
1414
#include <type_traits> // std::enable_if, std::true_type, std::false_type

include/jsoncons/detail/parse_number.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
#define JSONCONS_DETAIL_PARSE_NUMBER_HPP
99

1010
#include <cctype>
11-
#include <exception>
12-
#include <limits> // std::numeric_limits
11+
#include <cstddef>
1312
#include <locale>
1413
#include <stdexcept>
1514
#include <string>
@@ -19,6 +18,7 @@
1918

2019
#include <jsoncons/config/jsoncons_config.hpp>
2120
#include <jsoncons/json_exception.hpp>
21+
#include <jsoncons/utility/extension_traits.hpp>
2222

2323
namespace jsoncons { namespace detail {
2424

include/jsoncons/detail/span.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
#ifndef JSONCONS_DETAIL_SPAN_HPP
88
#define JSONCONS_DETAIL_SPAN_HPP
99

10+
#include <cstddef>
1011
#include <iterator>
1112
#include <limits>
1213
#include <memory> // std::addressof
1314
#include <type_traits> // std::enable_if, std::true_type, std::false_type
14-
#include <utility> // std::swap
1515

1616
#include <jsoncons/config/compiler_support.hpp>
1717
#include <jsoncons/utility/extension_traits.hpp>

include/jsoncons/detail/string_view.hpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,12 @@
99

1010
#include <algorithm> // std::find, std::min, std::reverse
1111
#include <cmath>
12-
#include <exception>
12+
#include <cstddef>
1313
#include <istream> // std::basic_istream
1414
#include <iterator>
15-
#include <memory>
1615
#include <ostream>
1716
#include <stdexcept>
1817
#include <string>
19-
#include <vector>
2018

2119
#include <jsoncons/config/compiler_support.hpp>
2220

include/jsoncons/detail/write_number.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
#ifndef JSONCONS_DETAIL_WRITE_NUMBER_HPP
88
#define JSONCONS_DETAIL_WRITE_NUMBER_HPP
99

10+
#include <cstddef>
1011
#include <cmath>
11-
#include <exception>
1212
#include <limits> // std::numeric_limits
1313
#include <locale>
1414
#include <stdexcept>

include/jsoncons/encode_json.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,11 @@
99

1010
#include <iostream>
1111
#include <istream> // std::basic_istream
12-
#include <memory>
13-
#include <string>
1412
#include <tuple>
1513

1614
#include <jsoncons/encode_traits.hpp>
1715
#include <jsoncons/json_cursor.hpp>
16+
#include <jsoncons/utility/extension_traits.hpp>
1817

1918
namespace jsoncons {
2019

include/jsoncons/encode_traits.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#define JSONCONS_ENCODE_TRAITS_HPP
99

1010
#include <array>
11+
#include <cstddef>
1112
#include <memory>
1213
#include <string>
1314
#include <tuple>
@@ -19,6 +20,7 @@
1920
#include <jsoncons/json_options.hpp>
2021
#include <jsoncons/json_type_traits.hpp>
2122
#include <jsoncons/json_visitor.hpp>
23+
#include <jsoncons/utility/extension_traits.hpp>
2224

2325
namespace jsoncons {
2426

include/jsoncons/item_event_visitor.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
#include <jsoncons/json_encoder.hpp>
1313
#include <jsoncons/json_visitor.hpp>
14+
#include <jsoncons/utility/extension_traits.hpp>
1415

1516
namespace jsoncons {
1617

include/jsoncons/json_array.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,15 @@
1010
#include <algorithm> // std::sort, std::stable_sort, std::lower_bound, std::unique
1111
#include <cassert> // assert
1212
#include <cstring>
13-
#include <exception>
1413
#include <initializer_list>
1514
#include <iterator> // std::iterator_traits
1615
#include <memory> // std::allocator
17-
#include <string>
1816
#include <type_traits> // std::enable_if
1917
#include <utility>
2018
#include <utility> // std::move
2119
#include <vector>
2220

2321
#include <jsoncons/allocator_holder.hpp>
24-
#include <jsoncons/json_exception.hpp>
2522
#include <jsoncons/json_type.hpp>
2623

2724
namespace jsoncons {

include/jsoncons/json_cursor.hpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,11 @@
77
#ifndef JSONCONS_JSON_CURSOR_HPP
88
#define JSONCONS_JSON_CURSOR_HPP
99

10+
#include <cstddef>
1011
#include <ios>
1112
#include <istream> // std::basic_istream
1213
#include <memory> // std::allocator
13-
#include <stdexcept>
14-
#include <string>
1514
#include <system_error>
16-
#include <vector>
1715

1816
#include <jsoncons/byte_string.hpp>
1917
#include <jsoncons/config/jsoncons_config.hpp>

include/jsoncons/json_decoder.hpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,11 @@
77
#ifndef JSONCONS_JSON_DECODER_HPP
88
#define JSONCONS_JSON_DECODER_HPP
99

10-
#include <iterator> // std::make_move_iterator
10+
#include <cstddef>
1111
#include <memory> // std::allocator
12-
#include <string>
13-
#include <type_traits> // std::true_type
1412
#include <utility> // std::move
1513
#include <vector>
1614

17-
#include <jsoncons/json_exception.hpp>
1815
#include <jsoncons/json_object.hpp>
1916
#include <jsoncons/json_visitor.hpp>
2017

include/jsoncons/json_error.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#ifndef JSONCONS_JSON_ERROR_HPP
88
#define JSONCONS_JSON_ERROR_HPP
99

10+
#include <string>
1011
#include <system_error>
1112

1213
#include <jsoncons/config/jsoncons_config.hpp>

include/jsoncons/json_exception.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
#ifndef JSON_EXCEPTION_HPP
88
#define JSON_EXCEPTION_HPP
99

10-
#include <sstream> // std::ostringstream
10+
#include <cstddef>
11+
#include <exception>
1112
#include <string> // std::string
1213
#include <system_error> // std::error_code
1314

include/jsoncons/json_object.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#include <algorithm> // std::sort, std::stable_sort, std::lower_bound, std::unique
1111
#include <cassert> // assert
1212
#include <cstring>
13-
#include <exception>
1413
#include <initializer_list>
1514
#include <iterator> // std::iterator_traits
1615
#include <memory> // std::allocator

include/jsoncons/json_options.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,10 @@
99

1010
#include <cwchar>
1111
#include <functional>
12-
#include <limits> // std::numeric_limits
1312
#include <string>
1413

1514
#include <jsoncons/utility/extension_traits.hpp>
1615
#include <jsoncons/json_error.hpp>
17-
#include <jsoncons/json_exception.hpp>
1816
#include <jsoncons/ser_context.hpp>
1917

2018
namespace jsoncons {

include/jsoncons/json_parser.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#include <functional> // std::function
1212
#include <limits> // std::numeric_limits
1313
#include <memory> // std::allocator
14-
#include <stdexcept>
1514
#include <string>
1615
#include <system_error>
1716
#include <unordered_map>

include/jsoncons/json_reader.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,12 @@
77
#ifndef JSONCONS_JSON_READER_HPP
88
#define JSONCONS_JSON_READER_HPP
99

10+
#include <cstddef>
1011
#include <ios>
1112
#include <memory> // std::allocator
12-
#include <stdexcept>
1313
#include <string>
1414
#include <system_error>
1515
#include <utility> // std::move
16-
#include <vector>
1716

1817
#include <jsoncons/json_exception.hpp>
1918
#include <jsoncons/json_parser.hpp>

include/jsoncons/json_traits_macros.hpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@
77
#ifndef JSONCONS_JSON_TRAITS_MACROS_HPP
88
#define JSONCONS_JSON_TRAITS_MACROS_HPP
99

10-
#include <algorithm> // std::swap
11-
#include <iterator> // std::iterator_traits, std::input_iterator_tag
12-
#include <limits> // std::numeric_limits
13-
#include <string>
14-
#include <type_traits> // std::enable_if
1510
#include <utility>
1611

1712
#include <jsoncons/config/jsoncons_config.hpp> // JSONCONS_EXPAND, JSONCONS_QUOTE

include/jsoncons/json_type_traits.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,8 @@
1212
#include <bitset> // std::bitset
1313
#include <chrono>
1414
#include <cstring>
15-
#include <exception>
1615
#include <functional>
1716
#include <iterator> // std::iterator_traits, std::input_iterator_tag
18-
#include <limits> // std::numeric_limits
1917
#include <map>
2018
#include <memory>
2119
#include <string>

include/jsoncons/json_visitor.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <jsoncons/ser_context.hpp>
2020
#include <jsoncons/tag_type.hpp>
2121
#include <jsoncons/utility/bigint.hpp>
22+
#include <jsoncons/utility/extension_traits.hpp>
2223

2324
namespace jsoncons {
2425

include/jsoncons/pretty_print.hpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,11 @@
88
#define JSONCONS_PRETTY_PRINT_HPP
99

1010
#include <cstring>
11-
#include <exception>
12-
#include <memory>
1311
#include <ostream>
14-
#include <string>
1512
#include <typeinfo>
1613

1714
#include <jsoncons/json_encoder.hpp>
1815
#include <jsoncons/json_error.hpp>
19-
#include <jsoncons/json_exception.hpp>
2016
#include <jsoncons/json_options.hpp>
2117
#include <jsoncons/json_type_traits.hpp>
2218

include/jsoncons/sink.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,8 @@
99

1010
#include <cmath>
1111
#include <cstring> // std::memcpy
12-
#include <exception>
1312
#include <memory> // std::addressof
1413
#include <ostream>
15-
#include <stdexcept>
16-
#include <string>
1714
#include <vector>
1815

1916
#include <jsoncons/config/jsoncons_config.hpp>

include/jsoncons/source.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#include <istream>
1414
#include <iterator>
1515
#include <memory> // std::addressof
16-
#include <stdexcept>
1716
#include <string>
1817
#include <type_traits> // std::enable_if
1918
#include <vector>

0 commit comments

Comments
 (0)