Skip to content

Commit

Permalink
tidy code
Browse files Browse the repository at this point in the history
  • Loading branch information
danielaparker committed Dec 27, 2024
1 parent 70b077f commit 94bd5df
Show file tree
Hide file tree
Showing 76 changed files with 181 additions and 113 deletions.
File renamed without changes.
4 changes: 2 additions & 2 deletions doc/ref/corelib/json_type_traits/custom-specializations.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ struct json_type_traits<Json, own_vector>
template <>
struct is_json_type_traits_declared<own_vector> : public std::true_type
{};
} // jsoncons
} // namespace jsoncons

using jsoncons::json;

Expand Down Expand Up @@ -368,7 +368,7 @@ namespace jsoncons {
return a;
}
};
} // jsoncons
} // namespace jsoncons
using namespace jsoncons;
using boost::numeric::ublas::matrix;
Expand Down
2 changes: 1 addition & 1 deletion examples/src/type_extensibility_examples.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ struct json_type_traits<Json, own_vector>
template <>
struct is_json_type_traits_declared<own_vector> : public std::true_type
{};
} // jsoncons
} // namespace jsoncons

void own_vector_extensibility_example()
{
Expand Down
2 changes: 1 addition & 1 deletion include/jsoncons/allocator_holder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ class allocator_holder
}
};

}
} // namespace jsoncons

#endif // JSONCONS_ALLOCATOR_HOLDER_HPP
4 changes: 2 additions & 2 deletions include/jsoncons/config/binary_config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ namespace binary {
return val2;
}

} // binary
} // jsoncons
} // namespace binary
} // namespace jsoncons

#endif // JSONCONS_CONFIG_BINARY_CONFIG_HPP
6 changes: 3 additions & 3 deletions include/jsoncons/config/jsoncons_config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ namespace jsoncons {
template <typename T,typename... Args>
typename unique_if<T>::value_is_array_of_known_bound
make_unique(Args&&...) = delete;
} // jsoncons
} // namespace jsoncons

#else

Expand Down Expand Up @@ -241,7 +241,7 @@ namespace binary {
}

} // binary
} // jsoncons
} // namespace jsoncons

namespace jsoncons {

Expand Down Expand Up @@ -287,7 +287,7 @@ namespace jsoncons {
return jsoncons::wstring_view(w);
}

} // jsoncons
} // namespace jsoncons

#define JSONCONS_EXPAND(X) X
#define JSONCONS_QUOTE(Prefix, A) JSONCONS_EXPAND(Prefix ## #A)
Expand Down
2 changes: 1 addition & 1 deletion include/jsoncons/config/version.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ constexpr versioning_info version()
return versioning_info{JSONCONS_VERSION_MAJOR, JSONCONS_VERSION_MINOR, JSONCONS_VERSION_PATCH};
}

}
} // namespace jsoncons

#endif // JSONCONS_CONFIG_VERSION_HPP
8 changes: 5 additions & 3 deletions include/jsoncons/conv_error.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ namespace std {
struct is_error_code_enum<jsoncons::conv_errc> : public true_type
{
};
}

} // namespace std

namespace jsoncons {

Expand Down Expand Up @@ -196,7 +197,8 @@ namespace detail {
}
}
};
} // detail

} // namespace detail

extern inline
const std::error_category& conv_error_category()
Expand All @@ -211,6 +213,6 @@ std::error_code make_error_code(conv_errc result)
return std::error_code(static_cast<int>(result),conv_error_category());
}

}
} // namespace jsoncons

#endif // JSONCONS_CONV_ERROR_HPP
2 changes: 1 addition & 1 deletion include/jsoncons/decode_json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ namespace jsoncons {
}


} // jsoncons
} // namespace jsoncons

#endif // JSONCONS_DECODE_JSON_HPP

2 changes: 1 addition & 1 deletion include/jsoncons/decode_traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ namespace jsoncons {
}
};

} // jsoncons
} // namespace jsoncons

#endif // JSONCONS_DECODE_TRAITS_HPP

3 changes: 2 additions & 1 deletion include/jsoncons/detail/grisu3.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ bool grisu3(double v, char *buffer, int *length, int *K)
return result;
}

}} // namespace detail namespace jsoncons
} // namespace detail
} // namespace jsoncons

#endif // JSONCONS_DETAIL_GRISU3_HPP
5 changes: 3 additions & 2 deletions include/jsoncons/detail/parse_number.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ namespace std {
struct is_error_code_enum<jsoncons::detail::to_integer_errc> : public true_type
{
};
}
} // namespace std

namespace jsoncons { namespace detail {

Expand Down Expand Up @@ -1042,6 +1042,7 @@ class chars_to
};
#endif

}}
} // namespace detail
} // namespace jsoncons

#endif // JSONCONS_DETAIL_PARSE_NUMBER_HPP
7 changes: 3 additions & 4 deletions include/jsoncons/detail/span.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@
#include <jsoncons/config/compiler_support.hpp>
#include <jsoncons/utility/extension_traits.hpp>

namespace jsoncons
{
namespace detail
{
namespace jsoncons {
namespace detail {

constexpr std::size_t dynamic_extent = (std::numeric_limits<std::size_t>::max)();

template< typename T, std::size_t Extent = dynamic_extent>
Expand Down
2 changes: 1 addition & 1 deletion include/jsoncons/encode_json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ namespace jsoncons {

//end legacy

} // jsoncons
} // namespace jsoncons

#endif // JSONCONS_ENCODE_JSON_HPP

2 changes: 1 addition & 1 deletion include/jsoncons/encode_traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ namespace jsoncons {
}
};

} // jsoncons
} // namespace jsoncons

#endif // JSONCONS_ENCODE_TRAITS_HPP

2 changes: 1 addition & 1 deletion include/jsoncons/json_cursor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ using json_string_cursor = basic_json_cursor<char,jsoncons::string_source<char>>
using wjson_stream_cursor = basic_json_cursor<wchar_t,jsoncons::stream_source<wchar_t>>;
using wjson_string_cursor = basic_json_cursor<wchar_t,jsoncons::string_source<wchar_t>>;

}
} // namespace jsoncons

#endif // JSONCONS_JSON_CURSOR_HPP

5 changes: 3 additions & 2 deletions include/jsoncons/json_error.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,14 @@ namespace jsoncons {
return std::error_code(static_cast<int>(result),json_error_category());
}

} // jsoncons
} // namespace jsoncons

namespace std {
template<>
struct is_error_code_enum<jsoncons::json_errc> : public true_type
{
};
}

} // namespace std

#endif // JSONCONS_JSON_ERROR_HPP
2 changes: 1 addition & 1 deletion include/jsoncons/json_filter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,6 @@ using wjson_filter = basic_json_filter<wchar_t>;
using rename_object_key_filter = basic_rename_object_key_filter<char>;
using wrename_object_key_filter = basic_rename_object_key_filter<wchar_t>;

}
} // namespace jsoncons

#endif // JSONCONS_JSON_FILTER_HPP
2 changes: 1 addition & 1 deletion include/jsoncons/json_fwd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ template <typename CharT,
typename Allocator = std::allocator<CharT>>
class basic_json;

}
} // namespace jsoncons

#endif // JSONCONS_JSON_FWD_HPP
2 changes: 1 addition & 1 deletion include/jsoncons/json_object.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ namespace jsoncons {
return i.value();
}

} // jsoncons
} // namespace jsoncons

namespace std
{
Expand Down
3 changes: 2 additions & 1 deletion include/jsoncons/json_options.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -697,5 +697,6 @@ class basic_json_options final: public basic_json_decode_options<CharT>,
using json_options = basic_json_options<char>;
using wjson_options = basic_json_options<wchar_t>;

}
} // namespace jsoncons

#endif // JSONCONS_JSON_OPTIONS_HPP
3 changes: 2 additions & 1 deletion include/jsoncons/json_parser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2605,7 +2605,8 @@ class basic_json_parser : public ser_context, public virtual basic_parser_input<

using json_parser = basic_json_parser<char>;
using wjson_parser = basic_json_parser<wchar_t>;
}

} // namespace jsoncons

#endif // JSONCONS_JSON_PARSER_HPP

2 changes: 1 addition & 1 deletion include/jsoncons/json_reader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ namespace jsoncons {
using json_stream_reader = basic_json_reader<char,stream_source<char>>;
using wjson_stream_reader = basic_json_reader<wchar_t,stream_source<wchar_t>>;

}
} // namespace jsoncons

#endif // JSONCONS_JSON_READER_HPP

2 changes: 1 addition & 1 deletion include/jsoncons/json_type.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,6 @@ namespace jsoncons {
return os;
}

} // jsoncons
} // namespace jsoncons

#endif // JSONCONS_JSON_TYPE_HPP
4 changes: 2 additions & 2 deletions include/jsoncons/json_type_traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1076,7 +1076,7 @@ has_can_convert = extension_traits::is_detected<traits_can_convert_t, Json, T>;
{
}
};
} // namespace detail
} // namespace tuple_detail

template <typename Json,typename... E>
struct json_type_traits<Json, std::tuple<E...>>
Expand Down Expand Up @@ -1898,6 +1898,6 @@ namespace variant_detail
}
};

} // jsoncons
} // namespace jsoncons

#endif // JSONCONS_JSON_TYPE_TRAITS_HPP
2 changes: 1 addition & 1 deletion include/jsoncons/pretty_print.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,6 @@ json_printable<Json> pretty_print(const Json& j,
return json_printable<Json>(j, options, indenting::indent);
}

}
} // namespace jsoncons

#endif // JSONCONS_PRETTY_PRINT_HPP
3 changes: 2 additions & 1 deletion include/jsoncons/ser_context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@ class ser_context
}
};

}
} // namespace jsoncons

#endif // JSONCONS_SER_CONTEXT_HPP
2 changes: 1 addition & 1 deletion include/jsoncons/staj_cursor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ using wstaj_cursor = basic_staj_cursor<wchar_t>;
using staj_filter_view = basic_staj_filter_view<char>;
using wstaj_filter_view = basic_staj_filter_view<wchar_t>;

}
} // namespace jsoncons

#endif // JSONCONS_STAJ_CURSOR_HPP

2 changes: 1 addition & 1 deletion include/jsoncons/tag_type.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,6 @@ std::basic_ostream<CharT>& operator<<(std::basic_ostream<CharT>& os, semantic_ta
return os;
}

}
} // namespace jsoncons

#endif // JSONCONS_TAG_TYPE_HPP
3 changes: 1 addition & 2 deletions include/jsoncons/utility/bigint.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ Chichester: John Wiley.
*/


namespace detail {

template <typename Allocator>
Expand Down Expand Up @@ -1622,6 +1621,6 @@ class basic_bigint : protected detail::basic_bigint_base<Allocator>

using bigint = basic_bigint<std::allocator<uint8_t>>;

}
} // namespace jsoncons

#endif // JSONCONS_UTILITY_BIGINT_HPP
5 changes: 2 additions & 3 deletions include/jsoncons/utility/binary.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@

#include <jsoncons/config/jsoncons_config.hpp>

namespace jsoncons { namespace utility {
namespace jsoncons {

} // utility
} // jsoncons
} // namespace jsoncons

#endif // JSONCONS_UTILITY_BINARY_HPP
2 changes: 1 addition & 1 deletion include/jsoncons/utility/extension_traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -918,6 +918,6 @@ namespace impl {


} // extension_traits
} // jsoncons
} // namespace jsoncons

#endif // JSONCONS_UTILITY_EXTENSION_TRAITS_HPP
6 changes: 3 additions & 3 deletions include/jsoncons/utility/unicode_traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,14 +281,14 @@ namespace jsoncons { namespace unicode_traits {
}

} // unicode_traits
} // jsoncons
} // namespace jsoncons

namespace std {
template<>
struct is_error_code_enum<jsoncons::unicode_traits::conv_errc> : public true_type
{
};
}
} // namespace std

namespace jsoncons { namespace unicode_traits {

Expand Down Expand Up @@ -1325,7 +1325,7 @@ namespace jsoncons { namespace unicode_traits {
}

} // unicode_traits
} // jsoncons
} // namespace jsoncons

#endif //JSONCONS_UTILITY_UNICODE_TRAITS_HPP

4 changes: 3 additions & 1 deletion include/jsoncons_ext/bson/bson_encoder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -572,5 +572,7 @@ class basic_bson_encoder final : public basic_json_visitor<char>
using bson_stream_encoder = basic_bson_encoder<jsoncons::binary_stream_sink>;
using bson_bytes_encoder = basic_bson_encoder<jsoncons::bytes_sink<std::vector<uint8_t>>>;

}}
} // namespace bson
} // namespace jsoncons

#endif // JSONCONS_EXT_BSON_BSON_ENCODER_HPP
Loading

0 comments on commit 94bd5df

Please sign in to comment.