Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Class template basic_writer

trial::protocol::json::basic_writer — Incremental JSON writer.

Synopsis

// In header: <boost/libs/trial.protocol/include/trial/protocol/json/writer.hpp>

template<typename CharT, std::size_t N = 2 * sizeof(void *)> 
class basic_writer {
public:
  // types
  typedef CharT       value_type;
  typedef std::size_t size_type; 
  typedef unspecified view_type; 

  // construct/copy/destruct
  template<typename T> basic_writer(T &);

  // public member functions
  std::error_code error() const noexcept;
  size_type level() const noexcept;
  template<typename T> size_type value();
  template<typename T> size_type value(T &&);
  size_type literal(const view_type &) noexcept;
};

Description

Generate JSON output incrementally by appending C++ data.

basic_writer public construct/copy/destruct

  1. template<typename T> basic_writer(T & buffer);
    Construct an incremental JSON writer.

    The buffer type can be any for which a buffer wrapper exists.

    Parameters:

    buffer

    A buffer where the JSON formatted output is stored.

basic_writer public member functions

  1. std::error_code error() const noexcept;
  2. size_type level() const noexcept;
  3. template<typename T> size_type value();
    Write structural output.
  4. template<typename T> size_type value(T && value);
    Write data output.
  5. size_type literal(const view_type &) noexcept;
    Write raw output.

PrevUpHomeNext