[tarantool-patches] Re: [PATCH v5 05/12] lib: implement JSON tree class for json library

Kirill Shcherbatov kshcherbatov at tarantool.org
Wed Nov 21 13:37:39 MSK 2018


> First, I agree with Kostja that naming looks confusing. Please try to
> come up with better names and send them to us for review before
> reworking the patch so that we could agree first.

I like the following names:

/*********************************************/
/*****/             JSON Parser class:            /*****/
/*********************************************/
json_path_token, json_path_parser,
json_path_parser_create()..

/*********************************************/
/*****/     MHash for JSON Tree class:      /*****/
/*********************************************/
mh_json_tree_t
mh_json_tree_cmp(), mh_json_tree_find(),
mh_json_tree_node().....

/*********************************************/
/*****/                JSON Tree class:            /*****/
/*********************************************/
json_path_node_hash
json_tree, json_tree_node, json_tree_create(...), json_tree_node_create(...), 

struct json_tree_node *
json_tree_lookup(struct json_tree *tree, struct json_tree_node *parent,
		            const char *path, uint32_t path_len)
--- we need parent entry as our paths are relative, i.e. tuple[fieldno][{jsonpath}]

struct json_tree_entry *
json_tree_token_lookup(struct json_tree *tree, struct json_tree_node *parent,
			              json_path_token *token)

type *
json_tree_lookup_entry(tree, parent, path, path_len, type, member)

type *
json_tree_token_lookup_entry(tree, parent, token, type, member)

json_tree_foreach_entry_preorder(node, &tree.root, struct test_struct,
							tree_node) {
}



More information about the Tarantool-patches mailing list