Skip to content

Latest commit

 

History

History
83 lines (79 loc) · 7.09 KB

deprecated.md

File metadata and controls

83 lines (79 loc) · 7.09 KB

Deprecated Features

As the jsoncons library has evolved, names have sometimes changed. To ease transition, jsoncons deprecates the old names but continues to support many of them. The deprecated names can be suppressed by defining macro JSONCONS_NO_DEPRECATED, which is recommended for new code.

In the table, indicates that the old name is still supported.

Category Old name, now deprecated Recommendation
json add(size_t index, const json& val) Use add(array_iterator pos, const json& val)
  add(size_t index, json&& val) Use add(array_iterator pos, json&& val)
  dump_body dump_fragment
  remove_range(size_t from_index, size_t to_index) erase(array_iterator first, array_iterator last)
  remove(const std::string& name) Use erase(const std::string& name)
  parse_stream(std::istream& is) Use parse(std::istream& is)
  parse_stream(std::istream& is, parse_error_handler& err_handler) Use parse(std::istream& is, parse_error_handler& err_handler)
  as_int() const Use as<int>
  as_uint() const Use as<unsigned int>
  as_long() const Use as<long>
  as_ulong() const Use as<unsigned long>
  as_longlong() const Use as_integer or as<long long>
  as_ulonglong() const Use as_uinteger or as<unsigned long long>
  is_longlong() const Use is_integer() or is()
  is_ulonglong() const Use is_uinteger() or is()
  is_numeric() const Use is_number()
  remove_member(const std::string& name) Use erase(const std::string& name)
  const json& get(const std::string& name) const Use const json get(const std::string& name, T default_val) const with default json::null_type()
  has_member(const std::string& name) const Use has_name(const std::string& name)
  members() Use object_range()
  elements() Use array_range()
  begin_members() Use object_range().begin()
  end_members() Use object_range().end()
  begin_elements() Use array_range().begin()
  end_elements() Use array_range().end()
  is_empty() const Use empty()
  parse_string(const std::string& s) parse(const std::string& s)
  parse_string(const std::string& s,parse_error_handler& err_handler) Use parse(const std::string& s,parse_error_handler& err_handler)
  resize_array(size_t n) resize(size_t n)
  resize_array(size_t n, const json& val) Use resize(size_t n, const json& val)
  to_stream Use dump
  write Use dump
  json initializer-list constructor Construct from json::array with initializer-list
  json_deserializer Use json_decoder`
  wjson_deserializer Use json_decoder<wjson>
  ojson_deserializer Use json_decoder<ojson>
  wojson_deserializer Use json_decoder<wojson>
  owjson Use wojson`
  member_type name() Use key()
  rename_name_filter Use rename_object_member_filter`
json member types any
  member_type Use key_value_pair_type
  kvp_type Use key_value_pair_type
json member constants null Use static member function json::null()
  an_object Use the default constructor json() instead.
  an_array Use assignment to json::array() or json::make_array() instead.
json_decoder json& root() json get_result()
serialization output_format Use serialization_options
json_reader max_depth() const Use max_nesting_depth() const
  max_depth(depth) Use max_nesting_depth() const
  json_input_handler& parent() Use json_input_handler& input_handler()
json_input_handler class do_longlong_value(long long value, const parsing_context& context) Override do_integer_value(int64_t value, const parsing_context& context)
  do_ulonglong_value(unsigned long long value, const parsing_context& context) Removed, override do_uinteger_value(uint64_t value, const parsing_context& context)
  do_double_value(double value, const basic_parsing_context& context) Removed, override do_double_value(double value, uint8_t precision, const basic_parsing_context& context)
  value(value,context) Use string_value(value,context), integer_value(value,context), uinteger_value(value,context), double_value(value,precision,context), bool_value(value,context), null_value(context)
json_output_handler class do_longlong_value(long long value) Removed, override do_integer_value(int64_t value)
  do_ulonglong_value(unsigned long long value) Removed, override do_uinteger_value(uint64_t value)
  do_double_value(double value) Removed, override do_double_value(double value, uint8_t precision)
  value(value) Use string_value(value), integer_value(value), uinteger_value(value), double_value(value,precision=0), bool_value(value), null_value(context)
basic_parsing_context last_char() Use current_char()
json_filter parent() Use downstream_handler()
  input_handler() Use downstream_handler()
csv_parameters header(std::string value) Use column_names(const std::string& value)
  column_names(std::vector<std::string>> value) Use column_names(const std::string& value)
  data_types(std::string value) Use column_types(const std::string& value)
  column_types(std::vector<std::string>> value) Use column_types(const std::string& value)
  column_defaults(std::vector<std::string>> value) Use column_defaults(const std::string& value)
output_format array_array_block_option accessor and modifier accessor and modifier Use array_array_split_lines accessor and modifier
  array_object_block_option accessor and modifier Use array_object_split_lines accessor and modifier
  object_array_block_option accessor and modifier Use object_array_split_lines accessor and modifier
  object_object_block_option accessor and modifier Use object_object_split_lines accessor and modifier
msgpack jsoncons_ext/msgpack/message_pack.hpp header file Use jsoncons_ext/msgpack/msgpack.hpp
  encode_message_pack Use encode_msgpack
  decode_message_pack Use decode_msgpack