Couchbase Lite C
Couchbase Lite C API
Loading...
Searching...
No Matches
FLJSON.h
Go to the documentation of this file.
1//
2// FLJSON.h
3//
4// Copyright 2016-Present Couchbase, Inc.
5//
6// Use of this software is governed by the Business Source License included
7// in the file licenses/BSL-Couchbase.txt. As of the Change Date specified
8// in that file, in accordance with the Business Source License, use of this
9// software will be governed by the Apache License, Version 2.0, included in
10// the file licenses/APL2.txt.
11//
12
13#pragma once
14#ifndef _FLJSON_H
15#define _FLJSON_H
16
17#include "FLBase.h"
18
20
21#ifdef __cplusplus
22extern "C" {
23#endif
24
25 // This is the C API! For the C++ API, see Fleece.hh.
26
29
34
38
43
51 bool json5,
52 bool canonicalForm) FLAPI;
53
55
56
59
64
68
72
77
80
81#ifdef __cplusplus
82}
83#endif
84
86
87#endif // _FLJSON_H
#define FL_NULLABLE
Definition CompilerSupport.h:94
#define FLEECE_PUBLIC
Definition CompilerSupport.h:269
#define FL_ASSUME_NONNULL_BEGIN
Definition CompilerSupport.h:92
#define NODISCARD
Definition CompilerSupport.h:63
#define FL_ASSUME_NONNULL_END
Definition CompilerSupport.h:93
#define FLAPI
Definition CompilerSupport.h:292
FLSliceResult FLStringResult
Definition FLSlice.h:99
FLSlice FLString
Definition FLSlice.h:98
FLEECE_PUBLIC bool FLEncoder_ConvertJSON(FLEncoder, FLSlice json)
Parses JSON data and writes the value(s) to the encoder as their Fleece equivalents.
FLEECE_PUBLIC FLStringResult FLValue_ToJSONX(FLValue FL_NULLABLE v, bool json5, bool canonicalForm)
Most general Fleece to JSON converter.
FLEECE_PUBLIC FLStringResult FLValue_ToJSON5(FLValue FL_NULLABLE)
Encodes a Fleece value as JSON5, a more lenient variant of JSON that allows dictionary keys to be unq...
NODISCARD FLEECE_PUBLIC FLMutableArray FL_NULLABLE FLMutableArray_NewFromJSON(FLString json, FLError *FL_NULLABLE outError)
Creates a new mutable Array from JSON.
NODISCARD FLEECE_PUBLIC FLDoc FLDoc_FromJSON(FLSlice json, FLError *FL_NULLABLE outError)
Creates an FLDoc from JSON-encoded data.
NODISCARD FLEECE_PUBLIC FLMutableDict FL_NULLABLE FLMutableDict_NewFromJSON(FLString json, FLError *FL_NULLABLE outError)
Creates a new mutable Dict from json.
FLEECE_PUBLIC FLStringResult FLValue_ToJSON(FLValue FL_NULLABLE)
Encodes a Fleece value as JSON (or a JSON fragment.)
struct _FLDict * FLMutableDict
A reference to a mutable dictionary.
Definition FLBase.h:40
struct _FLArray * FLMutableArray
A reference to a mutable array.
Definition FLBase.h:39
FLError
Error codes returned from some API calls.
Definition FLBase.h:48
struct _FLDoc * FLDoc
A reference to a document.
Definition FLBase.h:42
struct _FLEncoder * FLEncoder
A reference to an encoder.
Definition FLBase.h:41
const struct _FLValue * FLValue
A reference to a value of any type.
Definition FLBase.h:35
A simple reference to a block of memory.
Definition FLSlice.h:45