PageRenderTime 28ms CodeModel.GetById 19ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/src/json.h

https://code.google.com/
C++ Header | 78 lines | 27 code | 22 blank | 29 comment | 0 complexity | 027b94dbf9078127563059cf238ada31 MD5 | raw file
 1/*
 2    $Id: json.h 231 2011-06-27 13:46:19Z marc.noirot $
 3
 4    FLV Metadata updater
 5
 6    Copyright (C) 2007-2012 Marc Noirot <marc.noirot AT gmail.com>
 7
 8    This file is part of FLVMeta.
 9
10    FLVMeta is free software; you can redistribute it and/or modify
11    it under the terms of the GNU General Public License as published by
12    the Free Software Foundation; either version 2 of the License, or
13    (at your option) any later version.
14
15    FLVMeta is distributed in the hope that it will be useful,
16    but WITHOUT ANY WARRANTY; without even the implied warranty of
17    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18    GNU General Public License for more details.
19
20    You should have received a copy of the GNU General Public License
21    along with FLVMeta; if not, write to the Free Software
22    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23*/
24
25#ifndef __JSON_H__
26#define __JSON_H__
27
28#include "types.h"
29
30/**
31    This is a basic JSON emitter.
32    It prints JSON-formatted data to stdout without creating
33    an in-memory tree.
34*/
35
36/* json emitter structure */
37typedef struct __json_emitter {
38    byte print_comma;
39} json_emitter;
40
41
42#ifdef __cplusplus
43extern "C" {
44#endif /* __cplusplus */
45
46void json_emit_init(json_emitter * je);
47
48void json_emit_object_start(json_emitter * je);
49
50void json_emit_object_key(json_emitter * je, const char * str, size_t bytes);
51
52void json_emit_object_key_z(json_emitter * je, const char * str);
53
54void json_emit_object_end(json_emitter * je);
55
56void json_emit_array_start(json_emitter * je);
57
58void json_emit_array_end(json_emitter * je);
59
60void json_emit_boolean(json_emitter * je, byte value);
61
62void json_emit_null(json_emitter * je);
63
64void json_emit_integer(json_emitter * je, int value);
65
66void json_emit_file_offset(json_emitter * je, file_offset_t value);
67
68void json_emit_number(json_emitter * je, number64 value);
69
70void json_emit_string(json_emitter * je, const char * str, size_t bytes);
71
72void json_emit_string_z(json_emitter * je, const char * str);
73
74#ifdef __cplusplus
75}
76#endif /* __cplusplus */
77
78#endif /* __JSON_H__ */