// JvFromJSONBytes takes a utf-8 byte sequence containing JSON and returns the // jv representation of it. func JvFromJSONBytes(b []byte) (*Jv, error) { jv := C.jv_parse((*C.char)(unsafe.Pointer(&b[0]))) if C.jv_is_valid(jv) == 0 { return nil, _ConvertError(jv) } return &Jv{jv}, nil }
// JvFromJSONString takes a JSON string and returns the jv representation of // it. func JvFromJSONString(str string) (*Jv, error) { cs := C.CString(str) defer C.free(unsafe.Pointer(cs)) jv := C.jv_parse(cs) if C.jv_is_valid(jv) == 0 { return nil, _ConvertError(jv) } return &Jv{jv}, nil }
func parseJson(value string) C.jv { return C.jv_parse(C.CString(value)) }