Skip to content

Commit

Permalink
tidy header files
Browse files Browse the repository at this point in the history
  • Loading branch information
danielaparker committed Dec 26, 2024
1 parent 5ef8ddc commit baaabe3
Show file tree
Hide file tree
Showing 162 changed files with 1,117 additions and 1,802 deletions.
2 changes: 1 addition & 1 deletion include/jsoncons/allocator_holder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ class allocator_holder

}

#endif
#endif // JSONCONS_ALLOCATOR_HOLDER_HPP
7 changes: 4 additions & 3 deletions include/jsoncons/allocator_set.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@

// See https://github.com/danielaparker/jsoncons for latest version

#ifndef JSONCONS_ALLOCATOR_STRATEGY_HPP
#define JSONCONS_ALLOCATOR_STRATEGY_HPP
#ifndef JSONCONS_ALLOCATOR_SET_HPP
#define JSONCONS_ALLOCATOR_SET_HPP

#include <memory>

#include <jsoncons/tag_type.hpp>

namespace jsoncons {
Expand Down Expand Up @@ -63,4 +64,4 @@ allocator_set<std::allocator<char>,TempAllocator> temp_allocator_only(const Temp

} // namespace jsoncons

#endif
#endif // JSONCONS_ALLOCATOR_SET_HPP
45 changes: 23 additions & 22 deletions include/jsoncons/basic_json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,38 +7,39 @@
#ifndef JSONCONS_BASIC_JSON_HPP
#define JSONCONS_BASIC_JSON_HPP

#include <limits> // std::numeric_limits
#include <string>
#include <vector>
#include <exception>
#include <algorithm> // std::swap
#include <cstring>
#include <ostream>
#include <memory> // std::allocator
#include <typeinfo>
#include <cstring> // std::memcpy
#include <algorithm> // std::swap
#include <exception>
#include <initializer_list> // std::initializer_list
#include <utility> // std::move
#include <type_traits> // std::enable_if
#include <istream> // std::basic_istream
#include <jsoncons/json_fwd.hpp>
#include <jsoncons/json_type.hpp>
#include <limits> // std::numeric_limits
#include <memory> // std::allocator
#include <ostream>
#include <string>
#include <type_traits> // std::enable_if
#include <typeinfo>
#include <utility> // std::move
#include <vector>

#include <jsoncons/allocator_set.hpp>
#include <jsoncons/byte_string.hpp>
#include <jsoncons/config/version.hpp>
#include <jsoncons/json_type.hpp>
#include <jsoncons/json_array.hpp>
#include <jsoncons/json_decoder.hpp>
#include <jsoncons/json_encoder.hpp>
#include <jsoncons/json_error.hpp>
#include <jsoncons/json_exception.hpp>
#include <jsoncons/pretty_print.hpp>
#include <jsoncons/json_fwd.hpp>
#include <jsoncons/json_object.hpp>
#include <jsoncons/json_array.hpp>
#include <jsoncons/utility/bigint.hpp>
#include <jsoncons/json_options.hpp>
#include <jsoncons/json_encoder.hpp>
#include <jsoncons/json_decoder.hpp>
#include <jsoncons/json_reader.hpp>
#include <jsoncons/json_type.hpp>
#include <jsoncons/json_type_traits.hpp>
#include <jsoncons/byte_string.hpp>
#include <jsoncons/json_error.hpp>
#include <jsoncons/allocator_set.hpp>
#include <jsoncons/pretty_print.hpp>
#include <jsoncons/utility/bigint.hpp>
#include <jsoncons/utility/heap_string.hpp>

#if defined(JSONCONS_HAS_POLYMORPHIC_ALLOCATOR)
#include <memory_resource> // std::poymorphic_allocator
#endif
Expand Down Expand Up @@ -4744,4 +4745,4 @@ namespace jsoncons {

} // namespace jsoncons

#endif
#endif // JSONCONS_BASIC_JSON_HPP
17 changes: 9 additions & 8 deletions include/jsoncons/byte_string.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,22 @@
#ifndef JSONCONS_BYTE_STRING_HPP
#define JSONCONS_BYTE_STRING_HPP

#include <sstream>
#include <vector>
#include <ostream>
#include <cmath>
#include <cstring> // std::memcmp
#include <memory> // std::allocator
#include <iterator>
#include <exception>
#include <iomanip> // std::setw
#include <initializer_list>
#include <iomanip> // std::setw
#include <iterator>
#include <memory> // std::allocator
#include <ostream>
#include <sstream>
#include <utility> // std::move
#include <vector>

#include <jsoncons/config/jsoncons_config.hpp>
#include <jsoncons/json_exception.hpp>
#include <jsoncons/conv_error.hpp>
#include <jsoncons/extension_traits.hpp>
#include <jsoncons/json_exception.hpp>

namespace jsoncons {

Expand Down Expand Up @@ -802,4 +803,4 @@ namespace detail {

} // namespace jsoncons

#endif
#endif // JSONCONS_BYTE_STRING_HPP
4 changes: 2 additions & 2 deletions include/jsoncons/chunk_reader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
#ifndef JSONCONS_CHUNK_READER_HPP
#define JSONCONS_CHUNK_READER_HPP

#include <system_error>
#include <functional>
#include <system_error>

namespace jsoncons {

Expand Down Expand Up @@ -64,4 +64,4 @@ using wparser_input = basic_parser_input<wchar_t>;

} // namespace jsoncons

#endif
#endif // JSONCONS_CHUNK_READER_HPP
2 changes: 1 addition & 1 deletion include/jsoncons/config/binary_config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,4 +223,4 @@ namespace binary {
} // binary
} // jsoncons

#endif
#endif // JSONCONS_CONFIG_BINARY_CONFIG_HPP
10 changes: 5 additions & 5 deletions include/jsoncons/config/compiler_support.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

// See https://github.com/danielaparker/jsoncons for latest version

#ifndef JSONCONS_COMPILER_SUPPORT_HPP
#define JSONCONS_COMPILER_SUPPORT_HPP
#ifndef JSONCONS_CONFIG_COMPILER_SUPPORT_HPP
#define JSONCONS_CONFIG_COMPILER_SUPPORT_HPP

#include <stdexcept>
#include <string>
#include <cmath>
#include <exception>
#include <ostream>
#include <stdexcept>
#include <string>

#if defined(__GNUC__)
# if defined(__GNUC_PATCHLEVEL__)
Expand Down Expand Up @@ -417,4 +417,4 @@ namespace jsoncons {
#endif


#endif // JSONCONS_COMPILER_SUPPORT_HPP
#endif // JSONCONS_CONFIG_COMPILER_SUPPORT_HPP
5 changes: 3 additions & 2 deletions include/jsoncons/config/jsoncons_config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
#ifndef JSONCONS_CONFIG_JSONCONS_CONFIG_HPP
#define JSONCONS_CONFIG_JSONCONS_CONFIG_HPP

#include <type_traits>
#include <limits>
#include <jsoncons/config/compiler_support.hpp>
#include <type_traits>

#include <jsoncons/config/binary_config.hpp>
#include <jsoncons/config/compiler_support.hpp>

#if !defined(JSONCONS_HAS_STD_STRING_VIEW)
#include <jsoncons/detail/string_view.hpp>
Expand Down
6 changes: 3 additions & 3 deletions include/jsoncons/config/version.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

// See https://github.com/danielaparker/jsoncons for latest version

#ifndef JSONCONS_VERSION_HPP
#define JSONCONS_VERSION_HPP
#ifndef JSONCONS_CONFIG_VERSION_HPP
#define JSONCONS_CONFIG_VERSION_HPP

#include <iostream>

Expand Down Expand Up @@ -37,4 +37,4 @@ constexpr versioning_info version()

}

#endif
#endif // JSONCONS_CONFIG_VERSION_HPP
3 changes: 2 additions & 1 deletion include/jsoncons/conv_error.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#define JSONCONS_CONV_ERROR_HPP

#include <system_error>

#include <jsoncons/config/jsoncons_config.hpp>

namespace jsoncons {
Expand Down Expand Up @@ -211,4 +212,4 @@ std::error_code make_error_code(conv_errc result)

}

#endif
#endif // JSONCONS_CONV_ERROR_HPP
9 changes: 5 additions & 4 deletions include/jsoncons/decode_json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@
#define JSONCONS_DECODE_JSON_HPP

#include <iostream>
#include <istream> // std::basic_istream
#include <memory>
#include <string>
#include <tuple>
#include <memory>
#include <istream> // std::basic_istream

#include <jsoncons/allocator_set.hpp>
#include <jsoncons/decode_traits.hpp>
#include <jsoncons/json_cursor.hpp>
#include <jsoncons/allocator_set.hpp>

namespace jsoncons {

Expand Down Expand Up @@ -207,5 +208,5 @@ namespace jsoncons {

} // jsoncons

#endif
#endif // JSONCONS_DECODE_JSON_HPP

13 changes: 7 additions & 6 deletions include/jsoncons/decode_traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,18 @@
#ifndef JSONCONS_DECODE_TRAITS_HPP
#define JSONCONS_DECODE_TRAITS_HPP

#include <string>
#include <tuple>
#include <array>
#include <memory>
#include <string>
#include <tuple>
#include <type_traits> // std::enable_if, std::true_type, std::false_type
#include <jsoncons/json_visitor.hpp>

#include <jsoncons/conv_error.hpp>
#include <jsoncons/extension_traits.hpp>
#include <jsoncons/json_decoder.hpp>
#include <jsoncons/json_type_traits.hpp>
#include <jsoncons/json_visitor.hpp>
#include <jsoncons/staj_cursor.hpp>
#include <jsoncons/conv_error.hpp>
#include <jsoncons/extension_traits.hpp>

namespace jsoncons {

Expand Down Expand Up @@ -647,5 +648,5 @@ namespace jsoncons {

} // jsoncons

#endif
#endif // JSONCONS_DECODE_TRAITS_HPP

2 changes: 1 addition & 1 deletion include/jsoncons/detail/endian.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ namespace detail {
} // namespace detail
} // namespace jsoncons

#endif
#endif // JSONCONS_DETAIL_ENDIAN_HPP
17 changes: 9 additions & 8 deletions include/jsoncons/detail/grisu3.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,17 @@ minor modifications.
OTHER DEALINGS IN THE SOFTWARE.
*/

#ifndef JSONCONS_GRISU3_HPP
#define JSONCONS_GRISU3_HPP
#ifndef JSONCONS_DETAIL_GRISU3_HPP
#define JSONCONS_DETAIL_GRISU3_HPP

#pragma once
#include <stdlib.h>
#include <cinttypes>
#include <cstdint>
#include <cassert>
#include <cinttypes>
#include <cmath>
#include <cstdint>
#include <cstring> // std::memmove
#include <stdlib.h>

#include <jsoncons/detail/write_number.hpp>

namespace jsoncons { namespace detail {
Expand Down Expand Up @@ -82,7 +83,7 @@ inline
int k_comp(int e, int alpha, int /*gamma*/)
{
constexpr double d_1_log2_10 = 0.30102999566398114; // 1 / lg(10)
int x = alpha - e + 63;
int x = alpha - e + 63;
return static_cast<int>(std::ceil(x * d_1_log2_10));
}

Expand Down Expand Up @@ -201,7 +202,7 @@ void normalized_boundaries(double d, diy_fp_t *out_m_minus, diy_fp_t *out_m_plus
mi.f = (v.f << 1) - 1;
mi.e = v.e - 1;
}
int x = mi.e - pl.e;
int x = mi.e - pl.e;
mi.f <<= x;
mi.e = pl.e;
*out_m_plus = pl;
Expand Down Expand Up @@ -309,4 +310,4 @@ bool grisu3(double v, char *buffer, int *length, int *K)

}} // namespace detail namespace jsoncons

#endif
#endif // JSONCONS_DETAIL_GRISU3_HPP
7 changes: 4 additions & 3 deletions include/jsoncons/detail/optional.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
#ifndef JSONCONS_DETAIL_OPTIONAL_HPP
#define JSONCONS_DETAIL_OPTIONAL_HPP

#include <new> // placement new
#include <memory>
#include <utility> // std::swap
#include <new> // placement new
#include <type_traits>
#include <utility> // std::swap

#include <jsoncons/config/compiler_support.hpp>

namespace jsoncons
Expand Down Expand Up @@ -484,4 +485,4 @@ namespace detail
} // namespace detail
} // namespace jsoncons

#endif
#endif // JSONCONS_DETAIL_OPTIONAL_HPP
16 changes: 8 additions & 8 deletions include/jsoncons/detail/parse_number.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@
#ifndef JSONCONS_DETAIL_PARSE_NUMBER_HPP
#define JSONCONS_DETAIL_PARSE_NUMBER_HPP

#include <system_error>
#include <stdexcept>
#include <string>
#include <vector>
#include <cctype>
#include <exception>
#include <limits> // std::numeric_limits
#include <locale>
#include <stdexcept>
#include <string>
#include <limits> // std::numeric_limits
#include <system_error>
#include <type_traits> // std::enable_if
#include <exception>
#include <vector>

#include <jsoncons/config/jsoncons_config.hpp>
#include <jsoncons/json_exception.hpp>
#include <cctype>

namespace jsoncons { namespace detail {

Expand Down Expand Up @@ -1044,4 +1044,4 @@ class chars_to

}}

#endif
#endif // JSONCONS_DETAIL_PARSE_NUMBER_HPP
Loading

0 comments on commit baaabe3

Please sign in to comment.