Skip to content

Commit

Permalink
Remove deprecated functions
Browse files Browse the repository at this point in the history
  • Loading branch information
danielaparker committed Jul 1, 2024
1 parent 37d4fcf commit 5a4f9d2
Show file tree
Hide file tree
Showing 46 changed files with 19 additions and 2,284 deletions.
953 changes: 18 additions & 935 deletions include/jsoncons/basic_json.hpp

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions include/jsoncons/bigint.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1627,10 +1627,6 @@ class basic_bigint : protected detail::basic_bigint_base<Allocator>

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

#if !defined(JSONCONS_NO_DEPRECATED)
JSONCONS_DEPRECATED_MSG("Instead, use bigint") typedef bigint bignum;
#endif

}

#endif
15 changes: 0 additions & 15 deletions include/jsoncons/byte_string.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -392,13 +392,6 @@ namespace detail {
{
return data_;
}
#if !defined(JSONCONS_NO_DEPRECATED)
JSONCONS_DEPRECATED_MSG("Instead, use size()")
std::size_t length() const
{
return size_;
}
#endif
constexpr size_t size() const noexcept
{
return size_;
Expand Down Expand Up @@ -628,14 +621,6 @@ namespace detail {
return data_.size();
}

#if !defined(JSONCONS_NO_DEPRECATED)
JSONCONS_DEPRECATED_MSG("Instead, use size()")
std::size_t length() const
{
return data_.size();
}
#endif

int compare(const byte_string_view& s) const noexcept
{
const int rc = traits_type::compare(data(), s.data(), (std::min)(size(), s.size()));
Expand Down
4 changes: 0 additions & 4 deletions include/jsoncons/conv_error.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,6 @@ namespace jsoncons {
conv_errc ec;
};

#if !defined(JSONCONS_NO_DEPRECATED)
JSONCONS_DEPRECATED_MSG("Instead, use conv_error") typedef conv_error convert_error;
#endif

} // namespace jsoncons

namespace std {
Expand Down
1 change: 0 additions & 1 deletion include/jsoncons/json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include <jsoncons/encode_json.hpp>
#include <jsoncons/decode_json.hpp>
#include <jsoncons/json_traits_macros.hpp>
#include <jsoncons/json_traits_macros_deprecated.hpp>
#include <jsoncons/staj_iterator.hpp>

#endif
Expand Down
10 changes: 0 additions & 10 deletions include/jsoncons/json_array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,16 +155,6 @@ namespace jsoncons {

void resize(std::size_t n, const Json& val) {elements_.resize(n,val);}

#if !defined(JSONCONS_NO_DEPRECATED)
JSONCONS_DEPRECATED_MSG("Instead, use erase(const_iterator, const_iterator)")
void remove_range(std::size_t from_index, std::size_t to_index)
{
JSONCONS_ASSERT(from_index <= to_index);
JSONCONS_ASSERT(to_index <= elements_.size());
elements_.erase(elements_.cbegin()+from_index,elements_.cbegin()+to_index);
}
#endif

iterator erase(const_iterator pos)
{
return elements_.erase(pos);
Expand Down
21 changes: 0 additions & 21 deletions include/jsoncons/json_cursor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -435,27 +435,6 @@ 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>>;

#if !defined(JSONCONS_NO_DEPRECATED)

JSONCONS_DEPRECATED_MSG("Instead, use json_stream_cursor") typedef json_stream_cursor json_cursor;
JSONCONS_DEPRECATED_MSG("Instead, use wjson_stream_cursor") typedef wjson_stream_cursor wjson_cursor;

template<class CharT,class Source,class Allocator=std::allocator<CharT>>
using basic_json_pull_reader = basic_json_cursor<CharT,Source,Allocator>;

JSONCONS_DEPRECATED_MSG("Instead, use json_stream_cursor") typedef json_stream_cursor json_pull_reader;
JSONCONS_DEPRECATED_MSG("Instead, use wjson_stream_cursor") typedef wjson_stream_cursor wjson_pull_reader;

template<class CharT,class Source,class Allocator=std::allocator<CharT>>
using basic_json_stream_reader = basic_json_cursor<CharT,Source,Allocator>;

template<class CharT,class Source,class Allocator=std::allocator<CharT>>
using basic_json_staj_cursor = basic_json_cursor<CharT,Source,Allocator>;

JSONCONS_DEPRECATED_MSG("Instead, use json_stream_cursor") typedef json_stream_cursor json_staj_cursor;
JSONCONS_DEPRECATED_MSG("Instead, use wjson_stream_cursor") typedef wjson_stream_cursor wjson_staj_cursor;
#endif

}

#endif
Expand Down
16 changes: 0 additions & 16 deletions include/jsoncons/json_decoder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,6 @@ class json_decoder final : public basic_json_visitor<typename Json::char_type>
structure_stack_.emplace_back(structure_type::root_t, 0);
}

#if !defined(JSONCONS_NO_DEPRECATED)
JSONCONS_DEPRECATED_MSG("Instead, use json_decoder(allocator, temp_allocator)")
json_decoder(result_allocator_arg_t, const allocator_type& alloc,
const temp_allocator_type& temp_alloc = temp_allocator_type())
: json_decoder(alloc, temp_alloc)
{
}
#endif
void reset()
{
is_valid_ = false;
Expand All @@ -124,14 +116,6 @@ class json_decoder final : public basic_json_visitor<typename Json::char_type>
return std::move(result_);
}

#if !defined(JSONCONS_NO_DEPRECATED)
JSONCONS_DEPRECATED_MSG("Instead, use get_result()")
Json& root()
{
return result_;
}
#endif

private:

void visit_flush() override
Expand Down
33 changes: 0 additions & 33 deletions include/jsoncons/json_encoder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1599,39 +1599,6 @@ namespace detail {
using compact_json_string_encoder = basic_compact_json_encoder<char,jsoncons::string_sink<std::string>>;
using compact_wjson_string_encoder = basic_compact_json_encoder<wchar_t,jsoncons::string_sink<std::wstring>>;

#if !defined(JSONCONS_NO_DEPRECATED)
template<class CharT,class Sink=jsoncons::stream_sink<CharT>>
using basic_json_serializer = basic_json_encoder<CharT,Sink>;

template<class CharT,class Sink=jsoncons::stream_sink<CharT>>
using basic_json_compressed_serializer = basic_compact_json_encoder<CharT,Sink>;

template<class CharT,class Sink=jsoncons::stream_sink<CharT>>
using basic_json_compressed_encoder = basic_compact_json_encoder<CharT,Sink>;

JSONCONS_DEPRECATED_MSG("Instead, use compact_json_stream_encoder") typedef basic_compact_json_encoder<char,jsoncons::stream_sink<char>> json_compressed_stream_encoder;
JSONCONS_DEPRECATED_MSG("Instead, use compact_wjson_stream_encoder")typedef basic_compact_json_encoder<wchar_t,jsoncons::stream_sink<wchar_t>> wjson_compressed_stream_encoder;
JSONCONS_DEPRECATED_MSG("Instead, use compact_json_string_encoder") typedef basic_compact_json_encoder<char,jsoncons::string_sink<char>> json_compressed_string_encoder;
JSONCONS_DEPRECATED_MSG("Instead, use compact_wjson_string_encoder")typedef basic_compact_json_encoder<wchar_t,jsoncons::string_sink<wchar_t>> wjson_compressed_string_encoder;

JSONCONS_DEPRECATED_MSG("Instead, use json_stream_encoder") typedef json_stream_encoder json_encoder;
JSONCONS_DEPRECATED_MSG("Instead, use wjson_stream_encoder") typedef wjson_stream_encoder wjson_encoder;
JSONCONS_DEPRECATED_MSG("Instead, use compact_json_stream_encoder") typedef compact_json_stream_encoder compact_json_encoder;
JSONCONS_DEPRECATED_MSG("Instead, use compact_wjson_stream_encoder") typedef compact_wjson_stream_encoder wcompact_json_encoder;

JSONCONS_DEPRECATED_MSG("Instead, use json_stream_encoder") typedef basic_json_encoder<char,jsoncons::stream_sink<char>> json_serializer;
JSONCONS_DEPRECATED_MSG("Instead, use wjson_stream_encoder") typedef basic_json_encoder<wchar_t,jsoncons::stream_sink<wchar_t>> wjson_serializer;

JSONCONS_DEPRECATED_MSG("Instead, use compact_json_stream_encoder") typedef basic_compact_json_encoder<char,jsoncons::stream_sink<char>> json_compressed_serializer;
JSONCONS_DEPRECATED_MSG("Instead, use compact_wjson_stream_encoder") typedef basic_compact_json_encoder<wchar_t,jsoncons::stream_sink<wchar_t>> wjson_compressed_serializer;

JSONCONS_DEPRECATED_MSG("Instead, use json_string_encoder") typedef basic_json_encoder<char,jsoncons::string_sink<std::string>> json_string_serializer;
JSONCONS_DEPRECATED_MSG("Instead, use wjson_string_encoder") typedef basic_json_encoder<wchar_t,jsoncons::string_sink<std::wstring>> wjson_string_serializer;

JSONCONS_DEPRECATED_MSG("Instead, use compact_json_string_encoder") typedef basic_compact_json_encoder<char,jsoncons::string_sink<std::string>> json_compressed_string_serializer;
JSONCONS_DEPRECATED_MSG("Instead, use wcompact_json_string_encoder") typedef basic_compact_json_encoder<wchar_t,jsoncons::string_sink<std::wstring>> wjson_compressed_string_serializer;
#endif

} // namespace jsoncons

#endif
6 changes: 0 additions & 6 deletions include/jsoncons/json_error.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,6 @@ namespace jsoncons {
return std::error_code(static_cast<int>(result),json_error_category());
}

#if !defined(JSONCONS_NO_DEPRECATED)
JSONCONS_DEPRECATED_MSG("Instead, use json_errc") typedef json_errc json_parser_errc;

JSONCONS_DEPRECATED_MSG("Instead, use json_errc") typedef json_errc json_parse_errc;
#endif

} // jsoncons

namespace std {
Expand Down
21 changes: 0 additions & 21 deletions include/jsoncons/json_exception.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,29 +213,8 @@ namespace jsoncons {
return column_number_;
}

#if !defined(JSONCONS_NO_DEPRECATED)
JSONCONS_DEPRECATED_MSG("Instead, use line()")
std::size_t line_number() const noexcept
{
return line();
}

JSONCONS_DEPRECATED_MSG("Instead, use column()")
std::size_t column_number() const noexcept
{
return column();
}
#endif
};

#if !defined(JSONCONS_NO_DEPRECATED)
JSONCONS_DEPRECATED_MSG("Instead, use ser_error") typedef ser_error serialization_error;
JSONCONS_DEPRECATED_MSG("Instead, use ser_error") typedef ser_error json_parse_exception;
JSONCONS_DEPRECATED_MSG("Instead, use ser_error") typedef ser_error parse_exception;
JSONCONS_DEPRECATED_MSG("Instead, use ser_error") typedef ser_error parse_error;
typedef ser_error codec_error;
#endif

} // namespace jsoncons

#endif
37 changes: 0 additions & 37 deletions include/jsoncons/json_filter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,32 +33,6 @@ class basic_json_filter : public basic_json_visitor<CharT>
return *destination_;
}

#if !defined(JSONCONS_NO_DEPRECATED)

JSONCONS_DEPRECATED_MSG("Instead, use destination()")
basic_json_visitor<char_type>& to_handler()
{
return destination_;
}
JSONCONS_DEPRECATED_MSG("Instead, use destination")
basic_json_visitor<char_type>& input_handler()
{
return destination_;
}

JSONCONS_DEPRECATED_MSG("Instead, use destination")
basic_json_visitor<char_type>& downstream_handler()
{
return destination_;
}

JSONCONS_DEPRECATED_MSG("Instead, use destination")
basic_json_visitor<char_type>& destination_handler()
{
return destination_;
}
#endif

private:
void visit_flush() override
{
Expand Down Expand Up @@ -630,17 +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>;

#if !defined(JSONCONS_NO_DEPRECATED)
template <class CharT>
using basic_json_content_filter = basic_json_filter<CharT>;
JSONCONS_DEPRECATED_MSG("Instead, use json_filter") typedef basic_json_filter<char> json_content_filter;
JSONCONS_DEPRECATED_MSG("Instead, use wjson_filter") typedef basic_json_filter<wchar_t> wjson_content_filter;
JSONCONS_DEPRECATED_MSG("Instead, use rename_object_key_filter") typedef basic_rename_object_key_filter<char> rename_name_filter;
JSONCONS_DEPRECATED_MSG("Instead, use wrename_object_key_filter") typedef basic_rename_object_key_filter<wchar_t> wrename_name_filter;
JSONCONS_DEPRECATED_MSG("Instead, use rename_object_key_filter") typedef basic_rename_object_key_filter<char> rename_object_member_filter;
JSONCONS_DEPRECATED_MSG("Instead, use wrename_object_key_filter") typedef basic_rename_object_key_filter<wchar_t> wrename_object_member_filter;
#endif

}

#endif
7 changes: 0 additions & 7 deletions include/jsoncons/json_object.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,6 @@ namespace jsoncons {
key_.shrink_to_fit();
value_.shrink_to_fit();
}
#if !defined(JSONCONS_NO_DEPRECATED)
JSONCONS_DEPRECATED_MSG("Instead, use key()")
const key_type& name() const
{
return key_;
}
#endif

friend bool operator==(const key_value& lhs, const key_value& rhs) noexcept
{
Expand Down
Loading

0 comments on commit 5a4f9d2

Please sign in to comment.