Classes | Functions
json_encode.c File Reference
#include "upb/json_encode.h"
#include <ctype.h>
#include <float.h>
#include <inttypes.h>
#include <math.h>
#include <setjmp.h>
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include "upb/decode.h"
#include "upb/reflection.h"
#include "upb/upb_internal.h"
#include "upb/port_def.inc"
Include dependency graph for json_encode.c:

Go to the source code of this file.

Classes

struct  jsonenc
 

Functions

static void jsonenc_any (jsonenc *e, const upb_Message *msg, const upb_MessageDef *m)
 
static upb_Arenajsonenc_arena (jsonenc *e)
 
static void jsonenc_array (jsonenc *e, const upb_Array *arr, const upb_FieldDef *f)
 
static void jsonenc_bytes (jsonenc *e, upb_StringView str)
 
static void jsonenc_duration (jsonenc *e, const upb_Message *msg, const upb_MessageDef *m)
 
static void jsonenc_enum (int32_t val, const upb_FieldDef *f, jsonenc *e)
 
static UPB_NORETURN void jsonenc_err (jsonenc *e, const char *msg)
 
static UPB_NORETURN void jsonenc_errf (jsonenc *e, const char *fmt,...)
 
static void jsonenc_fieldmask (jsonenc *e, const upb_Message *msg, const upb_MessageDef *m)
 
static void jsonenc_fieldpath (jsonenc *e, upb_StringView path)
 
static void jsonenc_fieldval (jsonenc *e, const upb_FieldDef *f, upb_MessageValue val, bool *first)
 
static const upb_MessageDefjsonenc_getanymsg (jsonenc *e, upb_StringView type_url)
 
static void jsonenc_listvalue (jsonenc *e, const upb_Message *msg, const upb_MessageDef *m)
 
static void jsonenc_map (jsonenc *e, const upb_Map *map, const upb_FieldDef *f)
 
static void jsonenc_mapkey (jsonenc *e, upb_MessageValue val, const upb_FieldDef *f)
 
static void jsonenc_msg (jsonenc *e, const upb_Message *msg, const upb_MessageDef *m)
 
static void jsonenc_msgfield (jsonenc *e, const upb_Message *msg, const upb_MessageDef *m)
 
static void jsonenc_msgfields (jsonenc *e, const upb_Message *msg, const upb_MessageDef *m, bool first)
 
static void jsonenc_nanos (jsonenc *e, int32_t nanos)
 
static size_t jsonenc_nullz (jsonenc *e, size_t size)
 
static void jsonenc_printf (jsonenc *e, const char *fmt,...)
 
static void jsonenc_putbytes (jsonenc *e, const void *data, size_t len)
 
static void jsonenc_putsep (jsonenc *e, const char *str, bool *first)
 
static void jsonenc_putstr (jsonenc *e, const char *str)
 
static void jsonenc_scalar (jsonenc *e, upb_MessageValue val, const upb_FieldDef *f)
 
static void jsonenc_string (jsonenc *e, upb_StringView str)
 
static void jsonenc_stringbody (jsonenc *e, upb_StringView str)
 
static void jsonenc_struct (jsonenc *e, const upb_Message *msg, const upb_MessageDef *m)
 
static void jsonenc_timestamp (jsonenc *e, const upb_Message *msg, const upb_MessageDef *m)
 
static void jsonenc_value (jsonenc *e, const upb_Message *msg, const upb_MessageDef *m)
 
static void jsonenc_wrapper (jsonenc *e, const upb_Message *msg, const upb_MessageDef *m)
 
size_t upb_JsonEncode (const upb_Message *msg, const upb_MessageDef *m, const upb_DefPool *ext_pool, int options, char *buf, size_t size, upb_Status *status)
 
static void upb_JsonEncode_Double (jsonenc *e, double val)
 
static void upb_JsonEncode_Float (jsonenc *e, float val)
 
static bool upb_JsonEncode_HandleSpecialDoubles (jsonenc *e, double val)
 

Function Documentation

◆ jsonenc_any()

static void jsonenc_any ( jsonenc e,
const upb_Message msg,
const upb_MessageDef m 
)
static

Definition at line 379 of file json_encode.c.

◆ jsonenc_arena()

static upb_Arena* jsonenc_arena ( jsonenc e)
static

Definition at line 82 of file json_encode.c.

◆ jsonenc_array()

static void jsonenc_array ( jsonenc e,
const upb_Array arr,
const upb_FieldDef f 
)
static

Definition at line 650 of file json_encode.c.

◆ jsonenc_bytes()

static void jsonenc_bytes ( jsonenc e,
upb_StringView  str 
)
static

Definition at line 222 of file json_encode.c.

◆ jsonenc_duration()

static void jsonenc_duration ( jsonenc e,
const upb_Message msg,
const upb_MessageDef m 
)
static

Definition at line 185 of file json_encode.c.

◆ jsonenc_enum()

static void jsonenc_enum ( int32_t  val,
const upb_FieldDef f,
jsonenc e 
)
static

Definition at line 206 of file json_encode.c.

◆ jsonenc_err()

static UPB_NORETURN void jsonenc_err ( jsonenc e,
const char *  msg 
)
static

Definition at line 68 of file json_encode.c.

◆ jsonenc_errf()

static UPB_NORETURN void jsonenc_errf ( jsonenc e,
const char *  fmt,
  ... 
)
static

Definition at line 74 of file json_encode.c.

◆ jsonenc_fieldmask()

static void jsonenc_fieldmask ( jsonenc e,
const upb_Message msg,
const upb_MessageDef m 
)
static

Definition at line 439 of file json_encode.c.

◆ jsonenc_fieldpath()

static void jsonenc_fieldpath ( jsonenc e,
upb_StringView  path 
)
static

Definition at line 418 of file json_encode.c.

◆ jsonenc_fieldval()

static void jsonenc_fieldval ( jsonenc e,
const upb_FieldDef f,
upb_MessageValue  val,
bool first 
)
static

Definition at line 686 of file json_encode.c.

◆ jsonenc_getanymsg()

static const upb_MessageDef* jsonenc_getanymsg ( jsonenc e,
upb_StringView  type_url 
)
static

Definition at line 342 of file json_encode.c.

◆ jsonenc_listvalue()

static void jsonenc_listvalue ( jsonenc e,
const upb_Message msg,
const upb_MessageDef m 
)
static

Definition at line 484 of file json_encode.c.

◆ jsonenc_map()

static void jsonenc_map ( jsonenc e,
const upb_Map map,
const upb_FieldDef f 
)
static

Definition at line 666 of file json_encode.c.

◆ jsonenc_mapkey()

static void jsonenc_mapkey ( jsonenc e,
upb_MessageValue  val,
const upb_FieldDef f 
)
static

Definition at line 620 of file json_encode.c.

◆ jsonenc_msg()

static void jsonenc_msg ( jsonenc e,
const upb_Message msg,
const upb_MessageDef m 
)
static

Definition at line 739 of file json_encode.c.

◆ jsonenc_msgfield()

static void jsonenc_msgfield ( jsonenc e,
const upb_Message msg,
const upb_MessageDef m 
)
static

Definition at line 540 of file json_encode.c.

◆ jsonenc_msgfields()

static void jsonenc_msgfields ( jsonenc e,
const upb_Message msg,
const upb_MessageDef m,
bool  first 
)
static

Definition at line 715 of file json_encode.c.

◆ jsonenc_nanos()

static void jsonenc_nanos ( jsonenc e,
int32_t  nanos 
)
static

Definition at line 126 of file json_encode.c.

◆ jsonenc_nullz()

static size_t jsonenc_nullz ( jsonenc e,
size_t  size 
)
static

Definition at line 746 of file json_encode.c.

◆ jsonenc_printf()

static void jsonenc_printf ( jsonenc e,
const char *  fmt,
  ... 
)
static

Definition at line 109 of file json_encode.c.

◆ jsonenc_putbytes()

static void jsonenc_putbytes ( jsonenc e,
const void *  data,
size_t  len 
)
static

Definition at line 90 of file json_encode.c.

◆ jsonenc_putsep()

static void jsonenc_putsep ( jsonenc e,
const char *  str,
bool first 
)
static

Definition at line 410 of file json_encode.c.

◆ jsonenc_putstr()

static void jsonenc_putstr ( jsonenc e,
const char *  str 
)
static

Definition at line 104 of file json_encode.c.

◆ jsonenc_scalar()

static void jsonenc_scalar ( jsonenc e,
upb_MessageValue  val,
const upb_FieldDef f 
)
static

Definition at line 581 of file json_encode.c.

◆ jsonenc_string()

static void jsonenc_string ( jsonenc e,
upb_StringView  str 
)
static

Definition at line 302 of file json_encode.c.

◆ jsonenc_stringbody()

static void jsonenc_stringbody ( jsonenc e,
upb_StringView  str 
)
static

Definition at line 261 of file json_encode.c.

◆ jsonenc_struct()

static void jsonenc_struct ( jsonenc e,
const upb_Message msg,
const upb_MessageDef m 
)
static

Definition at line 458 of file json_encode.c.

◆ jsonenc_timestamp()

static void jsonenc_timestamp ( jsonenc e,
const upb_Message msg,
const upb_MessageDef m 
)
static

Definition at line 142 of file json_encode.c.

◆ jsonenc_value()

static void jsonenc_value ( jsonenc e,
const upb_Message msg,
const upb_MessageDef m 
)
static

Definition at line 507 of file json_encode.c.

◆ jsonenc_wrapper()

static void jsonenc_wrapper ( jsonenc e,
const upb_Message msg,
const upb_MessageDef m 
)
static

Definition at line 335 of file json_encode.c.

◆ upb_JsonEncode()

size_t upb_JsonEncode ( const upb_Message msg,
const upb_MessageDef m,
const upb_DefPool ext_pool,
int  options,
char *  buf,
size_t  size,
upb_Status status 
)

Definition at line 757 of file json_encode.c.

◆ upb_JsonEncode_Double()

static void upb_JsonEncode_Double ( jsonenc e,
double  val 
)
static

Definition at line 321 of file json_encode.c.

◆ upb_JsonEncode_Float()

static void upb_JsonEncode_Float ( jsonenc e,
float  val 
)
static

Definition at line 328 of file json_encode.c.

◆ upb_JsonEncode_HandleSpecialDoubles()

static bool upb_JsonEncode_HandleSpecialDoubles ( jsonenc e,
double  val 
)
static

Definition at line 308 of file json_encode.c.



grpc
Author(s):
autogenerated on Fri May 16 2025 03:01:21