Example #1
0
 ubjson_ostream & operator << (json_type const & j)
 {
     pfs::error_code ec = write_json(j, true);
     if (ec)
         PFS_THROW(json_exception(ec));
     return *this;
 }
Example #2
0
pfs::byte_string to_ubjson (JsonType const & j, int flags)
{
    pfs::error_code ec;
    pfs::byte_string r = to_ubjson<JsonType>(j, flags, ec);

    if (ec)
        PFS_THROW(json_exception(ec));

    return r;
}
Example #3
0
File: json.cpp Project: alvalea/alm
void json_value::parseBool(std::stringstream &input)
{
  if(json::match(input, "true"))
  {
    m_bool = true;
  }
  else if(json::match(input, "false"))
  {
    m_bool = false;
  }
  else
  {
    throw json_exception();
  }
}