mirror of
https://github.com/falk-werner/webfuse-provider
synced 2026-03-02 04:09:18 +00:00
refactor: introduced convenience functions for json_writer
This commit is contained in:
@@ -360,4 +360,42 @@ wfp_impl_json_writer_array_end(
|
||||
|
||||
wfp_impl_json_writer_pop(writer);
|
||||
wfp_impl_json_writer_end_value(writer);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
wfp_impl_json_writer_object_write_int(
|
||||
struct wfp_json_writer * writer,
|
||||
char const * key,
|
||||
int value)
|
||||
{
|
||||
wfp_impl_json_writer_object_key(writer, key);
|
||||
wfp_impl_json_writer_write_int(writer, value);
|
||||
}
|
||||
|
||||
void
|
||||
wfp_impl_json_writer_object_write_string(
|
||||
struct wfp_json_writer * writer,
|
||||
char const * key,
|
||||
char const * value)
|
||||
{
|
||||
wfp_impl_json_writer_object_key(writer, key);
|
||||
wfp_impl_json_writer_write_string(writer, value);
|
||||
}
|
||||
|
||||
void
|
||||
wfp_impl_json_writer_object_begin_object(
|
||||
struct wfp_json_writer * writer,
|
||||
char const * key)
|
||||
{
|
||||
wfp_impl_json_writer_object_key(writer, key);
|
||||
wfp_impl_json_writer_object_begin(writer);
|
||||
}
|
||||
|
||||
void
|
||||
wfp_impl_json_writer_object_begin_array(
|
||||
struct wfp_json_writer * writer,
|
||||
char const * key)
|
||||
{
|
||||
wfp_impl_json_writer_object_key(writer, key);
|
||||
wfp_impl_json_writer_array_begin(writer);
|
||||
}
|
||||
|
||||
@@ -66,6 +66,28 @@ wfp_impl_json_writer_object_key(
|
||||
struct wfp_json_writer * writer,
|
||||
char const * key);
|
||||
|
||||
extern void
|
||||
wfp_impl_json_writer_object_write_int(
|
||||
struct wfp_json_writer * writer,
|
||||
char const * key,
|
||||
int value);
|
||||
|
||||
extern void
|
||||
wfp_impl_json_writer_object_write_string(
|
||||
struct wfp_json_writer * writer,
|
||||
char const * key,
|
||||
char const * value);
|
||||
|
||||
extern void
|
||||
wfp_impl_json_writer_object_begin_object(
|
||||
struct wfp_json_writer * writer,
|
||||
char const * key);
|
||||
|
||||
extern void
|
||||
wfp_impl_json_writer_object_begin_array(
|
||||
struct wfp_json_writer * writer,
|
||||
char const * key);
|
||||
|
||||
extern void
|
||||
wfp_impl_json_writer_array_begin(
|
||||
struct wfp_json_writer * writer);
|
||||
|
||||
Reference in New Issue
Block a user