Skip to content

Latest commit

 

History

History
112 lines (74 loc) · 3.82 KB

ubjson_encoder.md

File metadata and controls

112 lines (74 loc) · 3.82 KB

jsoncons::ubjson::basic_ubjson_encoder

template<
    class Result>
> class basic_ubjson_encoder : public jsoncons::json_content_handler

basic_ubjson_encoder is noncopyable and nonmoveable.

Header

#include <jsoncons_ext/ubjson/ubjson_encoder.hpp>

ubjson_encoder

Four specializations for common character types and result types are defined:

Type Definition
ubjson_encoder basic_ubjson_encoderjsoncons::binary_stream_result
ubjson_bytes_encoder basic_ubjson_encoderjsoncons::binary_buffer_result

Member types

Type Definition
char_type char
result_type Result
string_view_type

Constructors

explicit basic_ubjson_encoder(result_type result)

Constructs a new encoder that writes to the specified result.

Destructor

virtual ~basic_ubjson_encoder()

Member functions

bool begin_object(semantic_tag tag=semantic_tag::none,
                  const ser_context& context=null_ser_context()); 

bool begin_object(size_t length, 
                  semantic_tag tag=semantic_tag::none,
                  const ser_context& context=null_ser_context()); 

bool end_object(const ser_context& context = null_ser_context())

bool begin_array(semantic_tag tag=semantic_tag::none,
                 const ser_context& context=null_ser_context()); 

bool begin_array(semantic_tag tag=semantic_tag::none,
                 const ser_context& context=null_ser_context()); 

bool end_array(const ser_context& context=null_ser_context()); 

bool name(const string_view_type& name, 
          const ser_context& context=null_ser_context()); 

bool string_value(const string_view_type& value, 
                  semantic_tag tag = semantic_tag::none, 
                  const ser_context& context=null_ser_context());

bool byte_string_value(const byte_string_view& b, 
                       semantic_tag tag=semantic_tag::none, 
                       const ser_context& context=null_ser_context()); 

bool byte_string_value(const uint8_t* p, size_t size, 
                       semantic_tag tag=semantic_tag::none, 
                       const ser_context& context=null_ser_context()); 

bool big_integer_value(const string_view_type& s, 
                       const ser_context& context=null_ser_context());  

bool big_decimal_value(const string_view_type& s, 
                       const ser_context& context=null_ser_context());  

bool date_time_value(const string_view_type& s, 
                     const ser_context& context=null_ser_context());  

bool timestamp_value(int64_t val, 
                     const ser_context& context=null_ser_context());  

bool int64_value(int64_t value, 
                 semantic_tag tag = semantic_tag::none, 
                 const ser_context& context=null_ser_context());

bool uint64_value(uint64_t value, 
                  semantic_tag tag = semantic_tag::none, 
                  const ser_context& context=null_ser_context()); 

bool double_value(double value, 
                  semantic_tag tag = semantic_tag::none, 
                  const ser_context& context=null_ser_context()); 

bool bool_value(bool value, 
                semantic_tag tag = semantic_tag::none,
                const ser_context& context=null_ser_context());  

bool null_value(semantic_tag tag = semantic_tag::none,
                const ser_context& context=null_ser_context());  

void flush()

Examples