Exemplo n.º 1
0
        /// <summary>
        /// Parses the specified |json_string| and returns a dictionary or list
        /// representation. If JSON parsing fails this method returns NULL.
        /// </summary>
        public static CefValue ParseJson(string value, CefJsonParserOptions options)
        {
            fixed(char *value_str = value)
            {
                var n_value  = new cef_string_t(value_str, value != null ? value.Length : 0);
                var n_result = libcef.parse_json(&n_value, options);

                return(CefValue.FromNativeOrNull(n_result));
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Parses the specified |json_string| and returns a dictionary or list
        /// representation. If JSON parsing fails this method returns NULL and populates
        /// |error_msg_out| with a formatted error message.
        /// </summary>
        public static CefValue ParseJsonAndReturnError(string value, CefJsonParserOptions options, out string errorMessage)
        {
            fixed(char *value_str = value)
            {
                var n_value = new cef_string_t(value_str, value != null ? value.Length : 0);

                cef_string_t n_error_msg;
                var          n_result = libcef.parse_jsonand_return_error(&n_value, options, &n_error_msg);

                var result = CefValue.FromNativeOrNull(n_result);

                errorMessage = cef_string_userfree.ToString((cef_string_userfree *)&n_error_msg);
                return(result);
            }
        }
Exemplo n.º 3
0
 public static extern cef_value_t *parse_jsonand_return_error(cef_string_t *json_string, CefJsonParserOptions options, CefJsonParserError *error_code_out, cef_string_t *error_msg_out);
Exemplo n.º 4
0
 public static extern cef_value_t *parse_json(cef_string_t *json_string, CefJsonParserOptions options);
Exemplo n.º 5
0
 public static extern cef_string_userfree *write_json(cef_value_t *node, CefJsonParserOptions options);
Exemplo n.º 6
0
        public static CefValue ParseJson(IntPtr json, int jsonSize, CefJsonParserOptions options)
        {
            var n_result = libcef.parse_json_buffer((void *)json, checked ((UIntPtr)jsonSize), options);

            return(CefValue.FromNativeOrNull(n_result));
        }
Exemplo n.º 7
0
 public static extern cef_value_t *parse_json_buffer(void *json, UIntPtr json_size, CefJsonParserOptions options);