Documentation ¶
Index ¶
- Constants
- func Free(ptr unsafe.Pointer)
- func FreeCStr(*c.Char)
- type JSON
- func Array() *JSON
- func ArrayRef(child *JSON) *JSON
- func Bool(boolean c.Int) *JSON
- func False() *JSON
- func Null() *JSON
- func Number(num float64) *JSON
- func Object() *JSON
- func ObjectRef(child *JSON) *JSON
- func Parse(value *c.Char) *JSON
- func ParseBytes(value []byte) *JSON
- func ParseString(value string) *JSON
- func ParseWithLength(value *byte, valueLength uintptr) *JSON
- func Raw(raw *c.Char) *JSON
- func String(str *c.Char) *JSON
- func StringRef(str *c.Char) *JSON
- func True() *JSON
- func (o *JSON) AddItem(item *JSON) c.Int
- func (o *JSON) CStr() *c.Char
- func (o *JSON) Cstr() *c.Char
- func (o *JSON) Delete()
- func (o *JSON) GetArrayItem(index c.Int) *JSON
- func (o *JSON) GetArraySize() c.Int
- func (o *JSON) GetObjectItemCaseSensitive(key *c.Char) *JSON
- func (o *JSON) GetStringValue() *c.Char
- func (o *JSON) Print() *c.Char
- func (o *JSON) PrintBuffered(prebuffer c.Int, fmt c.Int) *c.Char
- func (o *JSON) PrintUnformatted() *c.Char
- func (o *JSON) SetItem(key *c.Char, item *JSON) c.Int
Constants ¶
const (
LLGoPackage = "link: $(pkg-config --libs libcjson); -lcjson"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type JSON ¶
type JSON struct {
Unused [0]byte
}
llgo:type C
func ArrayRef ¶
Create an array that only references it's elements so they will not be freed by Delete
func ObjectRef ¶
Create an object that only references it's elements so they will not be freed by Delete
func ParseBytes ¶ added in v0.9.3
func ParseString ¶ added in v0.9.3
func ParseWithLength ¶ added in v0.9.3
func StringRef ¶
Create a string where valuestring references a string so it will not be freed by Delete
func (*JSON) AddItem ¶
Append item to the specified array.
llgo:link (*JSON).AddItem C.cJSON_AddItemToArray
func (*JSON) Delete ¶
func (o *JSON) Delete()
Delete a JSON entity and all subentities.
llgo:link (*JSON).Delete C.cJSON_Delete
func (*JSON) GetArrayItem ¶ added in v0.9.4
llgo:link (*JSON).GetArrayItem C.cJSON_GetArrayItem
func (*JSON) GetArraySize ¶ added in v0.9.4
llgo:link (*JSON).GetArraySize C.cJSON_GetArraySize
func (*JSON) GetObjectItemCaseSensitive ¶ added in v0.9.4
llgo:link (*JSON).GetObjectItemCaseSensitive C.cJSON_GetObjectItemCaseSensitive
func (*JSON) GetStringValue ¶ added in v0.9.4
llgo:link (*JSON).GetStringValue C.cJSON_GetStringValue
func (*JSON) Print ¶
Render a JSON entity to text for transfer/storage.
llgo:link (*JSON).Print C.cJSON_Print
func (*JSON) PrintBuffered ¶
Render a JSON entity to text using a buffered strategy.
prebuffer is a guess at the final size. guessing well reduces reallocation.
fmt=0 gives unformatted, =1 gives formatted.
llgo:link (*JSON).PrintBuffered C.cJSON_PrintBuffered
func (*JSON) PrintUnformatted ¶
Render a JSON entity to text for transfer/storage without any formatting.
llgo:link (*JSON).PrintUnformatted C.cJSON_PrintUnformatted