diff --git a/dllexports/tkc.def b/dllexports/tkc.def index d8593ee45..fceba6546 100644 --- a/dllexports/tkc.def +++ b/dllexports/tkc.def @@ -34,6 +34,44 @@ EXPORTS rect_contains rect_fix rect_intersect + object_unref + object_ref + object_create + object_get_type + object_get_desc + object_get_size + object_is_collection + object_set_name + object_compare + object_get_prop + object_get_prop_str + object_get_prop_pointer + object_get_prop_object + object_get_prop_int + object_get_prop_bool + object_get_prop_float + object_remove_prop + object_set_prop + object_set_prop_str + object_set_prop_pointer + object_set_prop_object + object_set_prop_int + object_set_prop_bool + object_set_prop_float + object_copy_prop + object_foreach_prop + object_has_prop + object_eval + object_can_exec + object_exec + object_notify_changed + object_get_prop_by_path + object_get_prop_str_by_path + object_get_prop_pointer_by_path + object_get_prop_object_by_path + object_get_prop_int_by_path + object_get_prop_bool_by_path + object_get_prop_float_by_path value_set_bool value_bool value_set_int8 @@ -85,44 +123,14 @@ EXPORTS value_destroy value_reset value_cast - object_unref - object_ref - object_create - object_get_type - object_get_desc - object_get_size - object_is_collection - object_set_name - object_compare - object_get_prop - object_get_prop_str - object_get_prop_pointer - object_get_prop_object - object_get_prop_int - object_get_prop_bool - object_get_prop_float - object_remove_prop - object_set_prop - object_set_prop_str - object_set_prop_pointer - object_set_prop_object - object_set_prop_int - object_set_prop_bool - object_set_prop_float - object_copy_prop - object_foreach_prop - object_has_prop - object_eval - object_can_exec - object_exec - object_notify_changed - object_get_prop_by_path - object_get_prop_str_by_path - object_get_prop_pointer_by_path - object_get_prop_object_by_path - object_get_prop_int_by_path - object_get_prop_bool_by_path - object_get_prop_float_by_path + rom_fopen + rom_fopen_buff + rom_ftell + rom_feof + rom_fseek + rom_fread + rom_fwrite + rom_fclose asset_info_create asset_info_destroy asset_info_unref @@ -237,9 +245,13 @@ EXPORTS action_thread_pool_create action_thread_pool_exec action_thread_pool_destroy - wcs_len - wcs_cmp - wcs_cpy + conf_node_get_name + conf_node_find_child + conf_node_find_sibling + conf_node_set_value + conf_node_get_value + conf_node_get_first_child + conf_node_set_first_child event_source_manager_init event_source_manager_deinit event_source_manager_get_wakeup_time @@ -248,38 +260,63 @@ EXPORTS event_source_manager_remove event_source_manager_remove_by_tag event_source_manager_destroy - wcs_chr - wstr_init - wstr_set - wstr_clear - wstr_set_utf8 - wstr_get_utf8 - wstr_remove - wstr_insert - wstr_append - wstr_append_with_len - wstr_push - wstr_pop - wstr_push_int - wstr_equal - wstr_from_int - wstr_from_float - wstr_from_value - wstr_to_int - wstr_to_float - wstr_add_float - wstr_trim_float_zero - wstr_normalize_newline - wstr_count_char - wstr_reset - waitable_ring_buffer_create - waitable_ring_buffer_read - waitable_ring_buffer_write - waitable_ring_buffer_destroy - waitable_action_queue_create - waitable_action_queue_recv - waitable_action_queue_send - waitable_action_queue_destroy + conf_doc_create + conf_doc_create_node + conf_doc_destroy_node + conf_doc_append_sibling + conf_doc_append_child + conf_doc_remove_sibling + conf_doc_remove_child + conf_doc_remove_child_by_name + conf_doc_remove_children + conf_doc_set + conf_doc_set_int + conf_doc_set_bool + conf_doc_set_float + conf_doc_set_str + conf_doc_get + conf_doc_get_int + conf_doc_get_bool + conf_doc_get_float + conf_doc_get_str + conf_doc_remove + conf_doc_clear + conf_doc_move_up + conf_doc_move_down + conf_doc_exists + conf_doc_is_first + conf_doc_is_last + conf_doc_add_child + conf_doc_destroy + conf_doc_save_json + conf_doc_load_json + app_conf_set_instance + app_conf_get_instance + app_conf_save + app_conf_reload + app_conf_on_changed + app_conf_off_changed + app_conf_off_changed_by_ctx + app_conf_deinit + app_conf_set + app_conf_get + app_conf_exist + app_conf_set_int + app_conf_set_int64 + app_conf_set_bool + app_conf_set_double + app_conf_set_str + app_conf_set_wstr + app_conf_get_int + app_conf_get_int64 + app_conf_get_bool + app_conf_get_double + app_conf_get_str + app_conf_get_wstr + app_conf_remove + app_conf_init + app_conf_init_ubjson + app_conf_init_json eval_execute tk_expr_eval tk_expr_eval_str @@ -331,6 +368,7 @@ EXPORTS func_call_parser_parse func_call_parser_deinit func_call_parse + app_conf_init_ini idle_manager idle_manager_set idle_manager_create @@ -345,6 +383,7 @@ EXPORTS idle_manager_add int_str_value int_str_name + tk_ostream_serial_create log_get_log_level log_set_log_level matrix_init @@ -356,76 +395,52 @@ EXPORTS matrix_scale matrix_rotate matrix_transform_point - tk_atoi - tk_atob - tk_atof - tk_str_cmp - tk_str_icmp - tk_watoi - tk_watoi_n - tk_watob - tk_watof - tk_skip_to_num - tk_itoa - tk_ftoa - tk_strtol - tk_strcpy - tk_strncpy - tk_strdup - tk_wstrdup - tk_strndup - tk_strlen - tk_str_append - tk_memset16 - tk_memset24 - tk_memset32 - tk_memcpy16 - tk_memcpy32 - tk_pixel_copy - tk_snprintf - tk_sscanf - filename_to_name - filename_to_name_ex - xml_file_expand_read - tk_str_copy - dummy_destroy - default_destroy - pointer_compare - compare_always_equal - tk_is_valid_name - tk_str_start_with - tk_under_score_to_camel - tk_pointer_to_int - tk_pointer_from_int - tk_str_toupper - tk_str_tolower - tk_wstr_dup_utf8 - tk_wstr_count_c - image_region_parse - tk_utf8_from_utf16 - tk_utf8_from_utf16_ex - tk_utf8_to_utf16 - tokenizer_init - tokenizer_init_ex - tokenizer_has_more - tokenizer_next - tokenizer_next_until - tokenizer_next_expr_until - tokenizer_next_int - tokenizer_next_float - tokenizer_deinit + ubjson_writer_init + ubjson_writer_write_key + ubjson_writer_write_null + ubjson_writer_write_noop + ubjson_writer_write_true + ubjson_writer_write_false + ubjson_writer_write_int + ubjson_writer_write_int8 + ubjson_writer_write_uint8 + ubjson_writer_write_int16 + ubjson_writer_write_int32 + ubjson_writer_write_int64 + ubjson_writer_write_float32 + ubjson_writer_write_float64 + ubjson_writer_write_char + ubjson_writer_write_str + ubjson_writer_write_str_len + ubjson_writer_write_object + ubjson_writer_write_array_begin + ubjson_writer_write_array_end + ubjson_writer_write_object_begin + ubjson_writer_write_object_end + ubjson_writer_write_data + ubjson_writer_write_kv_object_begin + ubjson_writer_write_kv_object + ubjson_writer_write_kv_int + ubjson_writer_write_kv_int64 + ubjson_writer_write_kv_float + ubjson_writer_write_kv_double + ubjson_writer_write_kv_bool + ubjson_writer_write_kv_str + ubjson_writer_write_kv_str_len + ubjson_writer_write_kv_value + ubjson_parse + ubjson_to_object + ubjson_dump + wcs_dup + wcs_len + wcs_cmp + wcs_cpy tk_alloc tk_calloc tk_realloc tk_free tk_mem_dump tk_mem_is_valid_addr - action_thread_create - action_thread_create_with_queue - action_thread_exec - action_thread_set_on_idle - action_thread_set_on_quit - action_thread_destroy tk_mutex_nest_create tk_mutex_nest_lock tk_mutex_nest_try_lock @@ -444,73 +459,38 @@ EXPORTS named_value_get_value named_value_deinit named_value_destroy - timer_manager - timer_manager_set - timer_manager_create - timer_manager_init - timer_manager_deinit - timer_manager_destroy - timer_manager_add - timer_manager_remove - timer_manager_reset - timer_manager_find - timer_manager_count - timer_manager_next_time - timer_manager_append - time_now_s - time_now_ms - tk_thread_create - tk_thread_set_name - tk_thread_set_stack_size - tk_thread_set_priority - tk_thread_start - tk_thread_join - tk_thread_get_args - tk_thread_destroy - tk_thread_self - str_init - str_extend - str_eq - str_set - str_clear - str_set_with_len - str_append - str_append_more - str_append_with_len - str_insert - str_insert_with_len - str_remove - str_append_char - str_append_int - str_append_double - str_append_json_str - str_append_json_int_pair - str_append_json_str_pair - str_append_json_double_pair - str_append_json_bool_pair - str_pop - str_unescape - str_decode_xml_entity - str_decode_xml_entity_with_len - str_from_int - str_from_float - str_from_value - str_from_wstr - str_from_wstr_with_len - str_to_int - str_to_float - str_end_with - str_start_with - str_trim - str_trim_left - str_trim_right - str_replace - str_to_lower - str_to_upper - str_expand_vars - str_reset - str_str_value - str_str_name + wcs_chr + wstr_init + wstr_set + wstr_clear + wstr_set_utf8 + wstr_get_utf8 + wstr_remove + wstr_insert + wstr_append + wstr_append_with_len + wstr_push + wstr_pop + wstr_push_int + wstr_equal + wstr_from_int + wstr_from_float + wstr_from_value + wstr_to_int + wstr_to_float + wstr_add_float + wstr_trim_float_zero + wstr_normalize_newline + wstr_count_char + wstr_reset + waitable_ring_buffer_create + waitable_ring_buffer_read + waitable_ring_buffer_write + waitable_ring_buffer_destroy + waitable_action_queue_create + waitable_action_queue_recv + waitable_action_queue_send + waitable_action_queue_destroy path_basename path_extname path_dirname @@ -557,14 +537,12 @@ EXPORTS ring_buffer_set_write_cursor_delta ring_buffer_ensure_write_space ring_buffer_destroy - rom_fopen - rom_fopen_buff - rom_ftell - rom_feof - rom_fseek - rom_fread - rom_fwrite - rom_fclose + action_thread_create + action_thread_create_with_queue + action_thread_exec + action_thread_set_on_idle + action_thread_set_on_quit + action_thread_destroy tk_semaphore_create tk_semaphore_wait tk_semaphore_post @@ -596,34 +574,173 @@ EXPORTS udp_listen udp_connect tk_socketpair - wcs_dup - event_source_fd_create - event_source_idle_create + str_str_value + str_str_name + str_init + str_extend + str_eq + str_set + str_clear + str_set_with_len + str_append + str_append_more + str_append_with_len + str_insert + str_insert_with_len + str_remove + str_append_char + str_append_int + str_append_double + str_append_json_str + str_append_json_int_pair + str_append_json_str_pair + str_append_json_double_pair + str_append_json_bool_pair + str_pop + str_unescape + str_decode_xml_entity + str_decode_xml_entity_with_len + str_from_int + str_from_float + str_from_value + str_from_wstr + str_from_wstr_with_len + str_to_int + str_to_float + str_end_with + str_start_with + str_trim + str_trim_left + str_trim_right + str_replace + str_to_lower + str_to_upper + str_expand_vars + str_reset + tk_thread_create + tk_thread_set_name + tk_thread_set_stack_size + tk_thread_set_priority + tk_thread_start + tk_thread_join + tk_thread_get_args + tk_thread_destroy + tk_thread_self + time_now_s + time_now_ms + timer_manager + timer_manager_set + timer_manager_create + timer_manager_init + timer_manager_deinit + timer_manager_destroy + timer_manager_add + timer_manager_remove + timer_manager_reset + timer_manager_find + timer_manager_count + timer_manager_next_time + timer_manager_append + tokenizer_init + tokenizer_init_ex + tokenizer_has_more + tokenizer_next + tokenizer_next_until + tokenizer_next_expr_until + tokenizer_next_int + tokenizer_next_float + tokenizer_deinit + tk_utf8_from_utf16 + tk_utf8_from_utf16_ex + tk_utf8_to_utf16 + tk_atoi + tk_atob + tk_atof + tk_str_cmp + tk_str_icmp + tk_watoi + tk_watoi_n + tk_watob + tk_watof + tk_skip_to_num + tk_itoa + tk_ftoa + tk_strtol + tk_strcpy + tk_strncpy + tk_strdup + tk_wstrdup + tk_strndup + tk_strlen + tk_str_append + tk_memset16 + tk_memset24 + tk_memset32 + tk_memcpy16 + tk_memcpy32 + tk_pixel_copy + tk_snprintf + tk_sscanf + filename_to_name + filename_to_name_ex + xml_file_expand_read + tk_str_copy + dummy_destroy + default_destroy + pointer_compare + compare_always_equal + tk_is_valid_name + tk_str_start_with + tk_under_score_to_camel + tk_pointer_to_int + tk_pointer_from_int + tk_str_toupper + tk_str_tolower + tk_wstr_dup_utf8 + tk_wstr_count_c + image_region_parse event_source_manager_default_create - event_source_timer_create - event_source_get_fd - event_source_dispatch - event_source_set_tag - event_source_check - event_source_get_wakeup_time prop_change_event_cast prop_change_event_init progress_event_cast progress_event_init done_event_cast done_event_init - cmd_exec_event_cast - cmd_exec_event_init error_event_cast error_event_init + cmd_exec_event_cast + cmd_exec_event_init + conf_obj_create + conf_obj_get_doc + conf_obj_save + conf_obj_set_readonly + event_source_fd_create + event_source_idle_create + object_array_create + object_array_clone + object_array_unref + object_array_clear_props + event_source_timer_create + event_source_get_fd + event_source_dispatch + event_source_set_tag + event_source_check + event_source_get_wakeup_time + conf_ubjson_load + timer_info_cast + conf_json_load + conf_ini_load + tk_ostream_write + tk_ostream_seek + tk_ostream_write_len + tk_ostream_write_byte + tk_ostream_flush object_locker_create - idle_info_cast - tk_iostream_get_istream - tk_iostream_get_ostream - tk_iostream_read - tk_iostream_read_len - tk_iostream_write - tk_iostream_write_len + object_default_create + object_default_clone + object_default_unref + object_default_clear_props + object_default_find_prop tk_istream_read tk_istream_seek tk_istream_tell @@ -633,19 +750,43 @@ EXPORTS tk_istream_read_len tk_istream_read_line tk_istream_read_line_str - object_array_create - object_array_clone - object_array_unref - object_array_clear_props - timer_info_cast object_compositor_create - object_default_create - object_default_clone - object_default_unref - object_default_clear_props - object_default_find_prop - tk_ostream_write - tk_ostream_seek - tk_ostream_write_len - tk_ostream_write_byte - tk_ostream_flush + idle_info_cast + tk_iostream_get_istream + tk_iostream_get_ostream + tk_iostream_read + tk_iostream_read_len + tk_iostream_write + tk_iostream_write_len + tk_iostream_mem_create + tk_iostream_serial_create + tk_iostream_serial_config + tk_ostream_noisy_create + tk_iostream_shdlc_create + tk_istream_shdlc_create + tk_ostream_shdlc_create + tk_iostream_noisy_create + tk_ostream_retry_create + tk_ostream_retry_set_max_retry_times + tk_ostream_retry_set_max_buffer_size + tk_ostream_retry_clear_buffer + tk_ostream_retry_set_discard_policy + tk_ostream_mem_create + tk_istream_mem_create + tk_istream_serial_create + tk_ostream_udp_create + tk_ostream_udp_set_target_with_host + tk_ostream_udp_set_target_with_addr + tk_ostream_tcp_create + tk_istream_udp_create + tk_istream_udp_set_target_with_host + tk_istream_udp_set_target_with_addr + tk_iostream_udp_create_client + tk_iostream_udp_create + tk_iostream_tcp_create + tk_ostream_file_create + tk_istream_file_create + tk_ostream_buffered_create + tk_ostream_buffered_get_size + tk_istream_buffered_create + tk_istream_tcp_create diff --git a/scripts/app_helper_base.py b/scripts/app_helper_base.py index 5a4c0e874..0027ea874 100644 --- a/scripts/app_helper_base.py +++ b/scripts/app_helper_base.py @@ -44,6 +44,9 @@ class AppHelperBase: def set_deps(self, DEPENDS_LIBS): self.DEPENDS_LIBS = DEPENDS_LIBS return self + def set_src_dir(self, SRC_DIR): + self.SRC_DIR = SRC_DIR + return self def set_libs(self, APP_LIBS): self.APP_LIBS = APP_LIBS @@ -130,6 +133,7 @@ class AppHelperBase: def __init__(self, ARGUMENTS): APP_ROOT = os.path.normpath(os.getcwd()) + self.SRC_DIR = 'src' self.ARGUMENTS = ARGUMENTS self.DEF_FILE = None self.DEF_FILE_PROCESSOR = None @@ -227,7 +231,7 @@ class AppHelperBase: dll_def_gen_tools = os.path.join( self.AWTK_ROOT, 'tools/dll_def_gen/index.js') - cmd = 'node ' + '"' + idl_gen_tools + '"' + ' idl/idl.json ' + 'src' + cmd = 'node ' + '"' + idl_gen_tools + '"' + ' idl/idl.json ' + self.SRC_DIR if os.system(cmd) != 0: print('exe cmd: ' + cmd + ' failed.') diff --git a/src/SConscript b/src/SConscript index 326159f23..18ea35513 100644 --- a/src/SConscript +++ b/src/SConscript @@ -107,17 +107,20 @@ env.Library(os.path.join(LIB_DIR, 'tkc_static'), TK_SOURCES, LIBS=[]) TKC_DEPS_LIBS=[] OS_NAME = platform.system() TKC_LINKFLAGS = env['LINKFLAGS']; +TKC_STATIC_LIBS = ['conf_io', 'ubjson', 'streams', 'tkc_static', 'compressors', 'miniz'] +TKC_LINK_ALL=' -Wl,--whole-archive -lstreams -lconf_io -lubjson -ltkc_static -lcompressors -lminiz -Wl,--no-whole-archive' if OS_NAME == 'Windows': if TOOLS_NAME == '' : - TKC_DEPS_LIBS=['tkc_static', 'SDL2', 'user32','winmm.lib','advapi32.lib','shell32.lib', 'ole32.lib'] + TKC_DEPS_LIBS= TKC_STATIC_LIBS + ['SDL2', 'user32','winmm.lib','advapi32.lib','shell32.lib', 'ole32.lib'] TKC_LINKFLAGS += ' /DEF:"dllexports/tkc.def" ' elif TOOLS_NAME == 'mingw': - TKC_LINKFLAGS +=' -Wl,--whole-archive -ltkc_static -Wl,--no-whole-archive' + TKC_LINKFLAGS += TKC_LINK_ALL elif OS_NAME == 'Darwin': + TKC_DEPS_LIBS= TKC_STATIC_LIBS TKC_LINKFLAGS +=' -all_load ' elif OS_NAME == 'Linux': - TKC_LINKFLAGS +=' -Wl,--whole-archive -ltkc_static -Wl,--no-whole-archive' + TKC_LINKFLAGS += TKC_LINK_ALL env.SharedLibrary(os.path.join(BIN_DIR, 'tkc'), [], LIBS=TKC_DEPS_LIBS, LINKFLAGS=TKC_LINKFLAGS); diff --git a/tools/dll_def_gen/tkc.js b/tools/dll_def_gen/tkc.js index d98e0c1d1..9de3321f1 100644 --- a/tools/dll_def_gen/tkc.js +++ b/tools/dll_def_gen/tkc.js @@ -3,7 +3,7 @@ const path = require('path') const DefGenerator = require('./def_generator') -let inputIDL = path.normalize(path.join(__dirname, '../idl_gen/tkc_idl.json')); +let inputIDL = path.normalize(path.join(__dirname, '../idl_gen/tkc.json')); let outputDef = '../../dllexports/tkc.def'; let withIndex = false; diff --git a/tools/idl_gen/tkc.js b/tools/idl_gen/tkc.js index 9e46618a7..c4786555b 100644 --- a/tools/idl_gen/tkc.js +++ b/tools/idl_gen/tkc.js @@ -4,19 +4,11 @@ const glob = require('glob') const IDLGen = require('./idl_gen.js') let outputIDL = 'tkc.json'; -let sourcesPath = path.normalize(path.join(__dirname, '../../src/tkc')); - -if(process.argv.length == 3) { - outputIDL = process.argv[2]; -} else if(process.argv.length > 3) { - outputIDL = process.argv[2]; - sourcesPath = process.argv[3]; -} - -if(sourcesPath === '-h' || sourcesPath === '--help') { - console.log('Usage: node index.js outputIDL sourcesPath'); - process.exit(0); -} +let sourcesPath = [ + path.normalize(path.join(__dirname, '../../src/tkc')), + path.normalize(path.join(__dirname, '../../src/ubjson')), + path.normalize(path.join(__dirname, '../../src/streams')), + path.normalize(path.join(__dirname, '../../src/conf_io'))].join(';'); IDLGen.gen(sourcesPath, outputIDL) diff --git a/tools/idl_gen/tkc.json b/tools/idl_gen/tkc.json index 4667094a9..9394e1ae2 100644 --- a/tools/idl_gen/tkc.json +++ b/tools/idl_gen/tkc.json @@ -1009,6 +1009,972 @@ }, "level": 1 }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + } + ], + "annotation": { + "deconstructor": true, + "scriptable": true, + "gc": true + }, + "desc": "引用计数减1。引用计数为0时,销毁对象。", + "name": "object_unref", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + } + ], + "annotation": { + "constructor": true, + "scriptable": true, + "gc": true + }, + "desc": "引用计数加1。", + "name": "object_ref", + "return": { + "type": "object_t*", + "desc": "返回object对象。" + } + }, + { + "params": [ + { + "type": "const object_vtable_t*", + "name": "vt", + "desc": "虚函数表。" + } + ], + "annotation": {}, + "desc": "创建对象。\n\n> 仅供子类调用。", + "name": "object_create", + "return": { + "type": "ret_t", + "desc": "返回object对象。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "获取对象的类型名称。", + "name": "object_get_type", + "return": { + "type": "const char*", + "desc": "返回对象的类型名称。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "获取对象的描述信息。", + "name": "object_get_desc", + "return": { + "type": "const char*", + "desc": "返回对象的描述信息。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "获取对象占用内存的大小。", + "name": "object_get_size", + "return": { + "type": "uint32_t", + "desc": "返回对象占用内存的大小。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "判断对象是否是集合。", + "name": "object_is_collection", + "return": { + "type": "bool_t", + "desc": "返回TRUE表示是集合,否则不是。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + }, + { + "type": "const char*", + "name": "name", + "desc": "对象的名称。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置对象的名称。", + "name": "object_set_name", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + }, + { + "type": "object_t*", + "name": "other", + "desc": "比较的object对象。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "比较两个对象。", + "name": "object_compare", + "return": { + "type": "int", + "desc": "返回比较结果。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + }, + { + "type": "const char*", + "name": "name", + "desc": "属性的名称。" + }, + { + "type": "value_t*", + "name": "v", + "desc": "返回属性的值。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "获取指定属性的值。", + "name": "object_get_prop", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + }, + { + "type": "const char*", + "name": "name", + "desc": "属性的名称。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "获取指定属性的字符串类型的值。", + "name": "object_get_prop_str", + "return": { + "type": "const char*", + "desc": "返回指定属性的字符串类型的值。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + }, + { + "type": "const char*", + "name": "name", + "desc": "属性的名称。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "获取指定属性的指针类型的值。", + "name": "object_get_prop_pointer", + "return": { + "type": "void*", + "desc": "返回指定属性的指针类型的值。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + }, + { + "type": "const char*", + "name": "name", + "desc": "属性的名称。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "获取指定属性的object类型的值。", + "name": "object_get_prop_object", + "return": { + "type": "object_t*", + "desc": "返回指定属性的object类型的值。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + }, + { + "type": "const char*", + "name": "name", + "desc": "属性的名称。" + }, + { + "type": "int32_t", + "name": "defval", + "desc": "缺省值。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "获取指定属性的整数类型的值。", + "name": "object_get_prop_int", + "return": { + "type": "int32_t", + "desc": "返回指定属性的整数类型的值。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + }, + { + "type": "const char*", + "name": "name", + "desc": "属性的名称。" + }, + { + "type": "bool_t", + "name": "defval", + "desc": "缺省值。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "获取指定属性的bool类型的值。", + "name": "object_get_prop_bool", + "return": { + "type": "bool_t", + "desc": "返回指定属性的bool类型的值。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + }, + { + "type": "const char*", + "name": "name", + "desc": "属性的名称。" + }, + { + "type": "float_t", + "name": "defval", + "desc": "缺省值。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "获取指定属性的浮点数类型的值。", + "name": "object_get_prop_float", + "return": { + "type": "float_t", + "desc": "返回指定属性的浮点数类型的值。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + }, + { + "type": "const char*", + "name": "name", + "desc": "属性的名称。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "删除指定属性。", + "name": "object_remove_prop", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + }, + { + "type": "const char*", + "name": "name", + "desc": "属性的名称。" + }, + { + "type": "value_t*", + "name": "value", + "desc": "属性的值。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置指定属性的值。", + "name": "object_set_prop", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + }, + { + "type": "const char*", + "name": "name", + "desc": "属性的名称。" + }, + { + "type": "const char*", + "name": "value", + "desc": "属性的值。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置指定属性的字符串类型的值。", + "name": "object_set_prop_str", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + }, + { + "type": "const char*", + "name": "name", + "desc": "属性的名称。" + }, + { + "type": "void*", + "name": "value", + "desc": "属性的值。" + } + ], + "annotation": {}, + "desc": "设置指定属性的指针类型的值。", + "name": "object_set_prop_pointer", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + }, + { + "type": "const char*", + "name": "name", + "desc": "属性的名称。" + }, + { + "type": "object_t*", + "name": "value", + "desc": "属性的值。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置指定属性的object类型的值。", + "name": "object_set_prop_object", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + }, + { + "type": "const char*", + "name": "name", + "desc": "属性的名称。" + }, + { + "type": "int32_t", + "name": "value", + "desc": "属性的值。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置指定属性的整数类型的值。", + "name": "object_set_prop_int", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + }, + { + "type": "const char*", + "name": "name", + "desc": "属性的名称。" + }, + { + "type": "bool_t", + "name": "value", + "desc": "属性的值。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置指定属性的bool类型的值。", + "name": "object_set_prop_bool", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + }, + { + "type": "const char*", + "name": "name", + "desc": "属性的名称。" + }, + { + "type": "float_t", + "name": "value", + "desc": "属性的值。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "设置指定属性的浮点数类型的值。", + "name": "object_set_prop_float", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "目标对象。" + }, + { + "type": "object_t*", + "name": "src", + "desc": "源对象。" + }, + { + "type": "const char*", + "name": "name", + "desc": "属性的名称。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "拷贝指定的属性。", + "name": "object_copy_prop", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + }, + { + "type": "tk_visit_t", + "name": "on_prop", + "desc": "回调函数。" + }, + { + "type": "void*", + "name": "ctx", + "desc": "回调函数上下文。" + } + ], + "annotation": {}, + "desc": "遍历所有属性。", + "name": "object_foreach_prop", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + }, + { + "type": "const char*", + "name": "name", + "desc": "属性的名称。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "检查是否存在指定的属性。", + "name": "object_has_prop", + "return": { + "type": "bool_t", + "desc": "返回TRUE表示存在,否则表示不存在。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + }, + { + "type": "const char*", + "name": "expr", + "desc": "表达式。" + }, + { + "type": "value_t*", + "name": "v", + "desc": "返回计算结果。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "计算一个表达式,表达式中引用的变量从prop中获取。", + "name": "object_eval", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + }, + { + "type": "const char*", + "name": "name", + "desc": "命令的名称。" + }, + { + "type": "const char*", + "name": "args", + "desc": "命令的参数。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "检查是否可以执行指定的命令。", + "name": "object_can_exec", + "return": { + "type": "bool_t", + "desc": "返回TRUE表示可以执行,否则表示不可以执行。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + }, + { + "type": "const char*", + "name": "name", + "desc": "命令的名称。" + }, + { + "type": "const char*", + "name": "args", + "desc": "命令的参数。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "执行指定的命令。", + "name": "object_exec", + "alias": "execute", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "触发EVT_PROPS_CHANGED事件。", + "name": "object_notify_changed", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + }, + { + "type": "const char*", + "name": "path", + "desc": "属性的path,各级之间用.分隔。" + }, + { + "type": "value_t*", + "name": "v", + "desc": "返回属性的值。" + } + ], + "annotation": {}, + "desc": "获取指定path属性的值。", + "name": "object_get_prop_by_path", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + }, + { + "type": "const char*", + "name": "path", + "desc": "属性的path。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "获取指定属性的字符串类型的值。", + "name": "object_get_prop_str_by_path", + "return": { + "type": "const char*", + "desc": "返回指定属性的字符串类型的值。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + }, + { + "type": "const char*", + "name": "path", + "desc": "属性的path。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "获取指定属性的指针类型的值。", + "name": "object_get_prop_pointer_by_path", + "return": { + "type": "void*", + "desc": "返回指定属性的指针类型的值。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + }, + { + "type": "const char*", + "name": "path", + "desc": "属性的path。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "获取指定属性的object类型的值。", + "name": "object_get_prop_object_by_path", + "return": { + "type": "object_t*", + "desc": "返回指定属性的object类型的值。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + }, + { + "type": "const char*", + "name": "path", + "desc": "属性的path。" + }, + { + "type": "int32_t", + "name": "defval", + "desc": "缺省值。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "获取指定属性的整数类型的值。", + "name": "object_get_prop_int_by_path", + "return": { + "type": "int32_t", + "desc": "返回指定属性的整数类型的值。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + }, + { + "type": "const char*", + "name": "path", + "desc": "属性的path。" + }, + { + "type": "bool_t", + "name": "defval", + "desc": "缺省值。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "获取指定属性的bool类型的值。", + "name": "object_get_prop_bool_by_path", + "return": { + "type": "bool_t", + "desc": "返回指定属性的bool类型的值。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "object对象。" + }, + { + "type": "const char*", + "name": "path", + "desc": "属性的path。" + }, + { + "type": "float_t", + "name": "defval", + "desc": "缺省值。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "获取指定属性的浮点数类型的值。", + "name": "object_get_prop_float_by_path", + "return": { + "type": "float_t", + "desc": "返回指定属性的浮点数类型的值。" + } + } + ], + "events": [], + "properties": [ + { + "name": "ref_count", + "desc": "引用计数。", + "type": "int32_t", + "annotation": { + "readable": true, + "scriptable": true + } + }, + { + "name": "name", + "desc": "对象的名称。", + "type": "char*", + "annotation": { + "readable": true, + "scriptable": true + } + } + ], + "header": "tkc/object.h", + "desc": "对象接口。", + "name": "object_t", + "order": -9, + "parent": "emitter_t", + "annotation": { + "scriptable": true + }, + "level": 2 + }, { "type": "class", "methods": [ @@ -2055,149 +3021,40 @@ { "params": [ { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - } - ], - "annotation": { - "deconstructor": true, - "scriptable": true, - "gc": true - }, - "desc": "引用计数减1。引用计数为0时,销毁对象。", - "name": "object_unref", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - } - ], - "annotation": { - "constructor": true, - "scriptable": true, - "gc": true - }, - "desc": "引用计数加1。", - "name": "object_ref", - "return": { - "type": "object_t*", - "desc": "返回object对象。" - } - }, - { - "params": [ - { - "type": "const object_vtable_t*", - "name": "vt", - "desc": "虚函数表。" - } - ], - "annotation": {}, - "desc": "创建对象。\n\n> 仅供子类调用。", - "name": "object_create", - "return": { - "type": "ret_t", - "desc": "返回object对象。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "获取对象的类型名称。", - "name": "object_get_type", - "return": { - "type": "const char*", - "desc": "返回对象的类型名称。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "获取对象的描述信息。", - "name": "object_get_desc", - "return": { - "type": "const char*", - "desc": "返回对象的描述信息。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "获取对象占用内存的大小。", - "name": "object_get_size", - "return": { - "type": "uint32_t", - "desc": "返回对象占用内存的大小。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "判断对象是否是集合。", - "name": "object_is_collection", - "return": { - "type": "bool_t", - "desc": "返回TRUE表示是集合,否则不是。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" + "type": "const char*", + "name": "name", + "desc": "文件名。" }, { "type": "const char*", - "name": "name", - "desc": "对象的名称。" + "name": "mode", + "desc": "打开方式。" } ], - "annotation": { - "scriptable": true - }, - "desc": "设置对象的名称。", - "name": "object_set_name", + "annotation": {}, + "desc": "打开文件。", + "name": "rom_fopen", + "return": { + "type": "ret_t", + "desc": "返回不是NULL表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "const uint8_t*", + "name": "data", + "desc": "数据。" + }, + { + "type": "uint32_t", + "name": "capacity", + "desc": "容量。" + } + ], + "annotation": {}, + "desc": "打开文件。", + "name": "rom_fopen_buff", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" @@ -2206,1234 +3063,147 @@ { "params": [ { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - }, - { - "type": "object_t*", - "name": "other", - "desc": "比较的object对象。" + "type": "rom_file_t*", + "name": "f", + "desc": "rom_file_t对象。" } ], - "annotation": { - "scriptable": true - }, - "desc": "比较两个对象。", - "name": "object_compare", + "annotation": {}, + "desc": "返回文件当前位置。", + "name": "rom_ftell", + "return": { + "type": "long", + "desc": "返回当前位置。" + } + }, + { + "params": [ + { + "type": "rom_file_t*", + "name": "f", + "desc": "rom_file_t对象。" + } + ], + "annotation": {}, + "desc": "判断是否到文件末尾。", + "name": "rom_feof", "return": { "type": "int", - "desc": "返回比较结果。" + "desc": "返回当前位置。" } }, { "params": [ { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" + "type": "rom_file_t*", + "name": "f", + "desc": "rom_file_t对象。" }, { - "type": "const char*", - "name": "name", - "desc": "属性的名称。" + "type": "long", + "name": "offset", + "desc": "偏移量。" }, { - "type": "value_t*", - "name": "v", - "desc": "返回属性的值。" + "type": "int", + "name": "whence", + "desc": "要从哪个位置开始偏移, SEEK_SET表示从头开始,SEEK_CUR表示从当前位置开始,SEEK_END表示从文件末尾开始。" } ], - "annotation": { - "scriptable": true - }, - "desc": "获取指定属性的值。", - "name": "object_get_prop", + "annotation": {}, + "desc": "设置文件当前位置。", + "name": "rom_fseek", "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" + "type": "int", + "desc": "返回0表示成功。" } }, { "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - }, - { - "type": "const char*", - "name": "name", - "desc": "属性的名称。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "获取指定属性的字符串类型的值。", - "name": "object_get_prop_str", - "return": { - "type": "const char*", - "desc": "返回指定属性的字符串类型的值。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - }, - { - "type": "const char*", - "name": "name", - "desc": "属性的名称。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "获取指定属性的指针类型的值。", - "name": "object_get_prop_pointer", - "return": { - "type": "void*", - "desc": "返回指定属性的指针类型的值。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - }, - { - "type": "const char*", - "name": "name", - "desc": "属性的名称。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "获取指定属性的object类型的值。", - "name": "object_get_prop_object", - "return": { - "type": "object_t*", - "desc": "返回指定属性的object类型的值。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - }, - { - "type": "const char*", - "name": "name", - "desc": "属性的名称。" - }, - { - "type": "int32_t", - "name": "defval", - "desc": "缺省值。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "获取指定属性的整数类型的值。", - "name": "object_get_prop_int", - "return": { - "type": "int32_t", - "desc": "返回指定属性的整数类型的值。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - }, - { - "type": "const char*", - "name": "name", - "desc": "属性的名称。" - }, - { - "type": "bool_t", - "name": "defval", - "desc": "缺省值。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "获取指定属性的bool类型的值。", - "name": "object_get_prop_bool", - "return": { - "type": "bool_t", - "desc": "返回指定属性的bool类型的值。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - }, - { - "type": "const char*", - "name": "name", - "desc": "属性的名称。" - }, - { - "type": "float_t", - "name": "defval", - "desc": "缺省值。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "获取指定属性的浮点数类型的值。", - "name": "object_get_prop_float", - "return": { - "type": "float_t", - "desc": "返回指定属性的浮点数类型的值。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - }, - { - "type": "const char*", - "name": "name", - "desc": "属性的名称。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "删除指定属性。", - "name": "object_remove_prop", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - }, - { - "type": "const char*", - "name": "name", - "desc": "属性的名称。" - }, - { - "type": "value_t*", - "name": "value", - "desc": "属性的值。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "设置指定属性的值。", - "name": "object_set_prop", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - }, - { - "type": "const char*", - "name": "name", - "desc": "属性的名称。" - }, - { - "type": "const char*", - "name": "value", - "desc": "属性的值。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "设置指定属性的字符串类型的值。", - "name": "object_set_prop_str", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - }, - { - "type": "const char*", - "name": "name", - "desc": "属性的名称。" - }, { "type": "void*", - "name": "value", - "desc": "属性的值。" + "name": "ptr", + "desc": "数据的缓冲区。" + }, + { + "type": "size_t", + "name": "size", + "desc": "缓冲区大小。" + }, + { + "type": "size_t", + "name": "nitems", + "desc": "元素的个数。" + }, + { + "type": "rom_file_t*", + "name": "f", + "desc": "rom_file_t对象。" } ], "annotation": {}, - "desc": "设置指定属性的指针类型的值。", - "name": "object_set_prop_pointer", + "desc": "读取文件。", + "name": "rom_fread", "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" + "type": "size_t", + "desc": "返回实际读取的字节数。" } }, { "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - }, - { - "type": "const char*", - "name": "name", - "desc": "属性的名称。" - }, - { - "type": "object_t*", - "name": "value", - "desc": "属性的值。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "设置指定属性的object类型的值。", - "name": "object_set_prop_object", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - }, - { - "type": "const char*", - "name": "name", - "desc": "属性的名称。" - }, - { - "type": "int32_t", - "name": "value", - "desc": "属性的值。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "设置指定属性的整数类型的值。", - "name": "object_set_prop_int", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - }, - { - "type": "const char*", - "name": "name", - "desc": "属性的名称。" - }, - { - "type": "bool_t", - "name": "value", - "desc": "属性的值。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "设置指定属性的bool类型的值。", - "name": "object_set_prop_bool", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - }, - { - "type": "const char*", - "name": "name", - "desc": "属性的名称。" - }, - { - "type": "float_t", - "name": "value", - "desc": "属性的值。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "设置指定属性的浮点数类型的值。", - "name": "object_set_prop_float", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "目标对象。" - }, - { - "type": "object_t*", - "name": "src", - "desc": "源对象。" - }, - { - "type": "const char*", - "name": "name", - "desc": "属性的名称。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "拷贝指定的属性。", - "name": "object_copy_prop", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - }, - { - "type": "tk_visit_t", - "name": "on_prop", - "desc": "回调函数。" - }, { "type": "void*", - "name": "ctx", - "desc": "回调函数上下文。" + "name": "ptr", + "desc": "数据的缓冲区。" + }, + { + "type": "size_t", + "name": "size", + "desc": "缓冲区大小。" + }, + { + "type": "size_t", + "name": "nitems", + "desc": "元素的个数。" + }, + { + "type": "rom_file_t*", + "name": "f", + "desc": "rom_file_t对象。" } ], "annotation": {}, - "desc": "遍历所有属性。", - "name": "object_foreach_prop", + "desc": "写文件。\n> 本函数什么也不做。", + "name": "rom_fwrite", "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" + "type": "size_t", + "desc": "返回实际写的字节数。" } }, { "params": [ { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - }, - { - "type": "const char*", - "name": "name", - "desc": "属性的名称。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "检查是否存在指定的属性。", - "name": "object_has_prop", - "return": { - "type": "bool_t", - "desc": "返回TRUE表示存在,否则表示不存在。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - }, - { - "type": "const char*", - "name": "expr", - "desc": "表达式。" - }, - { - "type": "value_t*", - "name": "v", - "desc": "返回计算结果。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "计算一个表达式,表达式中引用的变量从prop中获取。", - "name": "object_eval", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - }, - { - "type": "const char*", - "name": "name", - "desc": "命令的名称。" - }, - { - "type": "const char*", - "name": "args", - "desc": "命令的参数。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "检查是否可以执行指定的命令。", - "name": "object_can_exec", - "return": { - "type": "bool_t", - "desc": "返回TRUE表示可以执行,否则表示不可以执行。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - }, - { - "type": "const char*", - "name": "name", - "desc": "命令的名称。" - }, - { - "type": "const char*", - "name": "args", - "desc": "命令的参数。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "执行指定的命令。", - "name": "object_exec", - "alias": "execute", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "触发EVT_PROPS_CHANGED事件。", - "name": "object_notify_changed", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - }, - { - "type": "const char*", - "name": "path", - "desc": "属性的path,各级之间用.分隔。" - }, - { - "type": "value_t*", - "name": "v", - "desc": "返回属性的值。" + "type": "rom_file_t*", + "name": "f", + "desc": "rom_file_t对象。" } ], "annotation": {}, - "desc": "获取指定path属性的值。", - "name": "object_get_prop_by_path", + "desc": "关闭文件。", + "name": "rom_fclose", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - }, - { - "type": "const char*", - "name": "path", - "desc": "属性的path。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "获取指定属性的字符串类型的值。", - "name": "object_get_prop_str_by_path", - "return": { - "type": "const char*", - "desc": "返回指定属性的字符串类型的值。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - }, - { - "type": "const char*", - "name": "path", - "desc": "属性的path。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "获取指定属性的指针类型的值。", - "name": "object_get_prop_pointer_by_path", - "return": { - "type": "void*", - "desc": "返回指定属性的指针类型的值。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - }, - { - "type": "const char*", - "name": "path", - "desc": "属性的path。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "获取指定属性的object类型的值。", - "name": "object_get_prop_object_by_path", - "return": { - "type": "object_t*", - "desc": "返回指定属性的object类型的值。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - }, - { - "type": "const char*", - "name": "path", - "desc": "属性的path。" - }, - { - "type": "int32_t", - "name": "defval", - "desc": "缺省值。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "获取指定属性的整数类型的值。", - "name": "object_get_prop_int_by_path", - "return": { - "type": "int32_t", - "desc": "返回指定属性的整数类型的值。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - }, - { - "type": "const char*", - "name": "path", - "desc": "属性的path。" - }, - { - "type": "bool_t", - "name": "defval", - "desc": "缺省值。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "获取指定属性的bool类型的值。", - "name": "object_get_prop_bool_by_path", - "return": { - "type": "bool_t", - "desc": "返回指定属性的bool类型的值。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "object对象。" - }, - { - "type": "const char*", - "name": "path", - "desc": "属性的path。" - }, - { - "type": "float_t", - "name": "defval", - "desc": "缺省值。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "获取指定属性的浮点数类型的值。", - "name": "object_get_prop_float_by_path", - "return": { - "type": "float_t", - "desc": "返回指定属性的浮点数类型的值。" - } } ], "events": [], - "properties": [ - { - "name": "ref_count", - "desc": "引用计数。", - "type": "int32_t", - "annotation": { - "readable": true, - "scriptable": true - } - }, - { - "name": "name", - "desc": "对象的名称。", - "type": "char*", - "annotation": { - "readable": true, - "scriptable": true - } - } - ], - "header": "tkc/object.h", - "desc": "对象接口。", - "name": "object_t", - "order": -9, - "parent": "emitter_t", + "properties": [], + "header": "tkc/rom_fs.h", + "desc": "rom_file接口。\n\n> 主要用于给google pinyin输入提供兼容的文件系统API。\n\n示例:\n\n```c\nchar rbuff[100];\nsize_t len = 0;\nconst char* buff = \"hello world\";\nrom_file_t* f = rom_fopen_buff((const uint8_t*)buff, sizeof(buff));\nlen = rom_fread(rbuff, 2, 1, f);\nrom_fclose(f);\n```", + "name": "rom_t", "annotation": { - "scriptable": true - }, - "level": 2 - }, - { - "type": "enum", - "desc": "MIME_TYPE。", - "consts": [ - { - "desc": "\"application/envoy\"。", - "name": "MIME_TYPE_APPLICATION_ENVOY" - }, - { - "desc": "\"application/fractals\"。", - "name": "MIME_TYPE_APPLICATION_FRACTALS" - }, - { - "desc": "\"application/futuresplash\"。", - "name": "MIME_TYPE_APPLICATION_FUTURESPLASH" - }, - { - "desc": "\"application/hta\"。", - "name": "MIME_TYPE_APPLICATION_HTA" - }, - { - "desc": "\"application/json\"。", - "name": "MIME_TYPE_APPLICATION_JSON" - }, - { - "desc": "\"application/ubjson\"。", - "name": "MIME_TYPE_APPLICATION_UBJSON" - }, - { - "desc": "\"application/mac-binhex40\"。", - "name": "MIME_TYPE_APPLICATION_MAC_BINHEX40" - }, - { - "desc": "\"application/msword\"。", - "name": "MIME_TYPE_APPLICATION_MSWORD" - }, - { - "desc": "\"application/octet-stream\"。", - "name": "MIME_TYPE_APPLICATION_OCTET_STREAM" - }, - { - "desc": "\"application/oda\"。", - "name": "MIME_TYPE_APPLICATION_ODA" - }, - { - "desc": "\"application/olescript\"。", - "name": "MIME_TYPE_APPLICATION_OLESCRIPT" - }, - { - "desc": "\"application/pdf\"。", - "name": "MIME_TYPE_APPLICATION_PDF" - }, - { - "desc": "\"application/pics-rules\"。", - "name": "MIME_TYPE_APPLICATION_PICS_RULES" - }, - { - "desc": "\"application/pkcs10\"。", - "name": "MIME_TYPE_APPLICATION_PKCS10" - }, - { - "desc": "\"application/pkix-crl\"。", - "name": "MIME_TYPE_APPLICATION_PKIX_CRL" - }, - { - "desc": "\"application/postscript\"。", - "name": "MIME_TYPE_APPLICATION_POSTSCRIPT" - }, - { - "desc": "\"application/rtf\"。", - "name": "MIME_TYPE_APPLICATION_RTF" - }, - { - "desc": "\"application/vnd.ms-excel\"。", - "name": "MIME_TYPE_APPLICATION_VND_MS_EXCEL" - }, - { - "desc": "\"application/vnd.ms-outlook\"。", - "name": "MIME_TYPE_APPLICATION_VND_MS_OUTLOOK" - }, - { - "desc": "\"application/vnd.ms-pkicertstore\"。", - "name": "MIME_TYPE_APPLICATION_VND_MS_PKICERTSTORE" - }, - { - "desc": "\"application/vnd.ms-pkiseccat\"。", - "name": "MIME_TYPE_APPLICATION_VND_MS_PKISECCAT" - }, - { - "desc": "\"application/vnd.ms-pkistl\"。", - "name": "MIME_TYPE_APPLICATION_VND_MS_PKISTL" - }, - { - "desc": "\"application/vnd.ms-powerpoint\"。", - "name": "MIME_TYPE_APPLICATION_VND_MS_POWERPOINT" - }, - { - "desc": "\"application/vnd.ms-project\"。", - "name": "MIME_TYPE_APPLICATION_VND_MS_PROJECT" - }, - { - "desc": "\"application/vnd.ms-works\"。", - "name": "MIME_TYPE_APPLICATION_VND_MS_WORKS" - }, - { - "desc": "\"application/winhlp\"。", - "name": "MIME_TYPE_APPLICATION_WINHLP" - }, - { - "desc": "\"application/x-bcpio\"。", - "name": "MIME_TYPE_APPLICATION_X_BCPIO" - }, - { - "desc": "\"application/x-cdf\"。", - "name": "MIME_TYPE_APPLICATION_X_CDF" - }, - { - "desc": "\"application/x-compress\"。", - "name": "MIME_TYPE_APPLICATION_X_COMPRESS" - }, - { - "desc": "\"application/x-compressed\"。", - "name": "MIME_TYPE_APPLICATION_X_COMPRESSED" - }, - { - "desc": "\"application/x-cpio\"。", - "name": "MIME_TYPE_APPLICATION_X_CPIO" - }, - { - "desc": "\"application/x-csh\"。", - "name": "MIME_TYPE_APPLICATION_X_CSH" - }, - { - "desc": "\"application/x-director\"。", - "name": "MIME_TYPE_APPLICATION_X_DIRECTOR" - }, - { - "desc": "\"application/x-dvi\"。", - "name": "MIME_TYPE_APPLICATION_X_DVI" - }, - { - "desc": "\"application/x-gtar\"。", - "name": "MIME_TYPE_APPLICATION_X_GTAR" - }, - { - "desc": "\"application/x-gzip\"。", - "name": "MIME_TYPE_APPLICATION_X_GZIP" - }, - { - "desc": "\"application/x-hdf\"。", - "name": "MIME_TYPE_APPLICATION_X_HDF" - }, - { - "desc": "\"application/x-iphone\"。", - "name": "MIME_TYPE_APPLICATION_X_IPHONE" - }, - { - "desc": "\"application/x-javascript\"。", - "name": "MIME_TYPE_APPLICATION_X_JAVASCRIPT" - }, - { - "desc": "\"application/x-latex\"。", - "name": "MIME_TYPE_APPLICATION_X_LATEX" - }, - { - "desc": "\"application/x-msaccess\"。", - "name": "MIME_TYPE_APPLICATION_X_MSACCESS" - }, - { - "desc": "\"application/x-mscardfile\"。", - "name": "MIME_TYPE_APPLICATION_X_MSCARDFILE" - }, - { - "desc": "\"application/x-msclip\"。", - "name": "MIME_TYPE_APPLICATION_X_MSCLIP" - }, - { - "desc": "\"application/x-msdownload\"。", - "name": "MIME_TYPE_APPLICATION_X_MSDOWNLOAD" - }, - { - "desc": "\"application/x-msmediaview\"。", - "name": "MIME_TYPE_APPLICATION_X_MSMEDIAVIEW" - }, - { - "desc": "\"application/x-msmetafile\"。", - "name": "MIME_TYPE_APPLICATION_X_MSMETAFILE" - }, - { - "desc": "\"application/x-msmoney\"。", - "name": "MIME_TYPE_APPLICATION_X_MSMONEY" - }, - { - "desc": "\"application/x-mspublisher\"。", - "name": "MIME_TYPE_APPLICATION_X_MSPUBLISHER" - }, - { - "desc": "\"application/x-msschedule\"。", - "name": "MIME_TYPE_APPLICATION_X_MSSCHEDULE" - }, - { - "desc": "\"application/x-msterminal\"。", - "name": "MIME_TYPE_APPLICATION_X_MSTERMINAL" - }, - { - "desc": "\"application/x-mswrite\"。", - "name": "MIME_TYPE_APPLICATION_X_MSWRITE" - }, - { - "desc": "\"application/x-netcdf\"。", - "name": "MIME_TYPE_APPLICATION_X_NETCDF" - }, - { - "desc": "\"application/x-perfmon\"。", - "name": "MIME_TYPE_APPLICATION_X_PERFMON" - }, - { - "desc": "\"application/x-pkcs12\"。", - "name": "MIME_TYPE_APPLICATION_X_PKCS12" - }, - { - "desc": "\"application/x-sh\"。", - "name": "MIME_TYPE_APPLICATION_X_SH" - }, - { - "desc": "\"application/x-shar\"。", - "name": "MIME_TYPE_APPLICATION_X_SHAR" - }, - { - "desc": "\"application/x-shockwave-flash\"。", - "name": "MIME_TYPE_APPLICATION_X_SHOCKWAVE_FLASH" - }, - { - "desc": "\"application/x-stuffit\"。", - "name": "MIME_TYPE_APPLICATION_X_STUFFIT" - }, - { - "desc": "\"application/x-sv4cpio\"。", - "name": "MIME_TYPE_APPLICATION_X_SV4CPIO" - }, - { - "desc": "\"application/x-sv4crc\"。", - "name": "MIME_TYPE_APPLICATION_X_SV4CRC" - }, - { - "desc": "\"application/x-tar\"。", - "name": "MIME_TYPE_APPLICATION_X_TAR" - }, - { - "desc": "\"application/x-tcl\"。", - "name": "MIME_TYPE_APPLICATION_X_TCL" - }, - { - "desc": "\"application/x-tex\"。", - "name": "MIME_TYPE_APPLICATION_X_TEX" - }, - { - "desc": "\"application/x-texinfo\"。", - "name": "MIME_TYPE_APPLICATION_X_TEXINFO" - }, - { - "desc": "\"application/x-troff\"。", - "name": "MIME_TYPE_APPLICATION_X_TROFF" - }, - { - "desc": "\"application/x-ustar\"。", - "name": "MIME_TYPE_APPLICATION_X_USTAR" - }, - { - "desc": "\"application/zip\"。", - "name": "MIME_TYPE_APPLICATION_ZIP" - }, - { - "desc": "\"audio/basic\"。", - "name": "MIME_TYPE_AUDIO_BASIC" - }, - { - "desc": "\"audio/mid\"。", - "name": "MIME_TYPE_AUDIO_MID" - }, - { - "desc": "\"audio/mpeg\"。", - "name": "MIME_TYPE_AUDIO_MPEG" - }, - { - "desc": "\"audio/x-aiff\"。", - "name": "MIME_TYPE_AUDIO_X_AIFF" - }, - { - "desc": "\"audio/x-mpegurl\"。", - "name": "MIME_TYPE_AUDIO_X_MPEGURL" - }, - { - "desc": "\"audio/x-wav\"。", - "name": "MIME_TYPE_AUDIO_X_WAV" - }, - { - "desc": "\"image/bmp\"。", - "name": "MIME_TYPE_IMAGE_BMP" - }, - { - "desc": "\"image/cis-cod\"。", - "name": "MIME_TYPE_IMAGE_CIS_COD" - }, - { - "desc": "\"image/gif\"。", - "name": "MIME_TYPE_IMAGE_GIF" - }, - { - "desc": "\"image/ief\"。", - "name": "MIME_TYPE_IMAGE_IEF" - }, - { - "desc": "\"image/jpeg\"。", - "name": "MIME_TYPE_IMAGE_JPEG" - }, - { - "desc": "\"image/pipeg\"。", - "name": "MIME_TYPE_IMAGE_PIPEG" - }, - { - "desc": "\"image/svg+xml\"。", - "name": "MIME_TYPE_IMAGE_SVG_XML" - }, - { - "desc": "\"image/tiff\"。", - "name": "MIME_TYPE_IMAGE_TIFF" - }, - { - "desc": "\"image/x-cmx\"。", - "name": "MIME_TYPE_IMAGE_X_CMX" - }, - { - "desc": "\"image/x-icon\"。", - "name": "MIME_TYPE_IMAGE_X_ICON" - }, - { - "desc": "\"image/x-rgb\"。", - "name": "MIME_TYPE_IMAGE_X_RGB" - }, - { - "desc": "\"image/x-xbitmap\"。", - "name": "MIME_TYPE_IMAGE_X_XBITMAP" - }, - { - "desc": "\"image/x-xpixmap\"。", - "name": "MIME_TYPE_IMAGE_X_XPIXMAP" - }, - { - "desc": "\"image/x-xwindowdump\"。", - "name": "MIME_TYPE_IMAGE_X_XWINDOWDUMP" - }, - { - "desc": "\"message/rfc822\"。", - "name": "MIME_TYPE_MESSAGE_RFC822" - }, - { - "desc": "\"text/css\"。", - "name": "MIME_TYPE_TEXT_CSS" - }, - { - "desc": "\"text/h323\"。", - "name": "MIME_TYPE_TEXT_H323" - }, - { - "desc": "\"text/html\"。", - "name": "MIME_TYPE_TEXT_HTML" - }, - { - "desc": "\"text/iuls\"。", - "name": "MIME_TYPE_TEXT_IULS" - }, - { - "desc": "\"text/plain\"。", - "name": "MIME_TYPE_TEXT_PLAIN" - }, - { - "desc": "\"text/richtext\"。", - "name": "MIME_TYPE_TEXT_RICHTEXT" - }, - { - "desc": "\"text/scriptlet\"。", - "name": "MIME_TYPE_TEXT_SCRIPTLET" - }, - { - "desc": "\"text/webviewhtml\"。", - "name": "MIME_TYPE_TEXT_WEBVIEWHTML" - }, - { - "desc": "\"text/x-component\"。", - "name": "MIME_TYPE_TEXT_X_COMPONENT" - }, - { - "desc": "\"text/x-setext\"。", - "name": "MIME_TYPE_TEXT_X_SETEXT" - }, - { - "desc": "\"text/x-vcard\"。", - "name": "MIME_TYPE_TEXT_X_VCARD" - }, - { - "desc": "\"video/mpeg\"。", - "name": "MIME_TYPE_VIDEO_MPEG" - }, - { - "desc": "\"video/quicktime\"。", - "name": "MIME_TYPE_VIDEO_QUICKTIME" - }, - { - "desc": "\"video/x-msvideo\"。", - "name": "MIME_TYPE_VIDEO_X_MSVIDEO" - } - ], - "header": "tkc/mime_types.h", - "name": "MIME_TYPE", - "prefix": "MIME_TYPE_", - "annotation": { - "scriptable": true, - "string": true + "fake": true }, "level": 1 }, @@ -6385,76 +6155,268 @@ "level": 1 }, { - "params": [ + "type": "class", + "methods": [ { - "type": "const wchar_t*", - "name": "s", - "desc": "串地址。" + "params": [ + { + "type": "conf_node_t*", + "name": "node", + "desc": "节点对象。" + } + ], + "annotation": {}, + "desc": "获得节点的名称。", + "name": "conf_node_get_name", + "return": { + "type": "const char*", + "desc": "返回节点名称。" + } + }, + { + "params": [ + { + "type": "conf_node_t*", + "name": "node", + "desc": "节点对象。" + }, + { + "type": "const char*", + "name": "name", + "desc": "节点名称。" + } + ], + "annotation": {}, + "desc": "查找指定名称的子节点。", + "name": "conf_node_find_child", + "return": { + "type": "conf_node_t*", + "desc": "返回节点对象。" + } + }, + { + "params": [ + { + "type": "conf_node_t*", + "name": "node", + "desc": "节点对象。" + }, + { + "type": "const char*", + "name": "name", + "desc": "节点名称。" + } + ], + "annotation": {}, + "desc": "查找指定名称的兄弟节点。", + "name": "conf_node_find_sibling", + "return": { + "type": "conf_node_t*", + "desc": "返回节点对象。" + } + }, + { + "params": [ + { + "type": "conf_node_t*", + "name": "node", + "desc": "节点对象。" + }, + { + "type": "const value_t*", + "name": "v", + "desc": "值。" + } + ], + "annotation": {}, + "desc": "设置节点的值。", + "name": "conf_node_set_value", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "conf_node_t*", + "name": "node", + "desc": "节点对象。" + }, + { + "type": "value_t*", + "name": "v", + "desc": "值(返回)。" + } + ], + "annotation": {}, + "desc": "设置节点的值。", + "name": "conf_node_get_value", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "conf_node_t*", + "name": "node", + "desc": "节点对象。" + } + ], + "annotation": {}, + "desc": "获取第一个子节点。", + "name": "conf_node_get_first_child", + "return": { + "type": "conf_node_t*", + "desc": "返回第一个子节点。" + } + }, + { + "params": [ + { + "type": "conf_node_t*", + "name": "node", + "desc": "节点对象。" + }, + { + "type": "conf_node_t*", + "name": "child", + "desc": "子节点对象。" + } + ], + "annotation": {}, + "desc": "设置第一个子节点。", + "name": "conf_node_set_first_child", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } } ], - "annotation": { - "global": true - }, - "desc": "获取字符串长度。", - "name": "wcs_len", - "return": { - "type": "size_t", - "desc": "返回串长度'\\0'结尾。" - }, - "type": "method", - "header": "tkc/wstr.h", + "events": [], + "properties": [ + { + "name": "next", + "desc": "下一个兄弟节点。", + "type": "conf_node_t*" + }, + { + "name": "parent", + "desc": "父节点。", + "type": "conf_node_t*" + }, + { + "name": "value_type", + "desc": "值的类型。", + "type": "uint8_t" + }, + { + "name": "node_type", + "desc": "节点类型。", + "type": "uint8_t" + } + ], + "header": "conf_io/conf_node.h", + "desc": "节点。", + "name": "conf_node_t", "level": 1 }, { - "params": [ + "type": "enum", + "desc": "节点值得类型。", + "consts": [ { - "type": "const wchar_t*", - "name": "s1", - "desc": "目标串。" + "desc": "无效类型。", + "name": "CONF_NODE_VALUE_NONE" }, { - "type": "const wchar_t*", - "name": "s2", - "desc": "源串。" + "desc": "bool_t类型。", + "name": "CONF_NODE_VALUE_BOOL" + }, + { + "desc": "int8_t类型。", + "name": "CONF_NODE_VALUE_INT8" + }, + { + "desc": "uint8_t类型。", + "name": "CONF_NODE_VALUE_UINT8" + }, + { + "desc": "int16_t类型。", + "name": "CONF_NODE_VALUE_INT16" + }, + { + "desc": "uint16_t类型。", + "name": "CONF_NODE_VALUE_UINT16" + }, + { + "desc": "int32_t类型。", + "name": "CONF_NODE_VALUE_INT32" + }, + { + "desc": "uint32_t类型。", + "name": "CONF_NODE_VALUE_UINT32" + }, + { + "desc": "int64_t类型。", + "name": "CONF_NODE_VALUE_INT64" + }, + { + "desc": "uint64_t类型。", + "name": "CONF_NODE_VALUE_UINT64" + }, + { + "desc": "float类型。", + "name": "CONF_NODE_VALUE_FLOAT32" + }, + { + "desc": "double类型。", + "name": "CONF_NODE_VALUE_DOUBLE" + }, + { + "desc": "字符串类型。", + "name": "CONF_NODE_VALUE_STRING" + }, + { + "desc": "短字符(len<=7)串类型。", + "name": "CONF_NODE_VALUE_SMALL_STR" + }, + { + "desc": "节点类型。", + "name": "CONF_NODE_VALUE_NODE" } ], - "annotation": { - "global": true - }, - "desc": "比较字符串", - "name": "wcs_cmp", - "return": { - "type": "int", - "desc": "小于0表示s1s2。" - }, - "type": "method", - "header": "tkc/wstr.h", + "header": "conf_io/conf_node.h", + "name": "conf_node_value_t", + "prefix": "CONF_NODE_VALUE_", "level": 1 }, { - "params": [ + "type": "enum", + "desc": "节点类型。", + "consts": [ { - "type": "wchar_t*", - "name": "s1", - "desc": "目标串。" + "desc": "无效节点。", + "name": "CONF_NODE_NONE" }, { - "type": "const wchar_t*", - "name": "s2", - "desc": "源串。" + "desc": "对象节点。", + "name": "CONF_NODE_OBJECT" + }, + { + "desc": "数组节点。", + "name": "CONF_NODE_ARRAY" + }, + { + "desc": "简单节点。", + "name": "CONF_NODE_SIMPLE" } ], - "annotation": { - "global": true - }, - "desc": "复制字符串", - "name": "wcs_cpy", - "return": { - "type": "const wchar_t*", - "desc": "复制后的串地址。" - }, - "type": "method", - "header": "tkc/wstr.h", + "header": "conf_io/conf_node.h", + "name": "conf_node_type_t", + "prefix": "CONF_NODE_", "level": 1 }, { @@ -6611,304 +6573,62 @@ "name": "event_source_manager_t", "level": 1 }, - { - "params": [ - { - "type": "const wchar_t*", - "name": "s", - "desc": "wchar_t*。" - }, - { - "type": "wchar_t", - "name": "c", - "desc": "wchar_t。" - } - ], - "annotation": { - "global": true - }, - "desc": "查找字符位置", - "name": "wcs_chr", - "return": { - "type": "const wchar_t*", - "desc": "返回找到c的地址。" - }, - "type": "method", - "header": "tkc/wstr.h", - "level": 1 - }, { "type": "class", "methods": [ { "params": [ - { - "type": "wstr_t*", - "name": "str", - "desc": "str对象。" - }, { "type": "uint32_t", - "name": "capacity", - "desc": "初始容量。" - } - ], - "annotation": { - "constructor": true - }, - "desc": "初始化字符串对象。", - "name": "wstr_init", - "return": { - "type": "wstr_t*", - "desc": "str对象本身。" - } - }, - { - "params": [ - { - "type": "wstr_t*", - "name": "str", - "desc": "str对象。" - }, - { - "type": "wchar_t*", - "name": "text", - "desc": "要设置的字符串。" + "name": "prealloc_nodes_nr", + "desc": "预先分配的节点数。" } ], "annotation": {}, - "desc": "设置字符串。", - "name": "wstr_set", + "desc": "构造函数。", + "name": "conf_doc_create", "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" + "type": "conf_doc_t*", + "desc": "返回doc对象。" } }, { "params": [ { - "type": "wstr_t*", - "name": "str", - "desc": "str对象。" - } - ], - "annotation": {}, - "desc": "清除字符串内容。", - "name": "wstr_clear", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "wstr_t*", - "name": "str", - "desc": "str对象。" - }, - { - "type": "char*", - "name": "text", - "desc": "要设置的字符串。" - } - ], - "annotation": {}, - "desc": "设置UTF8字符串。", - "name": "wstr_set_utf8", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "wstr_t*", - "name": "str", - "desc": "str对象。" - }, - { - "type": "char*", - "name": "text", - "desc": "返回的字符串。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "text最大长度。" - } - ], - "annotation": {}, - "desc": "获取UTF8字符串。", - "name": "wstr_get_utf8", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "wstr_t*", - "name": "str", - "desc": "str对象。" - }, - { - "type": "uint32_t", - "name": "offset", - "desc": "指定的位置。" - }, - { - "type": "uint32_t", - "name": "nr", - "desc": "要删除的字符数。" - } - ], - "annotation": {}, - "desc": "删除指定范围的字符。", - "name": "wstr_remove", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "wstr_t*", - "name": "str", - "desc": "str对象。" - }, - { - "type": "uint32_t", - "name": "offset", - "desc": "指定的位置。" - }, - { - "type": "wchar_t*", - "name": "text", - "desc": "待插入的文本。" - }, - { - "type": "uint32_t", - "name": "nr", - "desc": "要插入的字符数。" - } - ], - "annotation": {}, - "desc": "在指定位置插入字符串。", - "name": "wstr_insert", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "wstr_t*", - "name": "str", - "desc": "str对象。" - }, - { - "type": "wchar_t*", - "name": "text", - "desc": "要追加的字符串。" - } - ], - "annotation": {}, - "desc": "追加字符串。", - "name": "wstr_append", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "wstr_t*", - "name": "str", - "desc": "str对象。" - }, - { - "type": "wchar_t*", - "name": "text", - "desc": "要追加的字符串。" - }, - { - "type": "uint32_t", - "name": "len", - "desc": "字符串长度。" - } - ], - "annotation": {}, - "desc": "追加字符串。", - "name": "wstr_append_with_len", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "wstr_t*", - "name": "str", - "desc": "str对象。" - }, - { - "type": "wchar_t", - "name": "c", - "desc": "字符。" - } - ], - "annotation": {}, - "desc": "追加一个字符。", - "name": "wstr_push", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "wstr_t*", - "name": "str", - "desc": "str对象。" - } - ], - "annotation": {}, - "desc": "删除尾部字符。", - "name": "wstr_pop", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "wstr_t*", - "name": "str", - "desc": "str对象。" + "type": "conf_doc_t*", + "name": "doc", + "desc": "文档对象。" }, { "type": "const char*", - "name": "format", - "desc": "格式(用于snprintf格式化数值)" - }, - { - "type": "int32_t", - "name": "value", - "desc": "数值。" + "name": "name", + "desc": "节点名称。" } ], "annotation": {}, - "desc": "追加一个整数。", - "name": "wstr_push_int", + "desc": "创建一个空节点。", + "name": "conf_doc_create_node", + "return": { + "type": "conf_node_t*", + "desc": "返回节点对象。" + } + }, + { + "params": [ + { + "type": "conf_doc_t*", + "name": "doc", + "desc": "文档对象。" + }, + { + "type": "conf_node_t*", + "name": "node", + "desc": "节点对象。" + } + ], + "annotation": {}, + "desc": "销毁节点对象。", + "name": "conf_doc_destroy_node", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" @@ -6917,40 +6637,430 @@ { "params": [ { - "type": "wstr_t*", - "name": "str", - "desc": "str对象。" + "type": "conf_doc_t*", + "name": "doc", + "desc": "文档对象。" }, { - "type": "wstr_t*", - "name": "other", - "desc": "str对象。" + "type": "conf_node_t*", + "name": "node", + "desc": "节点对象。" + }, + { + "type": "conf_node_t*", + "name": "sibling", + "desc": "待追加节点对象。" } ], "annotation": {}, - "desc": "判断两个字符是否相同。", - "name": "wstr_equal", + "desc": "追加一个兄弟节点。", + "name": "conf_doc_append_sibling", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "conf_doc_t*", + "name": "doc", + "desc": "文档对象。" + }, + { + "type": "conf_node_t*", + "name": "node", + "desc": "节点对象。" + }, + { + "type": "conf_node_t*", + "name": "child", + "desc": "待追加节点对象。" + } + ], + "annotation": {}, + "desc": "追加一个子节点。", + "name": "conf_doc_append_child", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "conf_doc_t*", + "name": "doc", + "desc": "文档对象。" + }, + { + "type": "conf_node_t*", + "name": "node", + "desc": "节点对象。" + }, + { + "type": "conf_node_t*", + "name": "sibling", + "desc": "待删除节点对象。" + } + ], + "annotation": {}, + "desc": "删除指定的兄弟节点。", + "name": "conf_doc_remove_sibling", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "conf_doc_t*", + "name": "doc", + "desc": "文档对象。" + }, + { + "type": "conf_node_t*", + "name": "node", + "desc": "节点对象。" + }, + { + "type": "conf_node_t*", + "name": "child", + "desc": "待删除节点对象。" + } + ], + "annotation": {}, + "desc": "删除指定的子节点。", + "name": "conf_doc_remove_child", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "conf_doc_t*", + "name": "doc", + "desc": "文档对象。" + }, + { + "type": "conf_node_t*", + "name": "node", + "desc": "节点对象。" + }, + { + "type": "const char*", + "name": "name", + "desc": "待删除节点的名称。" + } + ], + "annotation": {}, + "desc": "删除指定的子节点。", + "name": "conf_doc_remove_child_by_name", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "conf_doc_t*", + "name": "doc", + "desc": "文档对象。" + }, + { + "type": "conf_node_t*", + "name": "node", + "desc": "节点对象。" + } + ], + "annotation": {}, + "desc": "删除全部子节点。", + "name": "conf_doc_remove_children", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "conf_doc_t*", + "name": "doc", + "desc": "文档对象。" + }, + { + "type": "const char*", + "name": "path", + "desc": "节点的路径。" + }, + { + "type": "const value_t*", + "name": "v", + "desc": "值。" + } + ], + "annotation": {}, + "desc": "设置指定路径节点的值。", + "name": "conf_doc_set", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "conf_doc_t*", + "name": "doc", + "desc": "文档对象。" + }, + { + "type": "const char*", + "name": "path", + "desc": "节点的路径。" + }, + { + "type": "int32_t", + "name": "v", + "desc": "值。" + } + ], + "annotation": {}, + "desc": "设置指定路径节点的值。", + "name": "conf_doc_set_int", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "conf_doc_t*", + "name": "doc", + "desc": "文档对象。" + }, + { + "type": "const char*", + "name": "path", + "desc": "节点的路径。" + }, + { + "type": "bool_t", + "name": "v", + "desc": "值。" + } + ], + "annotation": {}, + "desc": "设置指定路径节点的值。", + "name": "conf_doc_set_bool", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "conf_doc_t*", + "name": "doc", + "desc": "文档对象。" + }, + { + "type": "const char*", + "name": "path", + "desc": "节点的路径。" + }, + { + "type": "float", + "name": "v", + "desc": "值。" + } + ], + "annotation": {}, + "desc": "设置指定路径节点的值。", + "name": "conf_doc_set_float", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "conf_doc_t*", + "name": "doc", + "desc": "文档对象。" + }, + { + "type": "const char*", + "name": "path", + "desc": "节点的路径。" + }, + { + "type": "const char*", + "name": "v", + "desc": "值。" + } + ], + "annotation": {}, + "desc": "设置指定路径节点的值。", + "name": "conf_doc_set_str", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "conf_doc_t*", + "name": "doc", + "desc": "文档对象。" + }, + { + "type": "const char*", + "name": "path", + "desc": "节点的路径。" + }, + { + "type": "value_t*", + "name": "v", + "desc": "用于返回值。" + } + ], + "annotation": {}, + "desc": "获取指定路径节点的值。", + "name": "conf_doc_get", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "conf_doc_t*", + "name": "doc", + "desc": "文档对象。" + }, + { + "type": "const char*", + "name": "path", + "desc": "节点的路径。" + }, + { + "type": "int32_t", + "name": "defval", + "desc": "缺省值。" + } + ], + "annotation": {}, + "desc": "获取指定路径节点的值。", + "name": "conf_doc_get_int", + "return": { + "type": "int32_t", + "desc": "返回值。" + } + }, + { + "params": [ + { + "type": "conf_doc_t*", + "name": "doc", + "desc": "文档对象。" + }, + { + "type": "const char*", + "name": "path", + "desc": "节点的路径。" + }, + { + "type": "bool_t", + "name": "defval", + "desc": "缺省值。" + } + ], + "annotation": {}, + "desc": "获取指定路径节点的值。", + "name": "conf_doc_get_bool", "return": { "type": "bool_t", - "desc": "返回TRUE表示相同,否则表示不同。" + "desc": "返回值。" } }, { "params": [ { - "type": "wstr_t*", - "name": "str", - "desc": "str对象。" + "type": "conf_doc_t*", + "name": "doc", + "desc": "文档对象。" }, { - "type": "int32_t", - "name": "v", - "desc": "整数。" + "type": "const char*", + "name": "path", + "desc": "节点的路径。" + }, + { + "type": "float", + "name": "defval", + "desc": "缺省值。" } ], "annotation": {}, - "desc": "用整数初始化字符串。", - "name": "wstr_from_int", + "desc": "获取指定路径节点的值。", + "name": "conf_doc_get_float", + "return": { + "type": "float", + "desc": "返回值。" + } + }, + { + "params": [ + { + "type": "conf_doc_t*", + "name": "doc", + "desc": "文档对象。" + }, + { + "type": "const char*", + "name": "path", + "desc": "节点的路径。" + }, + { + "type": "const char*", + "name": "defval", + "desc": "缺省值。" + } + ], + "annotation": {}, + "desc": "获取指定路径节点的值。", + "name": "conf_doc_get_str", + "return": { + "type": "const char*", + "desc": "返回值。" + } + }, + { + "params": [ + { + "type": "conf_doc_t*", + "name": "doc", + "desc": "文档对象。" + }, + { + "type": "const char*", + "name": "path", + "desc": "节点的路径。" + } + ], + "annotation": {}, + "desc": "删除指定路径的节点。", + "name": "conf_doc_remove", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" @@ -6959,19 +7069,19 @@ { "params": [ { - "type": "wstr_t*", - "name": "str", - "desc": "str对象。" + "type": "conf_doc_t*", + "name": "doc", + "desc": "文档对象。" }, { - "type": "double", - "name": "v", - "desc": "浮点数。" + "type": "const char*", + "name": "path", + "desc": "节点的路径。" } ], "annotation": {}, - "desc": "用浮点数初始化字符串。", - "name": "wstr_from_float", + "desc": "删除指定路径的节点的全部子节点。", + "name": "conf_doc_clear", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" @@ -6980,19 +7090,19 @@ { "params": [ { - "type": "wstr_t*", - "name": "str", - "desc": "str对象。" + "type": "conf_doc_t*", + "name": "doc", + "desc": "文档对象。" }, { - "type": "value_t", - "name": "v", - "desc": "value。" + "type": "const char*", + "name": "path", + "desc": "节点的路径。" } ], "annotation": {}, - "desc": "用value初始化字符串。", - "name": "wstr_from_value", + "desc": "和前一个兄弟节点交换位置。", + "name": "conf_doc_move_up", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" @@ -7001,19 +7111,19 @@ { "params": [ { - "type": "wstr_t*", - "name": "str", - "desc": "str对象。" + "type": "conf_doc_t*", + "name": "doc", + "desc": "文档对象。" }, { - "type": "int32_t*", - "name": "v", - "desc": "用于返回整数。" + "type": "const char*", + "name": "path", + "desc": "节点的路径。" } ], "annotation": {}, - "desc": "将字符串转成整数。", - "name": "wstr_to_int", + "desc": "和后一个兄弟节点交换位置。", + "name": "conf_doc_move_down", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" @@ -7022,19 +7132,82 @@ { "params": [ { - "type": "wstr_t*", - "name": "str", - "desc": "str对象。" + "type": "conf_doc_t*", + "name": "doc", + "desc": "文档对象。" }, { - "type": "double*", - "name": "v", - "desc": "用于返回浮点数。" + "type": "const char*", + "name": "path", + "desc": "节点的路径。" } ], "annotation": {}, - "desc": "将字符串转成浮点数。", - "name": "wstr_to_float", + "desc": "判断指定路径的节点是否存在。", + "name": "conf_doc_exists", + "return": { + "type": "bool_t", + "desc": "返回TRUE表示成功,FALSE表示失败。" + } + }, + { + "params": [ + { + "type": "conf_doc_t*", + "name": "doc", + "desc": "文档对象。" + }, + { + "type": "const char*", + "name": "path", + "desc": "节点的路径。" + } + ], + "annotation": {}, + "desc": "检查指定节点是否在兄弟节点中排第一。", + "name": "conf_doc_is_first", + "return": { + "type": "bool_t", + "desc": "返回TRUE表示是,否则表示不是。" + } + }, + { + "params": [ + { + "type": "conf_doc_t*", + "name": "doc", + "desc": "文档对象。" + }, + { + "type": "const char*", + "name": "path", + "desc": "节点的路径。" + } + ], + "annotation": {}, + "desc": "检查指定节点是否在兄弟节点中排最后。", + "name": "conf_doc_is_last", + "return": { + "type": "bool_t", + "desc": "返回TRUE表示是,否则表示不是。" + } + }, + { + "params": [ + { + "type": "conf_doc_t*", + "name": "doc", + "desc": "文档对象。" + }, + { + "type": "const char*", + "name": "path", + "desc": "节点的路径。" + } + ], + "annotation": {}, + "desc": "追加一个子节点。", + "name": "conf_doc_add_child", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" @@ -7043,93 +7216,14 @@ { "params": [ { - "type": "wstr_t*", - "name": "str", - "desc": "str对象。" - }, - { - "type": "double", - "name": "delta", - "desc": "要加上的值。" + "type": "conf_doc_t*", + "name": "doc", + "desc": "文档对象。" } ], "annotation": {}, - "desc": "将字符串转成浮点数,加上delta,再转换回来。", - "name": "wstr_add_float", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "wstr_t*", - "name": "str", - "desc": "str对象。" - } - ], - "annotation": {}, - "desc": "去掉浮点数小数点尾部的零。", - "name": "wstr_trim_float_zero", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "wstr_t*", - "name": "str", - "desc": "str对象。" - }, - { - "type": "wchar_t", - "name": "newline", - "desc": "换行符。" - } - ], - "annotation": {}, - "desc": "规范化换行符。", - "name": "wstr_normalize_newline", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "wstr_t*", - "name": "str", - "desc": "str对象。" - }, - { - "type": "wchar_t", - "name": "c", - "desc": "字符。" - } - ], - "annotation": {}, - "desc": "统计指定字符的个数。", - "name": "wstr_count_char", - "return": { - "type": "uint32_t", - "desc": "返回指定字符的个数。" - } - }, - { - "params": [ - { - "type": "wstr_t*", - "name": "str", - "desc": "str对象。" - } - ], - "annotation": {}, - "desc": "重置字符串为空。", - "name": "wstr_reset", + "desc": "析构函数。", + "name": "conf_doc_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" @@ -7139,33 +7233,40 @@ "events": [], "properties": [ { - "name": "size", - "desc": "长度。", - "type": "uint32_t", - "annotation": { - "readable": true - } - }, - { - "name": "capacity", - "desc": "容量。", - "type": "uint32_t", - "annotation": { - "readable": true - } - }, - { - "name": "str", - "desc": "字符串。", - "type": "wchar_t*", - "annotation": { - "readable": true - } + "name": "root", + "desc": "根节点。", + "type": "conf_node_t*" } ], - "header": "tkc/wstr.h", - "desc": "可变长度的宽字符字符串。\n\n示例:\n\n```c\nwstr_t s;\nwstr_init(&s, 0);\n\nwstr_append(&s, L\"abc\");\nwstr_append(&s, L\"123\");\n\nwstr_reset(&s);\n```\n> 先调wstr\\_init进行初始化,最后调用wstr\\_reset释放内存。", - "name": "wstr_t", + "header": "conf_io/conf_node.h", + "desc": "代表整个配置文件。", + "name": "conf_doc_t", + "level": 1 + }, + { + "params": [ + { + "type": "conf_doc_t*", + "name": "doc", + "desc": "doc对象。" + }, + { + "type": "str_t*", + "name": "str", + "desc": "返回结果的字符串对象。" + } + ], + "annotation": { + "global": true + }, + "desc": "", + "name": "conf_doc_save_json", + "return": { + "type": "object_t*", + "desc": "返回配置对象。" + }, + "type": "method", + "header": "conf_io/conf_json.h", "level": 1 }, { @@ -7282,160 +7383,127 @@ }, "level": 1 }, + { + "params": [ + { + "type": "const char*", + "name": "data", + "desc": "JSON数据。" + }, + { + "type": "int32_t", + "name": "size", + "desc": "JSON数据长度。" + } + ], + "annotation": { + "global": true + }, + "desc": "", + "name": "conf_doc_load_json", + "return": { + "type": "conf_doc_t*", + "desc": "返回doc对象。" + }, + "type": "method", + "header": "conf_io/conf_json.h", + "level": 1 + }, { "type": "class", "methods": [ { "params": [ { - "type": "uint32_t", - "name": "capacity", - "desc": "容量。" - }, - { - "type": "uint32_t", - "name": "block_size", - "desc": "块的大小。" + "type": "object_t*", + "name": "", + "desc": "。" } ], "annotation": { - "constructor": true + "static": true }, - "desc": "创建waitable_ring_buffer对象。", - "name": "waitable_ring_buffer_create", + "desc": "设置app_conf实例。", + "name": "app_conf_set_instance", "return": { - "type": "waitable_ring_buffer_t*", - "desc": "waitable_ring_buffer对象。" + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [], + "annotation": { + "static": true + }, + "desc": "获取app_conf实例。", + "name": "app_conf_get_instance", + "return": { + "type": "object_t*", + "desc": "返回app_conf实例。" + } + }, + { + "params": [], + "annotation": { + "static": true, + "scriptable": true + }, + "desc": "持久保存配置。", + "name": "app_conf_save", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [], + "annotation": { + "static": true, + "scriptable": true + }, + "desc": "重新加载配置(内存中的配置丢失)。", + "name": "app_conf_reload", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { - "type": "waitable_ring_buffer_t*", - "name": "rb", - "desc": "waitable_ring_buffer对象。" + "type": "event_func_t", + "name": "on_event", + "desc": "事件处理函数。" }, { "type": "void*", - "name": "buff", - "desc": "接收数据的buff。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "读取数据的长度(必须等于 block_size)。" - }, - { - "type": "uint32_t", - "name": "timeout_ms", - "desc": "超时时间(ms)" - } - ], - "annotation": {}, - "desc": "读取数据。", - "name": "waitable_ring_buffer_read", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "waitable_ring_buffer_t*", - "name": "rb", - "desc": "waitable_ring_buffer对象。" - }, - { - "type": "const void*", - "name": "buff", - "desc": "要写入的数据。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "数据的长度(必须等于 block_size)。" - }, - { - "type": "uint32_t", - "name": "timeout_ms", - "desc": "超时时间(ms)" - } - ], - "annotation": {}, - "desc": "写入数据。", - "name": "waitable_ring_buffer_write", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "waitable_ring_buffer_t*", - "name": "rb", - "desc": "waitable_ring_buffer对象。" - } - ], - "annotation": {}, - "desc": "销毁。", - "name": "waitable_ring_buffer_destroy", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - } - ], - "events": [], - "properties": [], - "header": "tkc/waitable_ring_buffer.h", - "desc": "waitable ring buffer", - "name": "waitable_ring_buffer_t", - "level": 1 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "uint32_t", - "name": "capacity", - "desc": "action的容量。" + "name": "ctx", + "desc": "事件处理函数上下文。" } ], "annotation": { - "constructor": true + "static": true }, - "desc": "创建waitable_action_queue对象。", - "name": "waitable_action_queue_create", + "desc": "注册配置变化事件。", + "name": "app_conf_on_changed", "return": { - "type": "waitable_action_queue_t*", - "desc": "waitable_action_queue对象。" + "type": "uint32_t", + "desc": "返回id,用于app_conf_off_changed。" } }, { "params": [ - { - "type": "waitable_action_queue_t*", - "name": "q", - "desc": "waitable_action_queue对象。" - }, - { - "type": "qaction_t**", - "name": "action", - "desc": "用于返回action对象。" - }, { "type": "uint32_t", - "name": "timeout_ms", - "desc": "超时时间(ms)" + "name": "id", + "desc": "app_conf_on_changed返回的ID。" } ], - "annotation": {}, - "desc": "接收一个请求。", - "name": "waitable_action_queue_recv", + "annotation": { + "static": true + }, + "desc": "注销配置变化事件。", + "name": "app_conf_off_changed", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" @@ -7444,24 +7512,29 @@ { "params": [ { - "type": "waitable_action_queue_t*", - "name": "q", - "desc": "waitable_action_queue对象。" - }, - { - "type": "qaction_t*", - "name": "action", - "desc": "action对象。" - }, - { - "type": "uint32_t", - "name": "timeout_ms", - "desc": "超时时间(ms)" + "type": "void*", + "name": "ctx", + "desc": "事件处理函数上下文。" } ], - "annotation": {}, - "desc": "发送一个请求。", - "name": "waitable_action_queue_send", + "annotation": { + "static": true + }, + "desc": "注销配置变化事件。", + "name": "app_conf_off_changed_by_ctx", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [], + "annotation": { + "static": true, + "scriptable": true + }, + "desc": "释放conf对象。", + "name": "app_conf_deinit", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" @@ -7470,14 +7543,373 @@ { "params": [ { - "type": "waitable_action_queue_t*", - "name": "q", - "desc": "waitable_action_queue对象。" + "type": "const char*", + "name": "key", + "desc": "配置项的名称。" + }, + { + "type": "const value_t*", + "name": "v", + "desc": "配置项的值。" } ], - "annotation": {}, - "desc": "销毁。", - "name": "waitable_action_queue_destroy", + "annotation": { + "static": true + }, + "desc": "设置配置项的值。", + "name": "app_conf_set", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "key", + "desc": "配置项的名称。" + }, + { + "type": "value_t*", + "name": "v", + "desc": "配置项的值(用于返回)。" + } + ], + "annotation": { + "static": true + }, + "desc": "获取配置项的值。", + "name": "app_conf_get", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "key", + "desc": "配置项的名称。" + } + ], + "annotation": { + "static": true, + "scriptable": true + }, + "desc": "检查配置项是否存在。", + "name": "app_conf_exist", + "return": { + "type": "bool_t", + "desc": "返回TRUE表示存在,FALSE表示不存在。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "key", + "desc": "配置项的名称。" + }, + { + "type": "int32_t", + "name": "v", + "desc": "配置项的值。" + } + ], + "annotation": { + "static": true, + "scriptable": true + }, + "desc": "设置整数类型配置项的值。", + "name": "app_conf_set_int", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "key", + "desc": "配置项的名称。" + }, + { + "type": "int64_t", + "name": "v", + "desc": "配置项的值。" + } + ], + "annotation": { + "static": true, + "scriptable": true + }, + "desc": "设置64位整数类型配置项的值。", + "name": "app_conf_set_int64", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "key", + "desc": "配置项的名称。" + }, + { + "type": "bool_t", + "name": "v", + "desc": "配置项的值。" + } + ], + "annotation": { + "static": true, + "scriptable": true + }, + "desc": "设置bool类型配置项的值。", + "name": "app_conf_set_bool", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "key", + "desc": "配置项的名称。" + }, + { + "type": "double", + "name": "v", + "desc": "配置项的值。" + } + ], + "annotation": { + "static": true, + "scriptable": true + }, + "desc": "设置双精度类型配置项的值。", + "name": "app_conf_set_double", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "key", + "desc": "配置项的名称。" + }, + { + "type": "const char*", + "name": "v", + "desc": "配置项的值。" + } + ], + "annotation": { + "static": true, + "scriptable": true + }, + "desc": "设置字符串类型配置项的值。", + "name": "app_conf_set_str", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "key", + "desc": "配置项的名称。" + }, + { + "type": "const wchar_t*", + "name": "v", + "desc": "配置项的值。" + } + ], + "annotation": { + "static": true + }, + "desc": "设置宽字符串类型配置项的值。", + "name": "app_conf_set_wstr", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "key", + "desc": "配置项的名称。" + }, + { + "type": "int32_t", + "name": "defval", + "desc": "缺省值。" + } + ], + "annotation": { + "static": true, + "scriptable": true + }, + "desc": "获取整数类型配置项的值。", + "name": "app_conf_get_int", + "return": { + "type": "int32_t", + "desc": "返回配置项的值(如果不存在返回缺省值)。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "key", + "desc": "配置项的名称。" + }, + { + "type": "int64_t", + "name": "defval", + "desc": "缺省值。" + } + ], + "annotation": { + "static": true, + "scriptable": true + }, + "desc": "获取64位整数类型配置项的值。", + "name": "app_conf_get_int64", + "return": { + "type": "int64_t", + "desc": "返回配置项的值(如果不存在返回缺省值)。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "key", + "desc": "配置项的名称。" + }, + { + "type": "bool_t", + "name": "defval", + "desc": "缺省值。" + } + ], + "annotation": { + "static": true, + "scriptable": true + }, + "desc": "获取bool类型配置项的值。", + "name": "app_conf_get_bool", + "return": { + "type": "bool_t", + "desc": "返回配置项的值(如果不存在返回缺省值)。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "key", + "desc": "配置项的名称。" + }, + { + "type": "double", + "name": "defval", + "desc": "缺省值。" + } + ], + "annotation": { + "static": true, + "scriptable": true + }, + "desc": "获取单精度浮点数类型配置项的值。", + "name": "app_conf_get_double", + "return": { + "type": "double", + "desc": "返回配置项的值(如果不存在返回缺省值)。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "key", + "desc": "配置项的名称。" + }, + { + "type": "const char*", + "name": "defval", + "desc": "缺省值。" + } + ], + "annotation": { + "static": true, + "scriptable": true + }, + "desc": "获取字符串类型配置项的值。", + "name": "app_conf_get_str", + "return": { + "type": "const char*", + "desc": "返回配置项的值(如果不存在返回缺省值)。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "key", + "desc": "配置项的名称。" + }, + { + "type": "const wchar_t*", + "name": "str", + "desc": "返回值。" + }, + { + "type": "uint32_t", + "name": "max_size", + "desc": "最大长度(字符数)。" + } + ], + "annotation": { + "static": true + }, + "desc": "获取宽字符串类型配置项的值。", + "name": "app_conf_get_wstr", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "key", + "desc": "配置项的名称。" + } + ], + "annotation": { + "static": true, + "scriptable": true + }, + "desc": "删除配置项。", + "name": "app_conf_remove", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" @@ -7486,155 +7918,86 @@ ], "events": [], "properties": [], - "header": "tkc/waitable_action_queue.h", - "desc": "waitable actionqueue", - "name": "waitable_action_queue_t", - "level": 1 - }, - { - "type": "enum", - "desc": "字体资源类型定义。", - "consts": [ - { - "desc": "无效字体。", - "name": "ASSET_TYPE_FONT_NONE" - }, - { - "desc": "TTF字体。", - "name": "ASSET_TYPE_FONT_TTF" - }, - { - "desc": "位图字体。", - "name": "ASSET_TYPE_FONT_BMP" - } - ], - "header": "tkc/asset_info.h", - "name": "asset_font_type_t", - "prefix": "ASSET_FONT_TYPE_", - "level": 1 - }, - { - "type": "enum", - "desc": "类型常量定义。", - "consts": [ - { - "desc": "无效类型。", - "name": "VALUE_TYPE_INVALID" - }, - { - "desc": "BOOL类型。", - "name": "VALUE_TYPE_BOOL" - }, - { - "desc": "int8_t类型。", - "name": "VALUE_TYPE_INT8" - }, - { - "desc": "uint8_t类型。", - "name": "VALUE_TYPE_UINT8" - }, - { - "desc": "int16_t类型。", - "name": "VALUE_TYPE_INT16" - }, - { - "desc": "uint16_t类型。", - "name": "VALUE_TYPE_UINT16" - }, - { - "desc": "int32_t类型。", - "name": "VALUE_TYPE_INT32" - }, - { - "desc": "uint32_t类型。", - "name": "VALUE_TYPE_UINT32" - }, - { - "desc": "int64_t类型。", - "name": "VALUE_TYPE_INT64" - }, - { - "desc": "uint64_t类型。", - "name": "VALUE_TYPE_UINT64" - }, - { - "desc": "void*类型。", - "name": "VALUE_TYPE_POINTER" - }, - { - "desc": "float_t类型。", - "name": "VALUE_TYPE_FLOAT" - }, - { - "desc": "float类型。", - "name": "VALUE_TYPE_FLOAT32" - }, - { - "desc": "double类型。", - "name": "VALUE_TYPE_DOUBLE" - }, - { - "desc": "char*类型。", - "name": "VALUE_TYPE_STRING" - }, - { - "desc": "wchar_t*类型。", - "name": "VALUE_TYPE_WSTRING" - }, - { - "desc": "object_t*类型。", - "name": "VALUE_TYPE_OBJECT" - }, - { - "desc": "带长度的字符串。", - "name": "VALUE_TYPE_SIZED_STRING" - }, - { - "desc": "二进制数据。", - "name": "VALUE_TYPE_BINARY" - }, - { - "desc": "二进制数据(UBJSON)。", - "name": "VALUE_TYPE_UBJSON" - }, - { - "desc": "特殊用途。", - "name": "VALUE_TYPE_TOKEN" - } - ], - "header": "tkc/value.h", - "name": "value_type_t", - "prefix": "VALUE_TYPE_", + "header": "conf_io/app_conf.h", + "desc": "应用程序的配置信息。\n\n底层实现可以是任何格式,比如INI,XML,JSON和UBJSON。\n\n对于树状的文档,key可以是多级的,用.分隔。如network.ip。", + "name": "app_conf_t", "annotation": { + "fake": true, "scriptable": true }, "level": 1 }, { - "type": "class", - "methods": [], - "events": [], - "properties": [ + "params": [ { - "name": "defvalue", - "desc": "缺省值。", - "type": "const char*", - "annotation": { - "readable": true - } + "type": "conf_loader_t", + "name": "load", + "desc": "配置加载函数。" }, { - "name": "enums", - "desc": "枚举值。", - "type": "const char**", - "annotation": { - "readable": true - } + "type": "const char*", + "name": "app_name", + "desc": "应用程序名称。" + }, + { + "type": "const char*", + "name": "extname", + "desc": "文件扩展名。" } ], - "header": "tkc/value_desc.h", - "desc": "字符串枚举类型属性描述。", - "name": "value_desc_string_enums_t", + "annotation": { + "global": true + }, + "desc": "初始化。", + "name": "app_conf_init", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + }, + "type": "method", + "header": "conf_io/app_conf_init.h", + "level": 1 + }, + { + "params": [ + { + "type": "const char*", + "name": "app_name", + "desc": "应用程序名称。" + } + ], + "annotation": { + "global": true + }, + "desc": "初始化应用程序的配置信息。", + "name": "app_conf_init_ubjson", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + }, + "type": "method", + "header": "conf_io/app_conf_init_ubjson.h", + "level": 1 + }, + { + "params": [ + { + "type": "const char*", + "name": "app_name", + "desc": "应用程序名称。" + } + ], + "annotation": { + "global": true + }, + "desc": "初始化应用程序的配置信息。", + "name": "app_conf_init_json", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + }, + "type": "method", + "header": "conf_io/app_conf_init_json.h", "level": 1 }, { @@ -8877,62 +9240,24 @@ "level": 1 }, { - "type": "class", - "methods": [], - "events": [], - "properties": [ + "params": [ { - "name": "type", - "desc": "类型。", - "type": "uint8_t", - "annotation": { - "readable": true - } - }, - { - "name": "format", - "desc": "格式。", - "type": "uint8_t", - "annotation": { - "readable": true - } - }, - { - "name": "flags", - "desc": "flags。", - "type": "uint8_t", - "annotation": { - "readable": true - } - }, - { - "name": "name", - "desc": "名称。", "type": "const char*", - "annotation": { - "readable": true - } - }, - { - "name": "display_name", - "desc": "显示名称。", - "type": "const char*", - "annotation": { - "readable": true - } - }, - { - "name": "desc", - "desc": "描述。", - "type": "const char*", - "annotation": { - "readable": true - } + "name": "app_name", + "desc": "应用程序名称。" } ], - "header": "tkc/value_desc.h", - "desc": "属性描述。", - "name": "value_desc_t", + "annotation": { + "global": true + }, + "desc": "初始化应用程序的配置信息。", + "name": "app_conf_init_ini", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + }, + "type": "method", + "header": "conf_io/app_conf_init_ini.h", "level": 1 }, { @@ -9222,55 +9547,48 @@ "level": 1 }, { - "type": "enum", - "desc": "参数描述范围常量定义。", - "consts": [ + "type": "class", + "methods": [ { - "desc": "必须提供。", - "name": "ARG_DESC_FLAGS_REQUIRED" + "params": [ + { + "type": "int", + "name": "fd", + "desc": "fd." + } + ], + "annotation": {}, + "desc": "创建ostream对象。", + "name": "tk_ostream_serial_create", + "return": { + "type": "tk_ostream_t*", + "desc": "返回ostream对象。" + } } ], - "header": "tkc/value_desc.h", - "name": "arg_desc_flags_t", - "prefix": "ARG_DESC_FLAGS_", + "events": [], + "properties": [], + "header": "serial/ostream_serial.h", + "desc": "基于串口实现的输出流。\n\ninput stream base on fd", + "name": "tk_ostream_serial_t", "level": 1 }, { "type": "enum", - "desc": "属性描述范围常量定义。", + "desc": "缓存不够时丢弃数据的策略。", "consts": [ { - "desc": "单个对象的属性。", - "name": "PROP_DESC_FLAG_OBJECT" + "desc": "丢弃旧的数据。", + "name": "DATA_DISCARD_OLD" }, { - "desc": "同一个类所有实例共享属性。", - "name": "PROP_DESC_FLAG_CLASS" - }, - { - "desc": "全局属性。", - "name": "PROP_DESC_FLAG_GLOBAL" - }, - { - "desc": "可读取。", - "name": "PROP_DESC_FLAG_READABLE," - }, - { - "desc": "可修改。", - "name": "PROP_DESC_FLAG_WRITBALE," - }, - { - "desc": "可配置。", - "name": "PROP_DESC_FLAG_CONFIGURABLE" - }, - { - "desc": "需要持久化。", - "name": "PROP_DESC_FLAG_PERSISTENT" + "desc": "丢弃新的数据。", + "name": "DATA_DISCARD_NEW" } ], - "header": "tkc/value_desc.h", - "name": "prop_desc_flags_t", - "prefix": "PROP_DESC_FLAGS_", + "header": "misc/ostream_retry.h", + "name": "data_discard_policy_t", + "prefix": "DATA_DISCARD_", "level": 1 }, { @@ -9642,523 +9960,51 @@ "name": "matrix_t", "level": 1 }, - { - "type": "enum", - "desc": "属性描述格式常量定义。", - "consts": [ - { - "desc": "无特殊格式。", - "name": "VALUE_FORMAT_TYPE_NONE" - }, - { - "desc": "16进制格式。", - "name": "VALUE_FORMAT_TYPE_HEX" - }, - { - "desc": "非负格式(用于进一步限制float/double)。", - "name": "VALUE_FORMAT_TYPE_HEX" - }, - { - "desc": "手机号码格式。", - "name": "VALUE_FORMAT_TYPE_PHONE" - }, - { - "desc": "邮件格式。", - "name": "VALUE_FORMAT_TYPE_PHONE" - }, - { - "desc": "ip4地址格式。", - "name": "VALUE_FORMAT_TYPE_IP4_ADDRESS" - }, - { - "desc": "域名格式。", - "name": "VALUE_FORMAT_TYPE_DOMAIN_NAME" - }, - { - "desc": "URL格式。", - "name": "VALUE_FORMAT_TYPE_URL" - }, - { - "desc": "JSON格式。", - "name": "VALUE_FORMAT_TYPE_JSON" - }, - { - "desc": "XML格式。", - "name": "VALUE_FORMAT_TYPE_XML" - }, - { - "desc": "UBJSON格式。", - "name": "VALUE_FORMAT_TYPE_UBJSON" - } - ], - "header": "tkc/value_desc.h", - "name": "value_format_type_t", - "prefix": "VALUE_FORMAT_TYPE_", - "level": 1 - }, - { - "type": "enum", - "desc": "属性描述类型常量定义。", - "consts": [ - { - "desc": "有符号8位整数类型。", - "name": "VALUE_DESC_TYPE_INT8" - }, - { - "desc": "无符号8位整数类型。", - "name": "VALUE_DESC_TYPE_UINT8" - }, - { - "desc": "有符号16位整数类型。", - "name": "VALUE_DESC_TYPE_INT16" - }, - { - "desc": "无符号16位整数类型。", - "name": "VALUE_DESC_TYPE_UINT16" - }, - { - "desc": "有符号32位整数类型。", - "name": "VALUE_DESC_TYPE_INT32" - }, - { - "desc": "无符号32位整数类型。", - "name": "VALUE_DESC_TYPE_UINT32" - }, - { - "desc": "有符号64位整数类型。", - "name": "VALUE_DESC_TYPE_INT64" - }, - { - "desc": "无符号64位整数类型。", - "name": "VALUE_DESC_TYPE_UINT64" - }, - { - "desc": "单精度浮点数类型。", - "name": "VALUE_DESC_TYPE_FLOAT" - }, - { - "desc": "双精度浮点数类型。", - "name": "VALUE_DESC_TYPE_DOUBLE" - }, - { - "desc": "布尔类型。", - "name": "VALUE_DESC_TYPE_BOOL" - }, - { - "desc": "字符串类型。", - "name": "VALUE_DESC_TYPE_STRING" - }, - { - "desc": "二进制类型。", - "name": "VALUE_DESC_TYPE_BINARY" - }, - { - "desc": "整数枚举类型。", - "name": "VALUE_DESC_TYPE_INT_ENUMS" - }, - { - "desc": "字符串枚举类型。", - "name": "VALUE_DESC_TYPE_STRING_ENUMS" - } - ], - "header": "tkc/value_desc.h", - "name": "value_desc_type_t", - "prefix": "VALUE_DESC_TYPE_", - "level": 1 - }, { "type": "class", "methods": [ { "params": [ { - "type": "const char*", - "name": "str", - "desc": "要转换为整形的字符串。" + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" + }, + { + "type": "ubjson_write_callback_t", + "name": "write", + "desc": "真正写入数据的函数。" + }, + { + "type": "void*", + "name": "ctx", + "desc": "write函数的上下文。" } ], "annotation": {}, - "desc": "将字符串转换为整形。", - "name": "tk_atoi", + "desc": "初始化。", + "name": "ubjson_writer_init", "return": { - "type": "int", - "desc": "返回转换后的整形。" + "type": "ubjson_writer_t*", + "desc": "返回writer对象。" } }, { "params": [ { - "type": "const char*", - "name": "str", - "desc": "要转换为布尔类型的字符串。" - } - ], - "annotation": {}, - "desc": "将字符串转换为布尔类型。", - "name": "tk_atob", - "return": { - "type": "bool_t", - "desc": "返回转换后的布尔类型。" - } - }, - { - "params": [ - { - "type": "const char*", - "name": "str", - "desc": "要转换为浮点类型的字符串。" - } - ], - "annotation": {}, - "desc": "将字符串转换为浮点类型。", - "name": "tk_atof", - "return": { - "type": "double", - "desc": "返回转换后的浮点类型。" - } - }, - { - "params": [ - { - "type": "const char*", - "name": "a", - "desc": "要进行比较的第一个字符串。" + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" }, { "type": "const char*", - "name": "b", - "desc": "要进行比较的第二个字符串。" + "name": "value", + "desc": "key的名称。" } ], "annotation": {}, - "desc": "字符串比较函数。", - "name": "tk_str_cmp", - "return": { - "type": "int32_t", - "desc": "如果返回值=-1,则表示a为NULL;如果返回值=1,则表示b为NULL;如果返回值<0,则表示a小于b;如果返回值>0,则表示a大于b;如果返回值=0,则表示a等于b。" - } - }, - { - "params": [ - { - "type": "const char*", - "name": "a", - "desc": "要进行比较的第一个字符串。" - }, - { - "type": "const char*", - "name": "b", - "desc": "要进行比较的第二个字符串。" - } - ], - "annotation": {}, - "desc": "字符串比较函数(不区分大小写)。", - "name": "tk_str_icmp", - "return": { - "type": "int32_t", - "desc": "如果返回值=-1,则表示a为NULL;如果返回值=1,则表示b为NULL;如果返回值<0,则表示a小于b;如果返回值>0,则表示a大于b;如果返回值=0,则表示a等于b。" - } - }, - { - "params": [ - { - "type": "const wchar_t*", - "name": "str", - "desc": "要转换为整形的宽字符串。" - } - ], - "annotation": {}, - "desc": "将宽字符串转换为整形。", - "name": "tk_watoi", - "return": { - "type": "int", - "desc": "返回转换后的整形。" - } - }, - { - "params": [ - { - "type": "const wchar_t*", - "name": "str", - "desc": "要转换为整形的宽字符串。" - }, - { - "type": "uint32_t", - "name": "len", - "desc": "字符串长度。" - } - ], - "annotation": {}, - "desc": "将宽字符串转换为整形。", - "name": "tk_watoi_n", - "return": { - "type": "int", - "desc": "返回转换后的整形。" - } - }, - { - "params": [ - { - "type": "const wchar_t*", - "name": "str", - "desc": "要转换为布尔类型的宽字符串。" - } - ], - "annotation": {}, - "desc": "将宽字符串转换为布尔类型。", - "name": "tk_watob", - "return": { - "type": "bool_t", - "desc": "返回转换后的布尔类型。" - } - }, - { - "params": [ - { - "type": "const wchar_t*", - "name": "str", - "desc": "要转换为浮点类型的宽字符串。" - } - ], - "annotation": {}, - "desc": "将宽字符串转换为浮点类型。", - "name": "tk_watof", - "return": { - "type": "double", - "desc": "返回转换后的浮点类型。" - } - }, - { - "params": [ - { - "type": "const char*", - "name": "str", - "desc": "要输入的原始字符串。" - } - ], - "annotation": {}, - "desc": "跳过字符串函数,如:字符串\"hello123world\",返回的结果是\"123world\"。", - "name": "tk_skip_to_num", - "return": { - "type": "const char*", - "desc": "返回转换后的字符串。" - } - }, - { - "params": [ - { - "type": "char*", - "name": "str", - "desc": "保存字符串缓冲区。" - }, - { - "type": "int", - "name": "len", - "desc": "缓冲区大小。" - }, - { - "type": "int", - "name": "n", - "desc": "要转换的整形。" - } - ], - "annotation": {}, - "desc": "将整形转换为字符串。", - "name": "tk_itoa", - "return": { - "type": "const char*", - "desc": "返回字符串。" - } - }, - { - "params": [ - { - "type": "char*", - "name": "str", - "desc": "保存字符串缓冲区。" - }, - { - "type": "int", - "name": "len", - "desc": "缓冲区大小。" - }, - { - "type": "double", - "name": "f", - "desc": "要转换的浮点型。" - } - ], - "annotation": {}, - "desc": "将浮点型转换为字符串。", - "name": "tk_ftoa", - "return": { - "type": "const char*", - "desc": "返回字符串。" - } - }, - { - "params": [ - { - "type": "const char*", - "name": "str", - "desc": "要转换为长整形的字符串。" - }, - { - "type": "const char**", - "name": "end", - "desc": "对类型char*的对象的引用。" - }, - { - "type": "int", - "name": "base", - "desc": "基数。" - } - ], - "annotation": {}, - "desc": "将字符串转换为长整形。", - "name": "tk_strtol", - "return": { - "type": "long", - "desc": "返回转换后的长整形。" - } - }, - { - "params": [ - { - "type": "char*", - "name": "dst", - "desc": "目标字符串。" - }, - { - "type": "const char*", - "name": "src", - "desc": "原字符串。" - } - ], - "annotation": {}, - "desc": "将src所指向的字符串复制到dst。", - "name": "tk_strcpy", - "return": { - "type": "char*", - "desc": "返回目标字符串。" - } - }, - { - "params": [ - { - "type": "char*", - "name": "dst", - "desc": "目标字符串。" - }, - { - "type": "const char*", - "name": "src", - "desc": "原字符串。" - }, - { - "type": "size_t", - "name": "len", - "desc": "要复制的字符串个数。" - } - ], - "annotation": {}, - "desc": "将src所指向的字符串复制到dst,最多复制len个字符串,并在[len]位置添加'\\0'。\n\n> 请确保dst的长度>=(len+1)", - "name": "tk_strncpy", - "return": { - "type": "char*", - "desc": "返回目标字符串。" - } - }, - { - "params": [ - { - "type": "const char*", - "name": "str", - "desc": "原字符串。" - } - ], - "annotation": {}, - "desc": "字符串拷贝函数。", - "name": "tk_strdup", - "return": { - "type": "char*", - "desc": "返回指向的复制字符串指针,如果失败则返回NULL。" - } - }, - { - "params": [ - { - "type": "const wchar_t*", - "name": "str", - "desc": "原宽字符串。" - } - ], - "annotation": {}, - "desc": "宽字符串拷贝函数。", - "name": "tk_wstrdup", - "return": { - "type": "wchar_t*", - "desc": "返回指向的复制宽字符串指针,如果失败则返回NULL。" - } - }, - { - "params": [ - { - "type": "const char*", - "name": "str", - "desc": "原字符串。" - }, - { - "type": "uint32_t", - "name": "len", - "desc": "要复制的字符串个数。" - } - ], - "annotation": {}, - "desc": "字符串拷贝函数,最多复制len个字符串。", - "name": "tk_strndup", - "return": { - "type": "char*", - "desc": "返回指向的复制字符串指针,如果失败则返回NULL。" - } - }, - { - "params": [ - { - "type": "const char*", - "name": "str", - "desc": "字符串。" - } - ], - "annotation": {}, - "desc": "获取字符串的长度。str为空时返回0。", - "name": "tk_strlen", - "return": { - "type": "uint32_t", - "desc": "返回字符串的长度。" - } - }, - { - "params": [ - { - "type": "char*", - "name": "str", - "desc": "被追加字符串。" - }, - { - "type": "uint32_t", - "name": "max_len", - "desc": "字符串的最大长度。" - }, - { - "type": "const char*", - "name": "s", - "desc": "要追加的字符串。" - } - ], - "annotation": {}, - "desc": "字符串追加函数。", - "name": "tk_str_append", + "desc": "写入key。", + "name": "ubjson_writer_write_key", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" @@ -10167,232 +10013,125 @@ { "params": [ { - "type": "uint16_t*", - "name": "buff", - "desc": "buff" - }, - { - "type": "uint16_t", - "name": "val", - "desc": "值。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "个数。" + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" } ], "annotation": {}, - "desc": "设置数据2字节。", - "name": "tk_memset16", + "desc": "写入null。", + "name": "ubjson_writer_write_null", "return": { - "type": "uint16_t*", - "desc": "返回设置好的buff。" + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { - "type": "uint32_t*", - "name": "buff", - "desc": "buff。" - }, - { - "type": "void*", - "name": "val", - "desc": "值。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "个数。" + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" } ], "annotation": {}, - "desc": "设置数据3字节。", - "name": "tk_memset24", + "desc": "写入noop。", + "name": "ubjson_writer_write_noop", "return": { - "type": "uint32_t*", - "desc": "返回设置好的buff。" + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { - "type": "uint32_t*", - "name": "buff", - "desc": "buff。" - }, - { - "type": "uint32_t", - "name": "val", - "desc": "值。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "个数。" + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" } ], "annotation": {}, - "desc": "设置数据4字节。", - "name": "tk_memset32", + "desc": "写入true。", + "name": "ubjson_writer_write_true", "return": { - "type": "uint32_t*", - "desc": "返回设置好的buff。" + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { - "type": "uint16_t*", - "name": "dst", - "desc": "目标" - }, - { - "type": "uint16_t*", - "name": "src", - "desc": "源。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "个数。" + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" } ], "annotation": {}, - "desc": "拷贝数据2字节。", - "name": "tk_memcpy16", + "desc": "写入false。", + "name": "ubjson_writer_write_false", "return": { - "type": "uint16_t*", - "desc": "返回设置好的buff。" + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { - "type": "uint32_t*", - "name": "dst", - "desc": "目标" + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" }, { - "type": "uint32_t*", - "name": "src", - "desc": "源。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "个数。" + "type": "int32_t", + "name": "value", + "desc": "要写入的值。" } ], "annotation": {}, - "desc": "拷贝数据4字节。", - "name": "tk_memcpy32", + "desc": "写入int。", + "name": "ubjson_writer_write_int", "return": { - "type": "uint32_t*", - "desc": "返回设置好的buff。" + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { - "type": "void*", - "name": "dst", - "desc": "目标" + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" }, { - "type": "void*", - "name": "src", - "desc": "源。" - }, + "type": "int8_t", + "name": "value", + "desc": "要写入的值。" + } + ], + "annotation": {}, + "desc": "写入int8。", + "name": "ubjson_writer_write_int8", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ { - "type": "uint32_t", - "name": "size", - "desc": "个数。" + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" }, { "type": "uint8_t", - "name": "bpp", - "desc": "单个数据的字节数。" + "name": "value", + "desc": "要写入的值。" } ], "annotation": {}, - "desc": "已bpp字节为标准拷贝数据。", - "name": "tk_pixel_copy", - "return": { - "type": "void*", - "desc": "返回设置好的buff。" - } - }, - { - "params": [ - { - "type": "char*", - "name": "str", - "desc": "目标字符串。" - }, - { - "type": "size_t", - "name": "size", - "desc": "拷贝字节数。" - }, - { - "type": "const char*", - "name": "format", - "desc": "格式化字符串。" - } - ], - "annotation": {}, - "desc": "将可变参数(...)按照format格式化字符串,并将字符串复制到str中。", - "name": "tk_snprintf", - "return": { - "type": "int", - "desc": "返回格式化后的字符串长度+1。" - } - }, - { - "params": [ - { - "type": "char*", - "name": "str", - "desc": "要输入的字符串。" - }, - { - "type": "const char*", - "name": "format", - "desc": "格式化字符串。" - } - ], - "annotation": {}, - "desc": "从字符串读取格式化输入。", - "name": "tk_sscanf", - "return": { - "type": "int", - "desc": "返回成功匹配和赋值的个数。" - } - }, - { - "params": [ - { - "type": "const char*", - "name": "filename", - "desc": "完整的文件名。" - }, - { - "type": "char*", - "name": "str", - "desc": "用于返回文件名。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "文件名(str参数)的最大长度。" - } - ], - "annotation": {}, - "desc": "从完整文件名中获取文件名。", - "name": "filename_to_name", + "desc": "写入uint8。", + "name": "ubjson_writer_write_uint8", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" @@ -10401,29 +10140,19 @@ { "params": [ { - "type": "const char*", - "name": "filename", - "desc": "完整的文件名。" + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" }, { - "type": "char*", - "name": "str", - "desc": "用于返回文件名。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "文件名(str参数)的最大长度。" - }, - { - "type": "bool_t", - "name": "remove_extname", - "desc": "是否移除扩展名。" + "type": "int16_t", + "name": "value", + "desc": "要写入的值。" } ], "annotation": {}, - "desc": "从完整文件名中获取文件名。", - "name": "filename_to_name_ex", + "desc": "写入int16。", + "name": "ubjson_writer_write_int16", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" @@ -10432,720 +10161,521 @@ { "params": [ { - "type": "const char*", - "name": "filename", - "desc": "文件名。" + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" }, - { - "type": "str_t*", - "name": "s", - "desc": "用于返回内容。" - } - ], - "annotation": {}, - "desc": "expand include process instruction to file content: ", - "name": "xml_file_expand_read", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "const char*", - "name": "dst", - "desc": "目标字符串。" - }, - { - "type": "const char*", - "name": "src", - "desc": "源字符串。" - } - ], - "annotation": {}, - "desc": "字符串拷贝函数。\n> XXX: 要求dst为NULL或内存块的首地址,本函数调用之后,dst可能无效,请保留返回的地址", - "name": "tk_str_copy", - "return": { - "type": "char*", - "desc": "返回指向的复制字符串指针,如果失败则返回NULL。" - } - }, - { - "params": [ - { - "type": "void*", - "name": "data", - "desc": "数据。" - } - ], - "annotation": {}, - "desc": "空的destroy函数。", - "name": "dummy_destroy", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "void*", - "name": "data", - "desc": "数据。" - } - ], - "annotation": {}, - "desc": "缺省的destroy函数。释放data指向的内存。", - "name": "default_destroy", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "const void*", - "name": "a", - "desc": "数据a。" - }, - { - "type": "const void*", - "name": "b", - "desc": "数据b。" - } - ], - "annotation": {}, - "desc": "指针比较。", - "name": "pointer_compare", - "return": { - "type": "int", - "desc": "返回0表示相等,返回负数表示小于,返回整数表示大于。" - } - }, - { - "params": [ - { - "type": "const void*", - "name": "a", - "desc": "数据a。" - }, - { - "type": "const void*", - "name": "b", - "desc": "数据b。" - } - ], - "annotation": {}, - "desc": "始终返回相等。", - "name": "compare_always_equal", - "return": { - "type": "int", - "desc": "始终返回0。" - } - }, - { - "params": [ - { - "type": "const char*", - "name": "name", - "desc": "名字字符串。" - } - ], - "annotation": {}, - "desc": "判断是否是有效的属性名。", - "name": "tk_is_valid_name", - "return": { - "type": "bool_t", - "desc": "如果名称有效返回TRUE,否则返回FALSE。" - } - }, - { - "params": [ - { - "type": "const char*", - "name": "str", - "desc": "要检查字符串。" - }, - { - "type": "const char*", - "name": "prefix", - "desc": "被检查的字符串。" - } - ], - "annotation": {}, - "desc": "检查字符串是否以指定的字符串prefix开头。", - "name": "tk_str_start_with", - "return": { - "type": "bool_t", - "desc": "返回TRUE表示是;否则表示不是。" - } - }, - { - "params": [ - { - "type": "const char*", - "name": "name", - "desc": "下划线名字。" - }, - { - "type": "char*", - "name": "out", - "desc": "驼峰名字(保存结果)。" - }, - { - "type": "uint32_t", - "name": "max_out_size", - "desc": "结果最大长度。" - } - ], - "annotation": {}, - "desc": "将下划线名字转成驼峰名字。", - "name": "tk_under_score_to_camel", - "return": { - "type": "const char*", - "desc": "返回T驼峰名字。" - } - }, - { - "params": [ - { - "type": "const void*", - "name": "p", - "desc": "指针。" - } - ], - "annotation": {}, - "desc": "将指针转换成int。\n\n>与tk_pointer_from_int配套使用,也就是pointer本身必须就是整数,而不是指针,否则pointer会被截断。", - "name": "tk_pointer_to_int", - "return": { - "type": "int32_t", - "desc": "返回对应的int数据。" - } - }, - { - "params": [ { "type": "int32_t", - "name": "v", - "desc": "整数。" + "name": "value", + "desc": "要写入的值。" } ], "annotation": {}, - "desc": "将int转换成指针。\n\n> 常用于将int类型的数据作为回调函数的ctx。", - "name": "tk_pointer_from_int", - "return": { - "type": "void*", - "desc": "返回对应的指针。" - } - }, - { - "params": [ - { - "type": "char*", - "name": "str", - "desc": "要被转换成大写字母的字符串。" - } - ], - "annotation": {}, - "desc": "将小写字母转换为大写字母。", - "name": "tk_str_toupper", - "return": { - "type": "char*", - "desc": "返回转换后的大写字母字符串。" - } - }, - { - "params": [ - { - "type": "char*", - "name": "str", - "desc": "要被转换成小写字母的字符串。" - } - ], - "annotation": {}, - "desc": "将大写字母转换为小写字母。", - "name": "tk_str_tolower", - "return": { - "type": "char*", - "desc": "返回转换后的小写字母字符串。" - } - }, - { - "params": [ - { - "type": "char*", - "name": "str", - "desc": "utf8编码的字符串。" - } - ], - "annotation": {}, - "desc": "将utf8字符串拷贝为UCS字符串。", - "name": "tk_wstr_dup_utf8", - "return": { - "type": "wchar_t*", - "desc": "返回UCS字符串(需要调用TKMEM_FREE释放)。" - } - }, - { - "params": [ - { - "type": "const wchar_t*", - "name": "str", - "desc": "字符串。" - }, - { - "type": "wchar_t", - "name": "c", - "desc": "字符。" - } - ], - "annotation": {}, - "desc": "统计UCS字符串中某个字符出现的次数。", - "name": "tk_wstr_count_c", - "return": { - "type": "uint32_t", - "desc": "返回字符出现的次数。" - } - }, - { - "params": [ - { - "type": "uint32_t", - "name": "img_w", - "desc": "图片宽度。" - }, - { - "type": "uint32_t", - "name": "img_h", - "desc": "图片宽度。" - }, - { - "type": "const char*", - "name": "region", - "desc": "region。" - }, - { - "type": "rect_t*", - "name": "r", - "desc": "返回具体位置。" - } - ], - "annotation": {}, - "desc": "解析子图的区域信息。", - "name": "image_region_parse", + "desc": "写入int32。", + "name": "ubjson_writer_write_int32", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" } - } - ], - "events": [], - "properties": [], - "header": "tkc/utils.h", - "desc": "工具类。", - "name": "utils_t", - "annotation": { - "fake": true - }, - "level": 1 - }, - { - "type": "class", - "methods": [ + }, { "params": [ { - "type": "const wchar_t*", - "name": "in", - "desc": "输入字符串。" + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" }, { - "type": "const char*", - "name": "out", - "desc": "输出字符串。" - }, - { - "type": "uint32_t", - "name": "out_size", - "desc": "输出字符串的最大长度。" + "type": "int64_t", + "name": "value", + "desc": "要写入的值。" } ], "annotation": {}, - "desc": "把ucs字符串转成UTF8字符串。", - "name": "tk_utf8_from_utf16", + "desc": "写入int64。", + "name": "ubjson_writer_write_int64", "return": { - "type": "char*", - "desc": "返回UTF8字符串。" + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { - "type": "const wchar_t*", - "name": "in", - "desc": "输入字符串。" - }, - { - "type": "uint32_t", - "name": "in_size", - "desc": "输入字符串的长度。" - }, - { - "type": "const char*", - "name": "out", - "desc": "输出字符串。" - }, - { - "type": "uint32_t", - "name": "out_size", - "desc": "输出字符串的最大长度。" - } - ], - "annotation": {}, - "desc": "把ucs字符串转成UTF8字符串。", - "name": "tk_utf8_from_utf16_ex", - "return": { - "type": "char*", - "desc": "返回UTF8字符串。" - } - }, - { - "params": [ - { - "type": "const char*", - "name": "str", - "desc": "str。" - }, - { - "type": "const wchar_t*", - "name": "out", - "desc": "返回结果缓冲区。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "缓冲区大小。" - } - ], - "annotation": {}, - "desc": "将char类型转换为wchar_t类型。", - "name": "tk_utf8_to_utf16", - "return": { - "type": "wchar_t*", - "desc": "值。" - } - } - ], - "events": [], - "properties": [], - "header": "tkc/utf8.h", - "desc": "wchar_t和char类型转换接口。\n\n示例:\n\n```c\nconst char* str = \"hello\";\nconst wchar_t* wstr = L\"hello\";\nchar res_str[128];\nwchar_t res_wstr[128];\n\ntk_utf8_to_utf16(str, res_wstr, ARRAY_SIZE(res_wstr));\ntk_utf8_from_utf16(wstr, res_str, ARRAY_SIZE(res_str));\n```", - "name": "utf8_t", - "annotation": { - "fake": true - }, - "level": 1 - }, - { - "type": "enum", - "desc": "函数返回值常量定义。", - "consts": [ - { - "desc": "成功。", - "name": "RET_OK" - }, - { - "desc": "Out of memory。", - "name": "RET_OOM" - }, - { - "desc": "失败。", - "name": "RET_FAIL" - }, - { - "desc": "没有实现/不支持。", - "name": "RET_NOT_IMPL" - }, - { - "desc": "退出。通常用于主循环。", - "name": "RET_QUIT" - }, - { - "desc": "找到。", - "name": "RET_FOUND" - }, - { - "desc": "对象忙。", - "name": "RET_BUSY" - }, - { - "desc": "移出。通常用于定时器。", - "name": "RET_REMOVE" - }, - { - "desc": "重复。通常用于定时器。", - "name": "RET_REPEAT" - }, - { - "desc": "没找到。", - "name": "RET_NOT_FOUND" - }, - { - "desc": "操作完成。", - "name": "RET_DONE" - }, - { - "desc": "停止后续操作。", - "name": "RET_STOP" - }, - { - "desc": "跳过当前项。", - "name": "RET_SKIP" - }, - { - "desc": "继续后续操作。", - "name": "RET_CONTINUE" - }, - { - "desc": "对象属性变化。", - "name": "RET_OBJECT_CHANGED" - }, - { - "desc": "集合数目变化。", - "name": "RET_ITEMS_CHANGED" - }, - { - "desc": "无效参数。", - "name": "RET_BAD_PARAMS" - }, - { - "desc": "超时。", - "name": "RET_TIMEOUT" - }, - { - "desc": "CRC错误。", - "name": "RET_CRC" - }, - { - "desc": "IO错误。", - "name": "RET_IO" - }, - { - "desc": "End of Stream", - "name": "RET_EOS" - } - ], - "header": "tkc/types_def.h", - "name": "ret_t", - "prefix": "RET_", - "annotation": { - "scriptable": true - }, - "level": 1 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "tokenizer_t*", - "name": "tokenizer", - "desc": "tokenizer对象。" - }, - { - "type": "char*", - "name": "str", - "desc": "要解析的字符串。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "字符串长度。" - }, - { - "type": "char*", - "name": "separtor", - "desc": "分隔字符。" - } - ], - "annotation": { - "constructor": true - }, - "desc": "初始化tokenizer对象。", - "name": "tokenizer_init", - "return": { - "type": "tokenizer_t*", - "desc": "tokenizer对象本身。" - } - }, - { - "params": [ - { - "type": "tokenizer_t*", - "name": "tokenizer", - "desc": "tokenizer对象。" - }, - { - "type": "char*", - "name": "str", - "desc": "要解析的字符串。" - }, - { - "type": "uint32_t", - "name": "size", - "desc": "字符串长度。" - }, - { - "type": "char*", - "name": "separtor", - "desc": "分隔字符。" - }, - { - "type": "char*", - "name": "single_char_token", - "desc": "单字符token。" - } - ], - "annotation": { - "constructor": true - }, - "desc": "初始化tokenizer对象。", - "name": "tokenizer_init_ex", - "return": { - "type": "tokenizer_t*", - "desc": "tokenizer对象本身。" - } - }, - { - "params": [ - { - "type": "tokenizer_t*", - "name": "tokenizer", - "desc": "tokenizer对象。" - } - ], - "annotation": {}, - "desc": "是否还有下一个token。", - "name": "tokenizer_has_more", - "return": { - "type": "bool_t", - "desc": "还有下一个token返回TRUE,否则返回FALSE。" - } - }, - { - "params": [ - { - "type": "tokenizer_t*", - "name": "tokenizer", - "desc": "tokenizer对象。" - } - ], - "annotation": {}, - "desc": "获取下一个token。", - "name": "tokenizer_next", - "return": { - "type": "char*", - "desc": "成功返回token,失败返回NULL。" - } - }, - { - "params": [ - { - "type": "tokenizer_t*", - "name": "tokenizer", - "desc": "tokenizer对象。" - }, - { - "type": "const char*", - "name": "str", - "desc": "字符集。" - } - ], - "annotation": {}, - "desc": "获取下一个token,该token直到遇到指定的char。", - "name": "tokenizer_next_until", - "return": { - "type": "char*", - "desc": "成功返回token,失败返回NULL。" - } - }, - { - "params": [ - { - "type": "tokenizer_t*", - "name": "tokenizer", - "desc": "tokenizer对象。" - }, - { - "type": "const char*", - "name": "str", - "desc": "字符集。" - } - ], - "annotation": {}, - "desc": "获取下一个expr,该expr直到遇到指定的char。", - "name": "tokenizer_next_expr_until", - "return": { - "type": "char*", - "desc": "成功返回token,失败返回NULL。" - } - }, - { - "params": [ - { - "type": "tokenizer_t*", - "name": "tokenizer", - "desc": "tokenizer对象。" - }, - { - "type": "int", - "name": "defval", - "desc": "缺省值。" - } - ], - "annotation": {}, - "desc": "获取下一个token,并转换成int。", - "name": "tokenizer_next_int", - "return": { - "type": "char*", - "desc": "成功返回token的int值,失败返回缺省值。" - } - }, - { - "params": [ - { - "type": "tokenizer_t*", - "name": "tokenizer", - "desc": "tokenizer对象。" + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" }, { "type": "float", - "name": "defval", - "desc": "缺省值。" + "name": "value", + "desc": "要写入的值。" } ], "annotation": {}, - "desc": "获取下一个token,并转换成float。", - "name": "tokenizer_next_float", + "desc": "写入float。", + "name": "ubjson_writer_write_float32", "return": { - "type": "char*", - "desc": "成功返回token的float值,失败返回缺省值。" + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { - "type": "tokenizer_t*", - "name": "tokenizer", - "desc": "tokenizer对象。" + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" + }, + { + "type": "double", + "name": "value", + "desc": "要写入的值。" } ], "annotation": {}, - "desc": "重置tokenizer。", - "name": "tokenizer_deinit", + "desc": "写入double。", + "name": "ubjson_writer_write_float64", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" + }, + { + "type": "char", + "name": "value", + "desc": "要写入的值。" + } + ], + "annotation": {}, + "desc": "写入char。", + "name": "ubjson_writer_write_char", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" + }, + { + "type": "const char*", + "name": "value", + "desc": "要写入的字符串。" + } + ], + "annotation": {}, + "desc": "写入str。", + "name": "ubjson_writer_write_str", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" + }, + { + "type": "const char*", + "name": "value", + "desc": "要写入的字符串。" + }, + { + "type": "uint32_t", + "name": "len", + "desc": "字符串的长度。" + } + ], + "annotation": {}, + "desc": "写入str。", + "name": "ubjson_writer_write_str_len", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" + }, + { + "type": "object_t*", + "name": "obj", + "desc": "要写入的对象。" + } + ], + "annotation": {}, + "desc": "写入obj。", + "name": "ubjson_writer_write_object", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" + } + ], + "annotation": {}, + "desc": "写入数组开始。\n> 即: [", + "name": "ubjson_writer_write_array_begin", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" + } + ], + "annotation": {}, + "desc": "写入数组结束。\n> 即: ]", + "name": "ubjson_writer_write_array_end", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" + } + ], + "annotation": {}, + "desc": "写入对象开始。\n> 即: {", + "name": "ubjson_writer_write_object_begin", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" + } + ], + "annotation": {}, + "desc": "写入对象结束。\n> 即:}", + "name": "ubjson_writer_write_object_end", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" + }, + { + "type": "const void*", + "name": "data", + "desc": "数据。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "数据长度。" + } + ], + "annotation": {}, + "desc": "写入二进制数据。", + "name": "ubjson_writer_write_data", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" + }, + { + "type": "const char*", + "name": "key", + "desc": "键值。" + } + ], + "annotation": {}, + "desc": "写key和对象的开始。\n\n> 即:\"key\": {", + "name": "ubjson_writer_write_kv_object_begin", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" + }, + { + "type": "const char*", + "name": "key", + "desc": "键名。" + }, + { + "type": "object_t*", + "name": "value", + "desc": "对象。" + } + ], + "annotation": {}, + "desc": "写key和对象。\n\n> 即:\"key\": { object }", + "name": "ubjson_writer_write_kv_object", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" + }, + { + "type": "const char*", + "name": "key", + "desc": "键名。" + }, + { + "type": "int32_t", + "name": "value", + "desc": "值。" + } + ], + "annotation": {}, + "desc": "写入key和int的值。\n\n> 即:\"key\": value", + "name": "ubjson_writer_write_kv_int", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" + }, + { + "type": "const char*", + "name": "key", + "desc": "键名。" + }, + { + "type": "int64_t", + "name": "value", + "desc": "值。" + } + ], + "annotation": {}, + "desc": "写入key和int64_t的值。\n\n> 即:\"key\": value", + "name": "ubjson_writer_write_kv_int64", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" + }, + { + "type": "const char*", + "name": "key", + "desc": "键名。" + }, + { + "type": "float", + "name": "value", + "desc": "值。" + } + ], + "annotation": {}, + "desc": "写入key和float的值。\n\n> 即:\"key\": value", + "name": "ubjson_writer_write_kv_float", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" + }, + { + "type": "const char*", + "name": "key", + "desc": "键名。" + }, + { + "type": "double", + "name": "value", + "desc": "值。" + } + ], + "annotation": {}, + "desc": "写入key和double的值。\n\n> 即:\"key\": value", + "name": "ubjson_writer_write_kv_double", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" + }, + { + "type": "const char*", + "name": "key", + "desc": "键名。" + }, + { + "type": "bool_t", + "name": "value", + "desc": "值。" + } + ], + "annotation": {}, + "desc": "写入key和bool的值。\n\n> 即:\"key\": value", + "name": "ubjson_writer_write_kv_bool", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" + }, + { + "type": "const char*", + "name": "key", + "desc": "键名。" + }, + { + "type": "const char*", + "name": "value", + "desc": "字符串。" + } + ], + "annotation": {}, + "desc": "写入key和str的值。\n\n> 即:\"key\": value", + "name": "ubjson_writer_write_kv_str", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" + }, + { + "type": "const char*", + "name": "key", + "desc": "键名。" + }, + { + "type": "const char*", + "name": "value", + "desc": "字符串。" + }, + { + "type": "uint32_t", + "name": "len", + "desc": "字符串的长度。" + } + ], + "annotation": {}, + "desc": "写入key和str的值。\n\n> 即:\"key\": value", + "name": "ubjson_writer_write_kv_str_len", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "ubjson_writer_t*", + "name": "writer", + "desc": "writer对象。" + }, + { + "type": "const char*", + "name": "key", + "desc": "键名。" + }, + { + "type": "value_t*", + "name": "value", + "desc": "值。" + } + ], + "annotation": {}, + "desc": "写入key和value_t的值。\n\n> 即:\"key\": value", + "name": "ubjson_writer_write_kv_value", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" @@ -11153,51 +10683,197 @@ } ], "events": [], - "properties": [ + "properties": [], + "header": "ubjson/ubjson_writer.h", + "desc": "ubjson writer", + "name": "ubjson_writer_t", + "level": 1 + }, + { + "type": "class", + "methods": [ { - "name": "str", - "desc": "字符串。", - "type": "char*", + "params": [ + { + "type": "void*", + "name": "data", + "desc": "数据。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "数据的长度。" + }, + { + "type": "ubjson_on_key_value_t", + "name": "on_key_value", + "desc": "回调函数。" + }, + { + "type": "void*", + "name": "ctx", + "desc": "回调函数的上下文。" + } + ], "annotation": { - "readable": true + "static": true + }, + "desc": "解析ubjson数据,遇到key/value时调用提供的回调函数。", + "name": "ubjson_parse", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" } }, { - "name": "size", - "desc": "字符串的长度。", - "type": "uint32_t", + "params": [ + { + "type": "void*", + "name": "data", + "desc": "数据。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "数据的长度。" + } + ], "annotation": { - "readable": true + "static": true + }, + "desc": "解析ubjson数据,生成object对象。", + "name": "ubjson_to_object", + "return": { + "type": "void*", + "desc": "返回object表示的数据。" } }, { - "name": "cursor", - "desc": "当前位置。", - "type": "uint32_t", + "params": [ + { + "type": "void*", + "name": "data", + "desc": "数据。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "数据的长度。" + } + ], "annotation": { - "readable": true - } - }, - { - "name": "separtor", - "desc": "分隔字符串。", - "type": "char*", - "annotation": { - "readable": true - } - }, - { - "name": "single_char_token", - "desc": "单字符的token。", - "type": "char*", - "annotation": { - "readable": true + "static": true + }, + "desc": "将ubjson数据打印到控制台。", + "name": "ubjson_dump", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" } } ], - "header": "tkc/tokenizer.h", - "desc": "从字符串中解析出一个一个的token。\n\n```c\ntokenizer_t tokenizer;\ntokenizer_t* t = tokenizer_init(&tokenizer, \"20,111.2,22.3,333.3,44,555.5\", 0xffffff, \",\");\n\nwhile(tokenizer_has_more(t)) {\ndouble v = tokenizer_next_float(t, 0);\nlog_debug(\"%lf\\n\", v);\n}\n\ntokenizer_deinit(t);\n```", - "name": "tokenizer_t", + "events": [], + "properties": [], + "header": "ubjson/ubjson_parser.h", + "desc": "ubjson parser", + "name": "ubjson_parser_t", + "annotation": { + "fake": true + }, + "level": 1 + }, + { + "params": [ + { + "type": "const wchar_t*", + "name": "s", + "desc": "源字符串。" + } + ], + "annotation": { + "global": true + }, + "desc": "获取一个新的内存保存s串。", + "name": "wcs_dup", + "return": { + "type": "wchar_t*", + "desc": "返回新的字符串地址。" + }, + "type": "method", + "header": "tkc/wstr.h", + "level": 1 + }, + { + "params": [ + { + "type": "const wchar_t*", + "name": "s", + "desc": "串地址。" + } + ], + "annotation": { + "global": true + }, + "desc": "获取字符串长度。", + "name": "wcs_len", + "return": { + "type": "size_t", + "desc": "返回串长度'\\0'结尾。" + }, + "type": "method", + "header": "tkc/wstr.h", + "level": 1 + }, + { + "params": [ + { + "type": "const wchar_t*", + "name": "s1", + "desc": "目标串。" + }, + { + "type": "const wchar_t*", + "name": "s2", + "desc": "源串。" + } + ], + "annotation": { + "global": true + }, + "desc": "比较字符串", + "name": "wcs_cmp", + "return": { + "type": "int", + "desc": "小于0表示s1s2。" + }, + "type": "method", + "header": "tkc/wstr.h", + "level": 1 + }, + { + "params": [ + { + "type": "wchar_t*", + "name": "s1", + "desc": "目标串。" + }, + { + "type": "const wchar_t*", + "name": "s2", + "desc": "源串。" + } + ], + "annotation": { + "global": true + }, + "desc": "复制字符串", + "name": "wcs_cpy", + "return": { + "type": "const wchar_t*", + "desc": "复制后的串地址。" + }, + "type": "method", + "header": "tkc/wstr.h", "level": 1 }, { @@ -11490,158 +11166,425 @@ "level": 1 }, { - "type": "class", - "methods": [ + "type": "enum", + "desc": "MIME_TYPE。", + "consts": [ { - "params": [], - "annotation": { - "constructor": true - }, - "desc": "创建action_thread对象。", - "name": "action_thread_create", - "return": { - "type": "action_thread_t*", - "desc": "action_thread对象。" - } + "desc": "\"application/envoy\"。", + "name": "MIME_TYPE_APPLICATION_ENVOY" }, { - "params": [ - { - "type": "waitable_action_queue_t*", - "name": "queue", - "desc": "queue对象。" - } - ], - "annotation": { - "constructor": true - }, - "desc": "创建action_thread对象。", - "name": "action_thread_create_with_queue", - "return": { - "type": "action_thread_t*", - "desc": "action_thread对象。" - } + "desc": "\"application/fractals\"。", + "name": "MIME_TYPE_APPLICATION_FRACTALS" }, { - "params": [ - { - "type": "action_thread_t*", - "name": "thread", - "desc": "action_thread对象。" - }, - { - "type": "qaction_t*", - "name": "action", - "desc": "action对象。" - } - ], - "annotation": {}, - "desc": "让线程执行action。", - "name": "action_thread_exec", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } + "desc": "\"application/futuresplash\"。", + "name": "MIME_TYPE_APPLICATION_FUTURESPLASH" }, { - "params": [ - { - "type": "action_thread_t*", - "name": "thread", - "desc": "action_thread对象。" - }, - { - "type": "action_thread_on_idle_t", - "name": "on_idle", - "desc": "空闲时的回调函数。" - }, - { - "type": "void*", - "name": "ctx", - "desc": "回调函数的上下文。" - } - ], - "annotation": {}, - "desc": "设置空闲时的回调函数。", - "name": "action_thread_set_on_idle", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } + "desc": "\"application/hta\"。", + "name": "MIME_TYPE_APPLICATION_HTA" }, { - "params": [ - { - "type": "action_thread_t*", - "name": "thread", - "desc": "action_thread对象。" - }, - { - "type": "action_thread_on_quit_t", - "name": "on_quit", - "desc": "退出时的回调函数。" - }, - { - "type": "void*", - "name": "ctx", - "desc": "回调函数的上下文。" - } - ], - "annotation": {}, - "desc": "设置退出时的回调函数。", - "name": "action_thread_set_on_quit", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } + "desc": "\"application/json\"。", + "name": "MIME_TYPE_APPLICATION_JSON" }, { - "params": [ - { - "type": "action_thread_t*", - "name": "thread", - "desc": "action_thread对象。" - } - ], - "annotation": {}, - "desc": "销毁。", - "name": "action_thread_destroy", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } + "desc": "\"application/ubjson\"。", + "name": "MIME_TYPE_APPLICATION_UBJSON" + }, + { + "desc": "\"application/mac-binhex40\"。", + "name": "MIME_TYPE_APPLICATION_MAC_BINHEX40" + }, + { + "desc": "\"application/msword\"。", + "name": "MIME_TYPE_APPLICATION_MSWORD" + }, + { + "desc": "\"application/octet-stream\"。", + "name": "MIME_TYPE_APPLICATION_OCTET_STREAM" + }, + { + "desc": "\"application/oda\"。", + "name": "MIME_TYPE_APPLICATION_ODA" + }, + { + "desc": "\"application/olescript\"。", + "name": "MIME_TYPE_APPLICATION_OLESCRIPT" + }, + { + "desc": "\"application/pdf\"。", + "name": "MIME_TYPE_APPLICATION_PDF" + }, + { + "desc": "\"application/pics-rules\"。", + "name": "MIME_TYPE_APPLICATION_PICS_RULES" + }, + { + "desc": "\"application/pkcs10\"。", + "name": "MIME_TYPE_APPLICATION_PKCS10" + }, + { + "desc": "\"application/pkix-crl\"。", + "name": "MIME_TYPE_APPLICATION_PKIX_CRL" + }, + { + "desc": "\"application/postscript\"。", + "name": "MIME_TYPE_APPLICATION_POSTSCRIPT" + }, + { + "desc": "\"application/rtf\"。", + "name": "MIME_TYPE_APPLICATION_RTF" + }, + { + "desc": "\"application/vnd.ms-excel\"。", + "name": "MIME_TYPE_APPLICATION_VND_MS_EXCEL" + }, + { + "desc": "\"application/vnd.ms-outlook\"。", + "name": "MIME_TYPE_APPLICATION_VND_MS_OUTLOOK" + }, + { + "desc": "\"application/vnd.ms-pkicertstore\"。", + "name": "MIME_TYPE_APPLICATION_VND_MS_PKICERTSTORE" + }, + { + "desc": "\"application/vnd.ms-pkiseccat\"。", + "name": "MIME_TYPE_APPLICATION_VND_MS_PKISECCAT" + }, + { + "desc": "\"application/vnd.ms-pkistl\"。", + "name": "MIME_TYPE_APPLICATION_VND_MS_PKISTL" + }, + { + "desc": "\"application/vnd.ms-powerpoint\"。", + "name": "MIME_TYPE_APPLICATION_VND_MS_POWERPOINT" + }, + { + "desc": "\"application/vnd.ms-project\"。", + "name": "MIME_TYPE_APPLICATION_VND_MS_PROJECT" + }, + { + "desc": "\"application/vnd.ms-works\"。", + "name": "MIME_TYPE_APPLICATION_VND_MS_WORKS" + }, + { + "desc": "\"application/winhlp\"。", + "name": "MIME_TYPE_APPLICATION_WINHLP" + }, + { + "desc": "\"application/x-bcpio\"。", + "name": "MIME_TYPE_APPLICATION_X_BCPIO" + }, + { + "desc": "\"application/x-cdf\"。", + "name": "MIME_TYPE_APPLICATION_X_CDF" + }, + { + "desc": "\"application/x-compress\"。", + "name": "MIME_TYPE_APPLICATION_X_COMPRESS" + }, + { + "desc": "\"application/x-compressed\"。", + "name": "MIME_TYPE_APPLICATION_X_COMPRESSED" + }, + { + "desc": "\"application/x-cpio\"。", + "name": "MIME_TYPE_APPLICATION_X_CPIO" + }, + { + "desc": "\"application/x-csh\"。", + "name": "MIME_TYPE_APPLICATION_X_CSH" + }, + { + "desc": "\"application/x-director\"。", + "name": "MIME_TYPE_APPLICATION_X_DIRECTOR" + }, + { + "desc": "\"application/x-dvi\"。", + "name": "MIME_TYPE_APPLICATION_X_DVI" + }, + { + "desc": "\"application/x-gtar\"。", + "name": "MIME_TYPE_APPLICATION_X_GTAR" + }, + { + "desc": "\"application/x-gzip\"。", + "name": "MIME_TYPE_APPLICATION_X_GZIP" + }, + { + "desc": "\"application/x-hdf\"。", + "name": "MIME_TYPE_APPLICATION_X_HDF" + }, + { + "desc": "\"application/x-iphone\"。", + "name": "MIME_TYPE_APPLICATION_X_IPHONE" + }, + { + "desc": "\"application/x-javascript\"。", + "name": "MIME_TYPE_APPLICATION_X_JAVASCRIPT" + }, + { + "desc": "\"application/x-latex\"。", + "name": "MIME_TYPE_APPLICATION_X_LATEX" + }, + { + "desc": "\"application/x-msaccess\"。", + "name": "MIME_TYPE_APPLICATION_X_MSACCESS" + }, + { + "desc": "\"application/x-mscardfile\"。", + "name": "MIME_TYPE_APPLICATION_X_MSCARDFILE" + }, + { + "desc": "\"application/x-msclip\"。", + "name": "MIME_TYPE_APPLICATION_X_MSCLIP" + }, + { + "desc": "\"application/x-msdownload\"。", + "name": "MIME_TYPE_APPLICATION_X_MSDOWNLOAD" + }, + { + "desc": "\"application/x-msmediaview\"。", + "name": "MIME_TYPE_APPLICATION_X_MSMEDIAVIEW" + }, + { + "desc": "\"application/x-msmetafile\"。", + "name": "MIME_TYPE_APPLICATION_X_MSMETAFILE" + }, + { + "desc": "\"application/x-msmoney\"。", + "name": "MIME_TYPE_APPLICATION_X_MSMONEY" + }, + { + "desc": "\"application/x-mspublisher\"。", + "name": "MIME_TYPE_APPLICATION_X_MSPUBLISHER" + }, + { + "desc": "\"application/x-msschedule\"。", + "name": "MIME_TYPE_APPLICATION_X_MSSCHEDULE" + }, + { + "desc": "\"application/x-msterminal\"。", + "name": "MIME_TYPE_APPLICATION_X_MSTERMINAL" + }, + { + "desc": "\"application/x-mswrite\"。", + "name": "MIME_TYPE_APPLICATION_X_MSWRITE" + }, + { + "desc": "\"application/x-netcdf\"。", + "name": "MIME_TYPE_APPLICATION_X_NETCDF" + }, + { + "desc": "\"application/x-perfmon\"。", + "name": "MIME_TYPE_APPLICATION_X_PERFMON" + }, + { + "desc": "\"application/x-pkcs12\"。", + "name": "MIME_TYPE_APPLICATION_X_PKCS12" + }, + { + "desc": "\"application/x-sh\"。", + "name": "MIME_TYPE_APPLICATION_X_SH" + }, + { + "desc": "\"application/x-shar\"。", + "name": "MIME_TYPE_APPLICATION_X_SHAR" + }, + { + "desc": "\"application/x-shockwave-flash\"。", + "name": "MIME_TYPE_APPLICATION_X_SHOCKWAVE_FLASH" + }, + { + "desc": "\"application/x-stuffit\"。", + "name": "MIME_TYPE_APPLICATION_X_STUFFIT" + }, + { + "desc": "\"application/x-sv4cpio\"。", + "name": "MIME_TYPE_APPLICATION_X_SV4CPIO" + }, + { + "desc": "\"application/x-sv4crc\"。", + "name": "MIME_TYPE_APPLICATION_X_SV4CRC" + }, + { + "desc": "\"application/x-tar\"。", + "name": "MIME_TYPE_APPLICATION_X_TAR" + }, + { + "desc": "\"application/x-tcl\"。", + "name": "MIME_TYPE_APPLICATION_X_TCL" + }, + { + "desc": "\"application/x-tex\"。", + "name": "MIME_TYPE_APPLICATION_X_TEX" + }, + { + "desc": "\"application/x-texinfo\"。", + "name": "MIME_TYPE_APPLICATION_X_TEXINFO" + }, + { + "desc": "\"application/x-troff\"。", + "name": "MIME_TYPE_APPLICATION_X_TROFF" + }, + { + "desc": "\"application/x-ustar\"。", + "name": "MIME_TYPE_APPLICATION_X_USTAR" + }, + { + "desc": "\"application/zip\"。", + "name": "MIME_TYPE_APPLICATION_ZIP" + }, + { + "desc": "\"audio/basic\"。", + "name": "MIME_TYPE_AUDIO_BASIC" + }, + { + "desc": "\"audio/mid\"。", + "name": "MIME_TYPE_AUDIO_MID" + }, + { + "desc": "\"audio/mpeg\"。", + "name": "MIME_TYPE_AUDIO_MPEG" + }, + { + "desc": "\"audio/x-aiff\"。", + "name": "MIME_TYPE_AUDIO_X_AIFF" + }, + { + "desc": "\"audio/x-mpegurl\"。", + "name": "MIME_TYPE_AUDIO_X_MPEGURL" + }, + { + "desc": "\"audio/x-wav\"。", + "name": "MIME_TYPE_AUDIO_X_WAV" + }, + { + "desc": "\"image/bmp\"。", + "name": "MIME_TYPE_IMAGE_BMP" + }, + { + "desc": "\"image/cis-cod\"。", + "name": "MIME_TYPE_IMAGE_CIS_COD" + }, + { + "desc": "\"image/gif\"。", + "name": "MIME_TYPE_IMAGE_GIF" + }, + { + "desc": "\"image/ief\"。", + "name": "MIME_TYPE_IMAGE_IEF" + }, + { + "desc": "\"image/jpeg\"。", + "name": "MIME_TYPE_IMAGE_JPEG" + }, + { + "desc": "\"image/pipeg\"。", + "name": "MIME_TYPE_IMAGE_PIPEG" + }, + { + "desc": "\"image/svg+xml\"。", + "name": "MIME_TYPE_IMAGE_SVG_XML" + }, + { + "desc": "\"image/tiff\"。", + "name": "MIME_TYPE_IMAGE_TIFF" + }, + { + "desc": "\"image/x-cmx\"。", + "name": "MIME_TYPE_IMAGE_X_CMX" + }, + { + "desc": "\"image/x-icon\"。", + "name": "MIME_TYPE_IMAGE_X_ICON" + }, + { + "desc": "\"image/x-rgb\"。", + "name": "MIME_TYPE_IMAGE_X_RGB" + }, + { + "desc": "\"image/x-xbitmap\"。", + "name": "MIME_TYPE_IMAGE_X_XBITMAP" + }, + { + "desc": "\"image/x-xpixmap\"。", + "name": "MIME_TYPE_IMAGE_X_XPIXMAP" + }, + { + "desc": "\"image/x-xwindowdump\"。", + "name": "MIME_TYPE_IMAGE_X_XWINDOWDUMP" + }, + { + "desc": "\"message/rfc822\"。", + "name": "MIME_TYPE_MESSAGE_RFC822" + }, + { + "desc": "\"text/css\"。", + "name": "MIME_TYPE_TEXT_CSS" + }, + { + "desc": "\"text/h323\"。", + "name": "MIME_TYPE_TEXT_H323" + }, + { + "desc": "\"text/html\"。", + "name": "MIME_TYPE_TEXT_HTML" + }, + { + "desc": "\"text/iuls\"。", + "name": "MIME_TYPE_TEXT_IULS" + }, + { + "desc": "\"text/plain\"。", + "name": "MIME_TYPE_TEXT_PLAIN" + }, + { + "desc": "\"text/richtext\"。", + "name": "MIME_TYPE_TEXT_RICHTEXT" + }, + { + "desc": "\"text/scriptlet\"。", + "name": "MIME_TYPE_TEXT_SCRIPTLET" + }, + { + "desc": "\"text/webviewhtml\"。", + "name": "MIME_TYPE_TEXT_WEBVIEWHTML" + }, + { + "desc": "\"text/x-component\"。", + "name": "MIME_TYPE_TEXT_X_COMPONENT" + }, + { + "desc": "\"text/x-setext\"。", + "name": "MIME_TYPE_TEXT_X_SETEXT" + }, + { + "desc": "\"text/x-vcard\"。", + "name": "MIME_TYPE_TEXT_X_VCARD" + }, + { + "desc": "\"video/mpeg\"。", + "name": "MIME_TYPE_VIDEO_MPEG" + }, + { + "desc": "\"video/quicktime\"。", + "name": "MIME_TYPE_VIDEO_QUICKTIME" + }, + { + "desc": "\"video/x-msvideo\"。", + "name": "MIME_TYPE_VIDEO_X_MSVIDEO" } ], - "events": [], - "properties": [ - { - "name": "thread", - "desc": "线程对象。", - "type": "tk_thread_t*", - "annotation": { - "readable": true - } - }, - { - "name": "queue", - "desc": "action queue。", - "type": "waitable_action_queue_t*", - "annotation": { - "readable": true - } - }, - { - "name": "executed_actions_nr", - "desc": "已经执行action的个数。", - "type": "uint32_t", - "annotation": { - "readable": true - } - } - ], - "header": "tkc/action_thread.h", - "desc": "执行action的线程。\n\n> 每个线程都有一个action queue,可以是共享的queue,也可以是私有的queue。", - "name": "action_thread_t", + "header": "tkc/mime_types.h", + "name": "MIME_TYPE", + "prefix": "MIME_TYPE_", + "annotation": { + "scriptable": true, + "string": true + }, "level": 1 }, { @@ -12010,306 +11953,29 @@ "level": 1 }, { - "type": "class", - "methods": [ + "params": [ { - "params": [], - "annotation": { - "constructor": true - }, - "desc": "获取缺省的定时器管理器。", - "name": "timer_manager", - "return": { - "type": "timer_manager_t*", - "desc": "返回定时器管理器对象。" - } + "type": "const wchar_t*", + "name": "s", + "desc": "wchar_t*。" }, { - "params": [ - { - "type": "timer_manager_t*", - "name": "timer_manager_t", - "desc": "定时器管理器对象。" - } - ], - "annotation": {}, - "desc": "设置缺省的定时器管理器。", - "name": "timer_manager_set", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "timer_get_time_t", - "name": "get_time", - "desc": "获取当前时间的函数。" - } - ], - "annotation": { - "constructor": true - }, - "desc": "创建定时器管理器。", - "name": "timer_manager_create", - "return": { - "type": "timer_manager_t*", - "desc": "返回定时器管理器对象。" - } - }, - { - "params": [ - { - "type": "timer_manager_t*", - "name": "timer_manager", - "desc": "定时器管理器对象。" - }, - { - "type": "timer_get_time_t", - "name": "get_time", - "desc": "获取当前时间的函数。" - } - ], - "annotation": { - "constructor": true - }, - "desc": "初始化定时器管理器。", - "name": "timer_manager_init", - "return": { - "type": "timer_manager_t*", - "desc": "返回定时器管理器对象。" - } - }, - { - "params": [ - { - "type": "timer_manager_t*", - "name": "timer_manager", - "desc": "定时器管理器对象。" - } - ], - "annotation": {}, - "desc": "析构定时器管理器。", - "name": "timer_manager_deinit", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "timer_manager_t*", - "name": "timer_manager", - "desc": "定时器管理器对象。" - } - ], - "annotation": {}, - "desc": "析构并释放定时器管理器。", - "name": "timer_manager_destroy", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "timer_manager_t*", - "name": "timer_manager", - "desc": "定时器管理器对象。" - }, - { - "type": "timer_func_t*", - "name": "on_timer", - "desc": "timer回调函数。" - }, - { - "type": "void*", - "name": "ctx", - "desc": "timer回调函数的上下文。" - }, - { - "type": "uint32_t", - "name": "duration", - "desc": "时间。" - } - ], - "annotation": {}, - "desc": "添加定时器。", - "name": "timer_manager_add", - "return": { - "type": "uint32_t", - "desc": "返回timer的ID,TK_INVALID_ID表示失败。" - } - }, - { - "params": [ - { - "type": "timer_manager_t*", - "name": "timer_manager", - "desc": "定时器管理器对象。" - }, - { - "type": "uint32_t", - "name": "timer_id", - "desc": "timer_id。" - } - ], - "annotation": {}, - "desc": "根据id删除定时器。", - "name": "timer_manager_remove", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "timer_manager_t*", - "name": "timer_manager", - "desc": "定时器管理器对象。" - }, - { - "type": "uint32_t*", - "name": "timer_id", - "desc": "timer_id。" - } - ], - "annotation": {}, - "desc": "重置定时器。", - "name": "timer_manager_reset", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "timer_manager_t*", - "name": "timer_manager", - "desc": "定时器管理器对象。" - }, - { - "type": "uint32_t", - "name": "timer_id", - "desc": "timer_id" - } - ], - "annotation": {}, - "desc": "查找指定ID的定时器。", - "name": "timer_manager_find", - "return": { - "type": "timer_info_t*", - "desc": "返回timer的信息。" - } - }, - { - "params": [ - { - "type": "timer_manager_t*", - "name": "timer_manager", - "desc": "定时器管理器对象。" - } - ], - "annotation": {}, - "desc": "返回定时器的个数。", - "name": "timer_manager_count", - "return": { - "type": "uint32_t", - "desc": "返回timer的个数。" - } - }, - { - "params": [ - { - "type": "timer_manager_t*", - "name": "timer_manager", - "desc": "定时器管理器对象。" - } - ], - "annotation": {}, - "desc": "返回最近的定时器到期时间。", - "name": "timer_manager_next_time", - "return": { - "type": "uint64_t", - "desc": "返回最近的timer到期时间。" - } - }, - { - "params": [ - { - "type": "timer_manager_t*", - "name": "timer_manager", - "desc": "定时器管理器对象。。" - }, - { - "type": "timer_info_t*", - "name": "timer", - "desc": "timer对象。" - } - ], - "annotation": {}, - "desc": "追加定时器。", - "name": "timer_manager_append", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } + "type": "wchar_t", + "name": "c", + "desc": "wchar_t。" } ], - "events": [], - "properties": [], - "header": "tkc/timer_manager.h", - "desc": "定时器管理器。", - "name": "timer_manager_t", "annotation": { - "scriptable": true + "global": true }, - "level": 1 - }, - { - "type": "class", - "methods": [ - { - "params": [], - "annotation": { - "scriptable": true, - "static": true - }, - "desc": "获取当前时间(秒)。", - "name": "time_now_s", - "return": { - "type": "uint64_t", - "desc": "返回当前时间(秒)。" - } - }, - { - "params": [], - "annotation": { - "scriptable": true, - "static": true - }, - "desc": "获取当前时间(毫秒)。", - "name": "time_now_ms", - "return": { - "type": "uint64_t", - "desc": "返回当前时间(毫秒)。" - } - } - ], - "events": [], - "properties": [], - "header": "tkc/time_now.h", - "desc": "获取当前时间的函数。\n这里的当前时间是相对的,在嵌入式系统一般相对于开机时间。\n它本身并没有任何意义,一般用来计算时间间隔,如实现定时器和动画等等。", - "name": "time_now_t", - "annotation": { - "scriptable": true, - "fake": true + "desc": "查找字符位置", + "name": "wcs_chr", + "return": { + "type": "const wchar_t*", + "desc": "返回找到c的地址。" }, + "type": "method", + "header": "tkc/wstr.h", "level": 1 }, { @@ -12318,176 +11984,7 @@ { "params": [ { - "type": "tk_thread_entry_t", - "name": "entry", - "desc": "线程函数。" - }, - { - "type": "void*", - "name": "args", - "desc": "线程函数的上下文。" - } - ], - "annotation": {}, - "desc": "创建thread对象。", - "name": "tk_thread_create", - "return": { - "type": "tk_thread_t*", - "desc": "thread对象。" - } - }, - { - "params": [ - { - "type": "tk_thread_t*", - "name": "thread", - "desc": "thread对象。" - }, - { - "type": "const char*", - "name": "name", - "desc": "名称。" - } - ], - "annotation": {}, - "desc": "设置线程的名称。\n\n> 需要在调用start之前调用本函数。", - "name": "tk_thread_set_name", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "tk_thread_t*", - "name": "thread", - "desc": "thread对象。" - }, - { - "type": "uint32_t", - "name": "stack_size", - "desc": "栈的大小。" - } - ], - "annotation": {}, - "desc": "设置线程的栈大小。\n\n> 需要在调用start之前调用本函数。", - "name": "tk_thread_set_stack_size", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "tk_thread_t*", - "name": "thread", - "desc": "thread对象。" - }, - { - "type": "uint32_t", - "name": "priority", - "desc": "优先级。" - } - ], - "annotation": {}, - "desc": "设置线程的优先级。\n\n> 部分平台支持。", - "name": "tk_thread_set_priority", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "tk_thread_t*", - "name": "thread", - "desc": "thread对象。" - } - ], - "annotation": {}, - "desc": "启动线程。", - "name": "tk_thread_start", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "tk_thread_t*", - "name": "thread", - "desc": "thread对象。" - } - ], - "annotation": {}, - "desc": "等待线程退出。\n必须调用 tk_thread_destroy 函数来释放线程资源,以免出现内存泄漏的问题。", - "name": "tk_thread_join", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "tk_thread_t*", - "name": "thread", - "desc": "thread对象。" - } - ], - "annotation": {}, - "desc": "获取线程的参数。", - "name": "tk_thread_get_args", - "return": { - "type": "void*", - "desc": "返回线程的参数。" - } - }, - { - "params": [ - { - "type": "tk_thread_t*", - "name": "thread", - "desc": "thread对象。" - } - ], - "annotation": {}, - "desc": "销毁thread对象。\n在销毁对象前必须调用 tk_thread_join 函数等待退出线程", - "name": "tk_thread_destroy", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [], - "annotation": {}, - "desc": "获取当前线程的原生句柄。", - "name": "tk_thread_self", - "return": { - "type": "uint64_t", - "desc": "返回当前线程的原生句柄。" - } - } - ], - "events": [], - "properties": [], - "header": "tkc/thread.h", - "desc": "线程对象。", - "name": "tk_thread_t", - "level": 1 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "str_t*", + "type": "wstr_t*", "name": "str", "desc": "str对象。" }, @@ -12501,72 +11998,28 @@ "constructor": true }, "desc": "初始化字符串对象。", - "name": "str_init", + "name": "wstr_init", "return": { - "type": "str_t*", + "type": "wstr_t*", "desc": "str对象本身。" } }, { "params": [ { - "type": "str_t*", + "type": "wstr_t*", "name": "str", "desc": "str对象。" }, { - "type": "uint32_t", - "name": "capacity", - "desc": "初始容量。" - } - ], - "annotation": { - "constructor": true - }, - "desc": "扩展字符串到指定的容量。", - "name": "str_extend", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "str_t*", - "name": "str", - "desc": "str对象。" - }, - { - "type": "char*", - "name": "text", - "desc": "待比较的字符串。" - } - ], - "annotation": {}, - "desc": "判断两个字符串是否相等。", - "name": "str_eq", - "return": { - "type": "bool_t", - "desc": "返回是否相等。" - } - }, - { - "params": [ - { - "type": "str_t*", - "name": "str", - "desc": "str对象。" - }, - { - "type": "char*", + "type": "wchar_t*", "name": "text", "desc": "要设置的字符串。" } ], "annotation": {}, "desc": "设置字符串。", - "name": "str_set", + "name": "wstr_set", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" @@ -12575,14 +12028,14 @@ { "params": [ { - "type": "str_t*", + "type": "wstr_t*", "name": "str", "desc": "str对象。" } ], "annotation": {}, "desc": "清除字符串内容。", - "name": "str_clear", + "name": "wstr_clear", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" @@ -12591,7 +12044,7 @@ { "params": [ { - "type": "str_t*", + "type": "wstr_t*", "name": "str", "desc": "str对象。" }, @@ -12599,16 +12052,11 @@ "type": "char*", "name": "text", "desc": "要设置的字符串。" - }, - { - "type": "uint32_t", - "name": "len", - "desc": "字符串长度。" } ], "annotation": {}, - "desc": "设置字符串。", - "name": "str_set_with_len", + "desc": "设置UTF8字符串。", + "name": "wstr_set_utf8", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" @@ -12617,19 +12065,102 @@ { "params": [ { - "type": "str_t*", + "type": "wstr_t*", "name": "str", "desc": "str对象。" }, { "type": "char*", "name": "text", + "desc": "返回的字符串。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "text最大长度。" + } + ], + "annotation": {}, + "desc": "获取UTF8字符串。", + "name": "wstr_get_utf8", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "wstr_t*", + "name": "str", + "desc": "str对象。" + }, + { + "type": "uint32_t", + "name": "offset", + "desc": "指定的位置。" + }, + { + "type": "uint32_t", + "name": "nr", + "desc": "要删除的字符数。" + } + ], + "annotation": {}, + "desc": "删除指定范围的字符。", + "name": "wstr_remove", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "wstr_t*", + "name": "str", + "desc": "str对象。" + }, + { + "type": "uint32_t", + "name": "offset", + "desc": "指定的位置。" + }, + { + "type": "wchar_t*", + "name": "text", + "desc": "待插入的文本。" + }, + { + "type": "uint32_t", + "name": "nr", + "desc": "要插入的字符数。" + } + ], + "annotation": {}, + "desc": "在指定位置插入字符串。", + "name": "wstr_insert", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "wstr_t*", + "name": "str", + "desc": "str对象。" + }, + { + "type": "wchar_t*", + "name": "text", "desc": "要追加的字符串。" } ], "annotation": {}, "desc": "追加字符串。", - "name": "str_append", + "name": "wstr_append", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" @@ -12638,33 +12169,12 @@ { "params": [ { - "type": "str_t*", + "type": "wstr_t*", "name": "str", "desc": "str对象。" }, { - "type": "char*", - "name": "text", - "desc": "要追加的字符串。" - } - ], - "annotation": {}, - "desc": "追加多个字符串。以NULL结束。\n\n示例:\n\n```c\nstr_t s;\nstr_init(&s, 0);\n\nstr_append_more(&s, \"abc\", \"123\", NULL);\nlog_debug(\"%s\\n\", s.str);\n\nstr_reset(&s);\n```", - "name": "str_append_more", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "str_t*", - "name": "str", - "desc": "str对象。" - }, - { - "type": "char*", + "type": "wchar_t*", "name": "text", "desc": "要追加的字符串。" }, @@ -12676,7 +12186,7 @@ ], "annotation": {}, "desc": "追加字符串。", - "name": "str_append_with_len", + "name": "wstr_append_with_len", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" @@ -12685,102 +12195,19 @@ { "params": [ { - "type": "str_t*", + "type": "wstr_t*", "name": "str", "desc": "str对象。" }, { - "type": "uint32_t", - "name": "offset", - "desc": "偏移量。" - }, - { - "type": "char*", - "name": "text", - "desc": "要插入的字符串。" - } - ], - "annotation": {}, - "desc": "插入子字符串。", - "name": "str_insert", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "str_t*", - "name": "str", - "desc": "str对象。" - }, - { - "type": "uint32_t", - "name": "offset", - "desc": "偏移量。" - }, - { - "type": "char*", - "name": "text", - "desc": "要插入的字符串。" - }, - { - "type": "uint32_t", - "name": "len", - "desc": "字符串长度。" - } - ], - "annotation": {}, - "desc": "插入子字符串。", - "name": "str_insert_with_len", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "str_t*", - "name": "str", - "desc": "str对象。" - }, - { - "type": "uint32_t", - "name": "offset", - "desc": "偏移量。" - }, - { - "type": "uint32_t", - "name": "len", - "desc": "长度。" - } - ], - "annotation": {}, - "desc": "删除子字符串。", - "name": "str_remove", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "str_t*", - "name": "str", - "desc": "str对象。" - }, - { - "type": "char", + "type": "wchar_t", "name": "c", - "desc": "要追加的字符。" + "desc": "字符。" } ], "annotation": {}, "desc": "追加一个字符。", - "name": "str_append_char", + "name": "wstr_push", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" @@ -12789,19 +12216,14 @@ { "params": [ { - "type": "str_t*", + "type": "wstr_t*", "name": "str", "desc": "str对象。" - }, - { - "type": "int32_t", - "name": "value", - "desc": "要追加的整数。" } ], "annotation": {}, - "desc": "追加一个整数。", - "name": "str_append_int", + "desc": "删除尾部字符。", + "name": "wstr_pop", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" @@ -12810,71 +12232,24 @@ { "params": [ { - "type": "str_t*", + "type": "wstr_t*", "name": "str", "desc": "str对象。" }, { "type": "const char*", "name": "format", - "desc": "格式。" - }, - { - "type": "double", - "name": "value", - "desc": "要追加的浮点数。" - } - ], - "annotation": {}, - "desc": "追加一个浮点数。", - "name": "str_append_double", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "str_t*", - "name": "str", - "desc": "str对象。" - }, - { - "type": "const char*", - "name": "json_str", - "desc": "待追加的字符串。" - } - ], - "annotation": {}, - "desc": "追加一个字符串,字符串前后加英文双引号,字符串本身的双引号被转义为\\\"。", - "name": "str_append_json_str", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "str_t*", - "name": "str", - "desc": "str对象。" - }, - { - "type": "const char*", - "name": "key", - "desc": "键。" + "desc": "格式(用于snprintf格式化数值)" }, { "type": "int32_t", "name": "value", - "desc": "值。" + "desc": "数值。" } ], "annotation": {}, - "desc": "追加int格式的json键值对。", - "name": "str_append_json_int_pair", + "desc": "追加一个整数。", + "name": "wstr_push_int", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" @@ -12883,164 +12258,28 @@ { "params": [ { - "type": "str_t*", + "type": "wstr_t*", "name": "str", "desc": "str对象。" }, { - "type": "const char*", - "name": "key", - "desc": "键。" - }, - { - "type": "const char*", - "name": "value", - "desc": "值。" - } - ], - "annotation": {}, - "desc": "追加字符串格式的json键值对。", - "name": "str_append_json_str_pair", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "str_t*", - "name": "str", - "desc": "str对象。" - }, - { - "type": "const char*", - "name": "key", - "desc": "键。" - }, - { - "type": "double", - "name": "value", - "desc": "值。" - } - ], - "annotation": {}, - "desc": "追加doube格式的json键值对。", - "name": "str_append_json_double_pair", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "str_t*", - "name": "str", - "desc": "str对象。" - }, - { - "type": "const char*", - "name": "key", - "desc": "键。" - }, - { - "type": "bool_t", - "name": "value", - "desc": "值。" - } - ], - "annotation": {}, - "desc": "追加bool格式的json键值对。", - "name": "str_append_json_bool_pair", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "str_t*", - "name": "str", + "type": "wstr_t*", + "name": "other", "desc": "str对象。" } ], "annotation": {}, - "desc": "删除最后一个字符。", - "name": "str_pop", + "desc": "判断两个字符是否相同。", + "name": "wstr_equal", "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" + "type": "bool_t", + "desc": "返回TRUE表示相同,否则表示不同。" } }, { "params": [ { - "type": "str_t*", - "name": "str", - "desc": "str对象。" - } - ], - "annotation": {}, - "desc": "对字符串进行反转义。如:把\"\\n\"转换成'\\n'。", - "name": "str_unescape", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "str_t*", - "name": "str", - "desc": "str对象。" - }, - { - "type": "char*", - "name": "text", - "desc": "要解码的XML文本。" - } - ], - "annotation": {}, - "desc": "对XML基本的entity进行解码,目前仅支持<>"a;&。", - "name": "str_decode_xml_entity", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "str_t*", - "name": "str", - "desc": "str对象。" - }, - { - "type": "char*", - "name": "text", - "desc": "要解码的XML文本。" - }, - { - "type": "uint32_t", - "name": "len", - "desc": "字符串长度。" - } - ], - "annotation": {}, - "desc": "对XML基本的entity进行解码,目前仅支持<>"a;&。", - "name": "str_decode_xml_entity_with_len", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "str_t*", + "type": "wstr_t*", "name": "str", "desc": "str对象。" }, @@ -13052,7 +12291,7 @@ ], "annotation": {}, "desc": "用整数初始化字符串。", - "name": "str_from_int", + "name": "wstr_from_int", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" @@ -13061,7 +12300,7 @@ { "params": [ { - "type": "str_t*", + "type": "wstr_t*", "name": "str", "desc": "str对象。" }, @@ -13073,7 +12312,7 @@ ], "annotation": {}, "desc": "用浮点数初始化字符串。", - "name": "str_from_float", + "name": "wstr_from_float", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" @@ -13082,7 +12321,7 @@ { "params": [ { - "type": "str_t*", + "type": "wstr_t*", "name": "str", "desc": "str对象。" }, @@ -13094,7 +12333,7 @@ ], "annotation": {}, "desc": "用value初始化字符串。", - "name": "str_from_value", + "name": "wstr_from_value", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" @@ -13103,54 +12342,7 @@ { "params": [ { - "type": "str_t*", - "name": "str", - "desc": "str对象。" - }, - { - "type": "wchar_t*", - "name": "wstr", - "desc": "Unicode字符串。" - } - ], - "annotation": {}, - "desc": "用value初始化字符串。", - "name": "str_from_wstr", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "str_t*", - "name": "str", - "desc": "str对象。" - }, - { - "type": "wchar_t*", - "name": "wstr", - "desc": "Unicode字符串" - }, - { - "type": "uint32_t", - "name": "len", - "desc": "Unicode字符串的长度。" - } - ], - "annotation": {}, - "desc": "用value初始化字符串。", - "name": "str_from_wstr_with_len", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "str_t*", + "type": "wstr_t*", "name": "str", "desc": "str对象。" }, @@ -13162,7 +12354,7 @@ ], "annotation": {}, "desc": "将字符串转成整数。", - "name": "str_to_int", + "name": "wstr_to_int", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" @@ -13171,7 +12363,7 @@ { "params": [ { - "type": "str_t*", + "type": "wstr_t*", "name": "str", "desc": "str对象。" }, @@ -13183,7 +12375,7 @@ ], "annotation": {}, "desc": "将字符串转成浮点数。", - "name": "str_to_float", + "name": "wstr_to_float", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" @@ -13192,193 +12384,93 @@ { "params": [ { - "type": "str_t*", + "type": "wstr_t*", "name": "str", "desc": "str对象。" }, { - "type": "char*", - "name": "text", - "desc": "子字符串。" + "type": "double", + "name": "delta", + "desc": "要加上的值。" } ], "annotation": {}, - "desc": "判断字符串是否以指定的子串结尾。", - "name": "str_end_with", + "desc": "将字符串转成浮点数,加上delta,再转换回来。", + "name": "wstr_add_float", "return": { - "type": "bool_t", - "desc": "返回是否以指定的子串结尾。" + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { - "type": "str_t*", + "type": "wstr_t*", + "name": "str", + "desc": "str对象。" + } + ], + "annotation": {}, + "desc": "去掉浮点数小数点尾部的零。", + "name": "wstr_trim_float_zero", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "wstr_t*", "name": "str", "desc": "str对象。" }, { - "type": "char*", - "name": "text", - "desc": "子字符串。" + "type": "wchar_t", + "name": "newline", + "desc": "换行符。" } ], "annotation": {}, - "desc": "判断字符串是否以指定的子串开头。", - "name": "str_start_with", + "desc": "规范化换行符。", + "name": "wstr_normalize_newline", "return": { - "type": "bool_t", - "desc": "返回是否以指定的子串开头。" + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { - "type": "str_t*", + "type": "wstr_t*", "name": "str", "desc": "str对象。" }, { - "type": "char*", - "name": "text", - "desc": "要去除的字符集合。" + "type": "wchar_t", + "name": "c", + "desc": "字符。" } ], "annotation": {}, - "desc": "去除首尾指定的字符。", - "name": "str_trim", + "desc": "统计指定字符的个数。", + "name": "wstr_count_char", "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" + "type": "uint32_t", + "desc": "返回指定字符的个数。" } }, { "params": [ { - "type": "str_t*", - "name": "str", - "desc": "str对象。" - }, - { - "type": "char*", - "name": "text", - "desc": "要去除的字符集合。" - } - ], - "annotation": {}, - "desc": "去除首部指定的字符。", - "name": "str_trim_left", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "str_t*", - "name": "str", - "desc": "str对象。" - }, - { - "type": "char*", - "name": "text", - "desc": "要去除的字符集合。" - } - ], - "annotation": {}, - "desc": "去除尾部指定的字符。", - "name": "str_trim_right", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "str_t*", - "name": "str", - "desc": "str对象。" - }, - { - "type": "char*", - "name": "text", - "desc": "待替换的子串。" - }, - { - "type": "char*", - "name": "new_text", - "desc": "将替换成的子串。" - } - ], - "annotation": {}, - "desc": "字符串替换。", - "name": "str_replace", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "str_t*", - "name": "str", - "desc": "str对象。" - } - ], - "annotation": {}, - "desc": "将字符串转成小写。", - "name": "str_to_lower", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "str_t*", - "name": "str", - "desc": "str对象。" - } - ], - "annotation": {}, - "desc": "将字符串转成大写。", - "name": "str_to_upper", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "str_t*", - "name": "str", - "desc": "str对象。" - } - ], - "annotation": {}, - "desc": "将字符串中的变量展开为obj中对应的属性值。\n\n变量的格式为${xxx}:\n\n* xxx为变量名时,${xxx}被展开为obj的属性xxx的值。\n* xxx为表达式时,${xxx}被展开为表达式的值,表达式中可以用变量,$为变量的前缀,如${$x+$y}。\n* xxx为变量名时,而不存在obj的属性时,${xxx}被移出。", - "name": "str_expand_vars", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "str_t*", + "type": "wstr_t*", "name": "str", "desc": "str对象。" } ], "annotation": {}, "desc": "重置字符串为空。", - "name": "str_reset", + "name": "wstr_reset", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" @@ -13406,45 +12498,246 @@ { "name": "str", "desc": "字符串。", - "type": "char*", + "type": "wchar_t*", "annotation": { "readable": true } } ], - "header": "tkc/str.h", - "desc": "可变长度的UTF8字符串。\n\n示例:\n\n```c\nstr_t s;\nstr_init(&s, 0);\n\nstr_append(&s, \"abc\");\nstr_append(&s, \"123\");\nlog_debug(\"%s\\n\", s.str);\n\nstr_reset(&s);\n```\n\n> 先调str\\_init进行初始化,最后调用str\\_reset释放内存。", - "name": "str_t", + "header": "tkc/wstr.h", + "desc": "可变长度的宽字符字符串。\n\n示例:\n\n```c\nwstr_t s;\nwstr_init(&s, 0);\n\nwstr_append(&s, L\"abc\");\nwstr_append(&s, L\"123\");\n\nwstr_reset(&s);\n```\n> 先调wstr\\_init进行初始化,最后调用wstr\\_reset释放内存。", + "name": "wstr_t", + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "uint32_t", + "name": "capacity", + "desc": "容量。" + }, + { + "type": "uint32_t", + "name": "block_size", + "desc": "块的大小。" + } + ], + "annotation": { + "constructor": true + }, + "desc": "创建waitable_ring_buffer对象。", + "name": "waitable_ring_buffer_create", + "return": { + "type": "waitable_ring_buffer_t*", + "desc": "waitable_ring_buffer对象。" + } + }, + { + "params": [ + { + "type": "waitable_ring_buffer_t*", + "name": "rb", + "desc": "waitable_ring_buffer对象。" + }, + { + "type": "void*", + "name": "buff", + "desc": "接收数据的buff。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "读取数据的长度(必须等于 block_size)。" + }, + { + "type": "uint32_t", + "name": "timeout_ms", + "desc": "超时时间(ms)" + } + ], + "annotation": {}, + "desc": "读取数据。", + "name": "waitable_ring_buffer_read", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "waitable_ring_buffer_t*", + "name": "rb", + "desc": "waitable_ring_buffer对象。" + }, + { + "type": "const void*", + "name": "buff", + "desc": "要写入的数据。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "数据的长度(必须等于 block_size)。" + }, + { + "type": "uint32_t", + "name": "timeout_ms", + "desc": "超时时间(ms)" + } + ], + "annotation": {}, + "desc": "写入数据。", + "name": "waitable_ring_buffer_write", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "waitable_ring_buffer_t*", + "name": "rb", + "desc": "waitable_ring_buffer对象。" + } + ], + "annotation": {}, + "desc": "销毁。", + "name": "waitable_ring_buffer_destroy", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [], + "properties": [], + "header": "tkc/waitable_ring_buffer.h", + "desc": "waitable ring buffer", + "name": "waitable_ring_buffer_t", + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "uint32_t", + "name": "capacity", + "desc": "action的容量。" + } + ], + "annotation": { + "constructor": true + }, + "desc": "创建waitable_action_queue对象。", + "name": "waitable_action_queue_create", + "return": { + "type": "waitable_action_queue_t*", + "desc": "waitable_action_queue对象。" + } + }, + { + "params": [ + { + "type": "waitable_action_queue_t*", + "name": "q", + "desc": "waitable_action_queue对象。" + }, + { + "type": "qaction_t**", + "name": "action", + "desc": "用于返回action对象。" + }, + { + "type": "uint32_t", + "name": "timeout_ms", + "desc": "超时时间(ms)" + } + ], + "annotation": {}, + "desc": "接收一个请求。", + "name": "waitable_action_queue_recv", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "waitable_action_queue_t*", + "name": "q", + "desc": "waitable_action_queue对象。" + }, + { + "type": "qaction_t*", + "name": "action", + "desc": "action对象。" + }, + { + "type": "uint32_t", + "name": "timeout_ms", + "desc": "超时时间(ms)" + } + ], + "annotation": {}, + "desc": "发送一个请求。", + "name": "waitable_action_queue_send", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "waitable_action_queue_t*", + "name": "q", + "desc": "waitable_action_queue对象。" + } + ], + "annotation": {}, + "desc": "销毁。", + "name": "waitable_action_queue_destroy", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [], + "properties": [], + "header": "tkc/waitable_action_queue.h", + "desc": "waitable actionqueue", + "name": "waitable_action_queue_t", "level": 1 }, { "type": "enum", - "desc": "数据资源类型定义。", + "desc": "字体资源类型定义。", "consts": [ { - "desc": "未知数据类型。", - "name": "ASSET_TYPE_DATA_NONE" + "desc": "无效字体。", + "name": "ASSET_TYPE_FONT_NONE" }, { - "desc": "文本数据类型。", - "name": "ASSET_TYPE_DATA_TEXT" + "desc": "TTF字体。", + "name": "ASSET_TYPE_FONT_TTF" }, { - "desc": "二进制数据类型。", - "name": "ASSET_TYPE_DATA_BIN" - }, - { - "desc": "JSON数据类型。", - "name": "ASSET_TYPE_DATA_JSON" - }, - { - "desc": "通用数据类型。", - "name": "ASSET_TYPE_DATA_DAT" + "desc": "位图字体。", + "name": "ASSET_TYPE_FONT_BMP" } ], "header": "tkc/asset_info.h", - "name": "asset_data_type_t", - "prefix": "ASSET_DATA_TYPE_", + "name": "asset_font_type_t", + "prefix": "ASSET_FONT_TYPE_", "level": 1 }, { @@ -13524,59 +12817,33 @@ "level": 1 }, { - "type": "class", - "methods": [ + "type": "enum", + "desc": "数据资源类型定义。", + "consts": [ { - "params": [ - { - "type": "const str_str_t*", - "name": "items", - "desc": "str_str_t数组。" - }, - { - "type": "const char*", - "name": "name", - "desc": "name。" - } - ], - "annotation": {}, - "desc": "根据name获取对应的value。", - "name": "str_str_value", - "return": { - "type": "const char*", - "desc": "返回value。" - } + "desc": "未知数据类型。", + "name": "ASSET_TYPE_DATA_NONE" }, { - "params": [ - { - "type": "const str_str_t*", - "name": "items", - "desc": "str_str_t数组。" - }, - { - "type": "const char*", - "name": "value", - "desc": "value" - } - ], - "annotation": {}, - "desc": "根据value获取对应的name。", - "name": "str_str_name", - "return": { - "type": "const char*", - "desc": "返回name。" - } + "desc": "文本数据类型。", + "name": "ASSET_TYPE_DATA_TEXT" + }, + { + "desc": "二进制数据类型。", + "name": "ASSET_TYPE_DATA_BIN" + }, + { + "desc": "JSON数据类型。", + "name": "ASSET_TYPE_DATA_JSON" + }, + { + "desc": "通用数据类型。", + "name": "ASSET_TYPE_DATA_DAT" } ], - "events": [], - "properties": [], - "header": "tkc/str_str.h", - "desc": "字符串-字符串类型。\n\n负责把一个字符串映射成另外一个字符串。\n\n示例:\n\n```c\nstatic const str_str_t color_values[] = {{\"1\", \"red\"}, {\"2\", \"black\"}, {\"3\", \"blue\"}, {\"4\", \"white\"}};\nconst char* value = str_str_value(color_values, \"3\");\nconst char* name = str_str_name(color_values, \"blue\", \"0\");\nprintf(\"value = %s \\n\", value);\nprintf(\"name = %s \\n\", name);\n```", - "name": "str_str_t", - "annotation": { - "fake": true - }, + "header": "tkc/asset_info.h", + "name": "asset_data_type_t", + "prefix": "ASSET_DATA_TYPE_", "level": 1 }, { @@ -14747,42 +14014,51 @@ "type": "class", "methods": [ { - "params": [ - { - "type": "const char*", - "name": "name", - "desc": "文件名。" - }, - { - "type": "const char*", - "name": "mode", - "desc": "打开方式。" - } - ], - "annotation": {}, - "desc": "打开文件。", - "name": "rom_fopen", + "params": [], + "annotation": { + "constructor": true + }, + "desc": "创建action_thread对象。", + "name": "action_thread_create", "return": { - "type": "ret_t", - "desc": "返回不是NULL表示成功,否则表示失败。" + "type": "action_thread_t*", + "desc": "action_thread对象。" } }, { "params": [ { - "type": "const uint8_t*", - "name": "data", - "desc": "数据。" + "type": "waitable_action_queue_t*", + "name": "queue", + "desc": "queue对象。" + } + ], + "annotation": { + "constructor": true + }, + "desc": "创建action_thread对象。", + "name": "action_thread_create_with_queue", + "return": { + "type": "action_thread_t*", + "desc": "action_thread对象。" + } + }, + { + "params": [ + { + "type": "action_thread_t*", + "name": "thread", + "desc": "action_thread对象。" }, { - "type": "uint32_t", - "name": "capacity", - "desc": "容量。" + "type": "qaction_t*", + "name": "action", + "desc": "action对象。" } ], "annotation": {}, - "desc": "打开文件。", - "name": "rom_fopen_buff", + "desc": "让线程执行action。", + "name": "action_thread_exec", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" @@ -14791,134 +14067,66 @@ { "params": [ { - "type": "rom_file_t*", - "name": "f", - "desc": "rom_file_t对象。" - } - ], - "annotation": {}, - "desc": "返回文件当前位置。", - "name": "rom_ftell", - "return": { - "type": "long", - "desc": "返回当前位置。" - } - }, - { - "params": [ - { - "type": "rom_file_t*", - "name": "f", - "desc": "rom_file_t对象。" - } - ], - "annotation": {}, - "desc": "判断是否到文件末尾。", - "name": "rom_feof", - "return": { - "type": "int", - "desc": "返回当前位置。" - } - }, - { - "params": [ - { - "type": "rom_file_t*", - "name": "f", - "desc": "rom_file_t对象。" + "type": "action_thread_t*", + "name": "thread", + "desc": "action_thread对象。" }, { - "type": "long", - "name": "offset", - "desc": "偏移量。" + "type": "action_thread_on_idle_t", + "name": "on_idle", + "desc": "空闲时的回调函数。" }, - { - "type": "int", - "name": "whence", - "desc": "要从哪个位置开始偏移, SEEK_SET表示从头开始,SEEK_CUR表示从当前位置开始,SEEK_END表示从文件末尾开始。" - } - ], - "annotation": {}, - "desc": "设置文件当前位置。", - "name": "rom_fseek", - "return": { - "type": "int", - "desc": "返回0表示成功。" - } - }, - { - "params": [ { "type": "void*", - "name": "ptr", - "desc": "数据的缓冲区。" - }, - { - "type": "size_t", - "name": "size", - "desc": "缓冲区大小。" - }, - { - "type": "size_t", - "name": "nitems", - "desc": "元素的个数。" - }, - { - "type": "rom_file_t*", - "name": "f", - "desc": "rom_file_t对象。" + "name": "ctx", + "desc": "回调函数的上下文。" } ], "annotation": {}, - "desc": "读取文件。", - "name": "rom_fread", + "desc": "设置空闲时的回调函数。", + "name": "action_thread_set_on_idle", "return": { - "type": "size_t", - "desc": "返回实际读取的字节数。" + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ + { + "type": "action_thread_t*", + "name": "thread", + "desc": "action_thread对象。" + }, + { + "type": "action_thread_on_quit_t", + "name": "on_quit", + "desc": "退出时的回调函数。" + }, { "type": "void*", - "name": "ptr", - "desc": "数据的缓冲区。" - }, - { - "type": "size_t", - "name": "size", - "desc": "缓冲区大小。" - }, - { - "type": "size_t", - "name": "nitems", - "desc": "元素的个数。" - }, - { - "type": "rom_file_t*", - "name": "f", - "desc": "rom_file_t对象。" + "name": "ctx", + "desc": "回调函数的上下文。" } ], "annotation": {}, - "desc": "写文件。\n> 本函数什么也不做。", - "name": "rom_fwrite", + "desc": "设置退出时的回调函数。", + "name": "action_thread_set_on_quit", "return": { - "type": "size_t", - "desc": "返回实际写的字节数。" + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { - "type": "rom_file_t*", - "name": "f", - "desc": "rom_file_t对象。" + "type": "action_thread_t*", + "name": "thread", + "desc": "action_thread对象。" } ], "annotation": {}, - "desc": "关闭文件。", - "name": "rom_fclose", + "desc": "销毁。", + "name": "action_thread_destroy", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" @@ -14926,13 +14134,35 @@ } ], "events": [], - "properties": [], - "header": "tkc/rom_fs.h", - "desc": "rom_file接口。\n\n> 主要用于给google pinyin输入提供兼容的文件系统API。\n\n示例:\n\n```c\nchar rbuff[100];\nsize_t len = 0;\nconst char* buff = \"hello world\";\nrom_file_t* f = rom_fopen_buff((const uint8_t*)buff, sizeof(buff));\nlen = rom_fread(rbuff, 2, 1, f);\nrom_fclose(f);\n```", - "name": "rom_t", - "annotation": { - "fake": true - }, + "properties": [ + { + "name": "thread", + "desc": "线程对象。", + "type": "tk_thread_t*", + "annotation": { + "readable": true + } + }, + { + "name": "queue", + "desc": "action queue。", + "type": "waitable_action_queue_t*", + "annotation": { + "readable": true + } + }, + { + "name": "executed_actions_nr", + "desc": "已经执行action的个数。", + "type": "uint32_t", + "annotation": { + "readable": true + } + } + ], + "header": "tkc/action_thread.h", + "desc": "执行action的线程。\n\n> 每个线程都有一个action queue,可以是共享的queue,也可以是私有的queue。", + "name": "action_thread_t", "level": 1 }, { @@ -15644,24 +14874,3233 @@ "level": 1 }, { - "params": [ + "type": "class", + "methods": [ { - "type": "const wchar_t*", - "name": "s", - "desc": "源字符串。" + "params": [ + { + "type": "const str_str_t*", + "name": "items", + "desc": "str_str_t数组。" + }, + { + "type": "const char*", + "name": "name", + "desc": "name。" + } + ], + "annotation": {}, + "desc": "根据name获取对应的value。", + "name": "str_str_value", + "return": { + "type": "const char*", + "desc": "返回value。" + } + }, + { + "params": [ + { + "type": "const str_str_t*", + "name": "items", + "desc": "str_str_t数组。" + }, + { + "type": "const char*", + "name": "value", + "desc": "value" + } + ], + "annotation": {}, + "desc": "根据value获取对应的name。", + "name": "str_str_name", + "return": { + "type": "const char*", + "desc": "返回name。" + } } ], + "events": [], + "properties": [], + "header": "tkc/str_str.h", + "desc": "字符串-字符串类型。\n\n负责把一个字符串映射成另外一个字符串。\n\n示例:\n\n```c\nstatic const str_str_t color_values[] = {{\"1\", \"red\"}, {\"2\", \"black\"}, {\"3\", \"blue\"}, {\"4\", \"white\"}};\nconst char* value = str_str_value(color_values, \"3\");\nconst char* name = str_str_name(color_values, \"blue\", \"0\");\nprintf(\"value = %s \\n\", value);\nprintf(\"name = %s \\n\", name);\n```", + "name": "str_str_t", "annotation": { - "global": true + "fake": true }, - "desc": "获取一个新的内存保存s串。", - "name": "wcs_dup", - "return": { - "type": "wchar_t*", - "desc": "返回新的字符串地址。" + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "str_t*", + "name": "str", + "desc": "str对象。" + }, + { + "type": "uint32_t", + "name": "capacity", + "desc": "初始容量。" + } + ], + "annotation": { + "constructor": true + }, + "desc": "初始化字符串对象。", + "name": "str_init", + "return": { + "type": "str_t*", + "desc": "str对象本身。" + } + }, + { + "params": [ + { + "type": "str_t*", + "name": "str", + "desc": "str对象。" + }, + { + "type": "uint32_t", + "name": "capacity", + "desc": "初始容量。" + } + ], + "annotation": { + "constructor": true + }, + "desc": "扩展字符串到指定的容量。", + "name": "str_extend", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "str_t*", + "name": "str", + "desc": "str对象。" + }, + { + "type": "char*", + "name": "text", + "desc": "待比较的字符串。" + } + ], + "annotation": {}, + "desc": "判断两个字符串是否相等。", + "name": "str_eq", + "return": { + "type": "bool_t", + "desc": "返回是否相等。" + } + }, + { + "params": [ + { + "type": "str_t*", + "name": "str", + "desc": "str对象。" + }, + { + "type": "char*", + "name": "text", + "desc": "要设置的字符串。" + } + ], + "annotation": {}, + "desc": "设置字符串。", + "name": "str_set", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "str_t*", + "name": "str", + "desc": "str对象。" + } + ], + "annotation": {}, + "desc": "清除字符串内容。", + "name": "str_clear", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "str_t*", + "name": "str", + "desc": "str对象。" + }, + { + "type": "char*", + "name": "text", + "desc": "要设置的字符串。" + }, + { + "type": "uint32_t", + "name": "len", + "desc": "字符串长度。" + } + ], + "annotation": {}, + "desc": "设置字符串。", + "name": "str_set_with_len", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "str_t*", + "name": "str", + "desc": "str对象。" + }, + { + "type": "char*", + "name": "text", + "desc": "要追加的字符串。" + } + ], + "annotation": {}, + "desc": "追加字符串。", + "name": "str_append", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "str_t*", + "name": "str", + "desc": "str对象。" + }, + { + "type": "char*", + "name": "text", + "desc": "要追加的字符串。" + } + ], + "annotation": {}, + "desc": "追加多个字符串。以NULL结束。\n\n示例:\n\n```c\nstr_t s;\nstr_init(&s, 0);\n\nstr_append_more(&s, \"abc\", \"123\", NULL);\nlog_debug(\"%s\\n\", s.str);\n\nstr_reset(&s);\n```", + "name": "str_append_more", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "str_t*", + "name": "str", + "desc": "str对象。" + }, + { + "type": "char*", + "name": "text", + "desc": "要追加的字符串。" + }, + { + "type": "uint32_t", + "name": "len", + "desc": "字符串长度。" + } + ], + "annotation": {}, + "desc": "追加字符串。", + "name": "str_append_with_len", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "str_t*", + "name": "str", + "desc": "str对象。" + }, + { + "type": "uint32_t", + "name": "offset", + "desc": "偏移量。" + }, + { + "type": "char*", + "name": "text", + "desc": "要插入的字符串。" + } + ], + "annotation": {}, + "desc": "插入子字符串。", + "name": "str_insert", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "str_t*", + "name": "str", + "desc": "str对象。" + }, + { + "type": "uint32_t", + "name": "offset", + "desc": "偏移量。" + }, + { + "type": "char*", + "name": "text", + "desc": "要插入的字符串。" + }, + { + "type": "uint32_t", + "name": "len", + "desc": "字符串长度。" + } + ], + "annotation": {}, + "desc": "插入子字符串。", + "name": "str_insert_with_len", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "str_t*", + "name": "str", + "desc": "str对象。" + }, + { + "type": "uint32_t", + "name": "offset", + "desc": "偏移量。" + }, + { + "type": "uint32_t", + "name": "len", + "desc": "长度。" + } + ], + "annotation": {}, + "desc": "删除子字符串。", + "name": "str_remove", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "str_t*", + "name": "str", + "desc": "str对象。" + }, + { + "type": "char", + "name": "c", + "desc": "要追加的字符。" + } + ], + "annotation": {}, + "desc": "追加一个字符。", + "name": "str_append_char", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "str_t*", + "name": "str", + "desc": "str对象。" + }, + { + "type": "int32_t", + "name": "value", + "desc": "要追加的整数。" + } + ], + "annotation": {}, + "desc": "追加一个整数。", + "name": "str_append_int", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "str_t*", + "name": "str", + "desc": "str对象。" + }, + { + "type": "const char*", + "name": "format", + "desc": "格式。" + }, + { + "type": "double", + "name": "value", + "desc": "要追加的浮点数。" + } + ], + "annotation": {}, + "desc": "追加一个浮点数。", + "name": "str_append_double", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "str_t*", + "name": "str", + "desc": "str对象。" + }, + { + "type": "const char*", + "name": "json_str", + "desc": "待追加的字符串。" + } + ], + "annotation": {}, + "desc": "追加一个字符串,字符串前后加英文双引号,字符串本身的双引号被转义为\\\"。", + "name": "str_append_json_str", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "str_t*", + "name": "str", + "desc": "str对象。" + }, + { + "type": "const char*", + "name": "key", + "desc": "键。" + }, + { + "type": "int32_t", + "name": "value", + "desc": "值。" + } + ], + "annotation": {}, + "desc": "追加int格式的json键值对。", + "name": "str_append_json_int_pair", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "str_t*", + "name": "str", + "desc": "str对象。" + }, + { + "type": "const char*", + "name": "key", + "desc": "键。" + }, + { + "type": "const char*", + "name": "value", + "desc": "值。" + } + ], + "annotation": {}, + "desc": "追加字符串格式的json键值对。", + "name": "str_append_json_str_pair", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "str_t*", + "name": "str", + "desc": "str对象。" + }, + { + "type": "const char*", + "name": "key", + "desc": "键。" + }, + { + "type": "double", + "name": "value", + "desc": "值。" + } + ], + "annotation": {}, + "desc": "追加doube格式的json键值对。", + "name": "str_append_json_double_pair", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "str_t*", + "name": "str", + "desc": "str对象。" + }, + { + "type": "const char*", + "name": "key", + "desc": "键。" + }, + { + "type": "bool_t", + "name": "value", + "desc": "值。" + } + ], + "annotation": {}, + "desc": "追加bool格式的json键值对。", + "name": "str_append_json_bool_pair", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "str_t*", + "name": "str", + "desc": "str对象。" + } + ], + "annotation": {}, + "desc": "删除最后一个字符。", + "name": "str_pop", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "str_t*", + "name": "str", + "desc": "str对象。" + } + ], + "annotation": {}, + "desc": "对字符串进行反转义。如:把\"\\n\"转换成'\\n'。", + "name": "str_unescape", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "str_t*", + "name": "str", + "desc": "str对象。" + }, + { + "type": "char*", + "name": "text", + "desc": "要解码的XML文本。" + } + ], + "annotation": {}, + "desc": "对XML基本的entity进行解码,目前仅支持<>"a;&。", + "name": "str_decode_xml_entity", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "str_t*", + "name": "str", + "desc": "str对象。" + }, + { + "type": "char*", + "name": "text", + "desc": "要解码的XML文本。" + }, + { + "type": "uint32_t", + "name": "len", + "desc": "字符串长度。" + } + ], + "annotation": {}, + "desc": "对XML基本的entity进行解码,目前仅支持<>"a;&。", + "name": "str_decode_xml_entity_with_len", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "str_t*", + "name": "str", + "desc": "str对象。" + }, + { + "type": "int32_t", + "name": "v", + "desc": "整数。" + } + ], + "annotation": {}, + "desc": "用整数初始化字符串。", + "name": "str_from_int", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "str_t*", + "name": "str", + "desc": "str对象。" + }, + { + "type": "double", + "name": "v", + "desc": "浮点数。" + } + ], + "annotation": {}, + "desc": "用浮点数初始化字符串。", + "name": "str_from_float", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "str_t*", + "name": "str", + "desc": "str对象。" + }, + { + "type": "value_t", + "name": "v", + "desc": "value。" + } + ], + "annotation": {}, + "desc": "用value初始化字符串。", + "name": "str_from_value", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "str_t*", + "name": "str", + "desc": "str对象。" + }, + { + "type": "wchar_t*", + "name": "wstr", + "desc": "Unicode字符串。" + } + ], + "annotation": {}, + "desc": "用value初始化字符串。", + "name": "str_from_wstr", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "str_t*", + "name": "str", + "desc": "str对象。" + }, + { + "type": "wchar_t*", + "name": "wstr", + "desc": "Unicode字符串" + }, + { + "type": "uint32_t", + "name": "len", + "desc": "Unicode字符串的长度。" + } + ], + "annotation": {}, + "desc": "用value初始化字符串。", + "name": "str_from_wstr_with_len", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "str_t*", + "name": "str", + "desc": "str对象。" + }, + { + "type": "int32_t*", + "name": "v", + "desc": "用于返回整数。" + } + ], + "annotation": {}, + "desc": "将字符串转成整数。", + "name": "str_to_int", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "str_t*", + "name": "str", + "desc": "str对象。" + }, + { + "type": "double*", + "name": "v", + "desc": "用于返回浮点数。" + } + ], + "annotation": {}, + "desc": "将字符串转成浮点数。", + "name": "str_to_float", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "str_t*", + "name": "str", + "desc": "str对象。" + }, + { + "type": "char*", + "name": "text", + "desc": "子字符串。" + } + ], + "annotation": {}, + "desc": "判断字符串是否以指定的子串结尾。", + "name": "str_end_with", + "return": { + "type": "bool_t", + "desc": "返回是否以指定的子串结尾。" + } + }, + { + "params": [ + { + "type": "str_t*", + "name": "str", + "desc": "str对象。" + }, + { + "type": "char*", + "name": "text", + "desc": "子字符串。" + } + ], + "annotation": {}, + "desc": "判断字符串是否以指定的子串开头。", + "name": "str_start_with", + "return": { + "type": "bool_t", + "desc": "返回是否以指定的子串开头。" + } + }, + { + "params": [ + { + "type": "str_t*", + "name": "str", + "desc": "str对象。" + }, + { + "type": "char*", + "name": "text", + "desc": "要去除的字符集合。" + } + ], + "annotation": {}, + "desc": "去除首尾指定的字符。", + "name": "str_trim", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "str_t*", + "name": "str", + "desc": "str对象。" + }, + { + "type": "char*", + "name": "text", + "desc": "要去除的字符集合。" + } + ], + "annotation": {}, + "desc": "去除首部指定的字符。", + "name": "str_trim_left", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "str_t*", + "name": "str", + "desc": "str对象。" + }, + { + "type": "char*", + "name": "text", + "desc": "要去除的字符集合。" + } + ], + "annotation": {}, + "desc": "去除尾部指定的字符。", + "name": "str_trim_right", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "str_t*", + "name": "str", + "desc": "str对象。" + }, + { + "type": "char*", + "name": "text", + "desc": "待替换的子串。" + }, + { + "type": "char*", + "name": "new_text", + "desc": "将替换成的子串。" + } + ], + "annotation": {}, + "desc": "字符串替换。", + "name": "str_replace", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "str_t*", + "name": "str", + "desc": "str对象。" + } + ], + "annotation": {}, + "desc": "将字符串转成小写。", + "name": "str_to_lower", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "str_t*", + "name": "str", + "desc": "str对象。" + } + ], + "annotation": {}, + "desc": "将字符串转成大写。", + "name": "str_to_upper", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "str_t*", + "name": "str", + "desc": "str对象。" + } + ], + "annotation": {}, + "desc": "将字符串中的变量展开为obj中对应的属性值。\n\n变量的格式为${xxx}:\n\n* xxx为变量名时,${xxx}被展开为obj的属性xxx的值。\n* xxx为表达式时,${xxx}被展开为表达式的值,表达式中可以用变量,$为变量的前缀,如${$x+$y}。\n* xxx为变量名时,而不存在obj的属性时,${xxx}被移出。", + "name": "str_expand_vars", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "str_t*", + "name": "str", + "desc": "str对象。" + } + ], + "annotation": {}, + "desc": "重置字符串为空。", + "name": "str_reset", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [], + "properties": [ + { + "name": "size", + "desc": "长度。", + "type": "uint32_t", + "annotation": { + "readable": true + } + }, + { + "name": "capacity", + "desc": "容量。", + "type": "uint32_t", + "annotation": { + "readable": true + } + }, + { + "name": "str", + "desc": "字符串。", + "type": "char*", + "annotation": { + "readable": true + } + } + ], + "header": "tkc/str.h", + "desc": "可变长度的UTF8字符串。\n\n示例:\n\n```c\nstr_t s;\nstr_init(&s, 0);\n\nstr_append(&s, \"abc\");\nstr_append(&s, \"123\");\nlog_debug(\"%s\\n\", s.str);\n\nstr_reset(&s);\n```\n\n> 先调str\\_init进行初始化,最后调用str\\_reset释放内存。", + "name": "str_t", + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "tk_thread_entry_t", + "name": "entry", + "desc": "线程函数。" + }, + { + "type": "void*", + "name": "args", + "desc": "线程函数的上下文。" + } + ], + "annotation": {}, + "desc": "创建thread对象。", + "name": "tk_thread_create", + "return": { + "type": "tk_thread_t*", + "desc": "thread对象。" + } + }, + { + "params": [ + { + "type": "tk_thread_t*", + "name": "thread", + "desc": "thread对象。" + }, + { + "type": "const char*", + "name": "name", + "desc": "名称。" + } + ], + "annotation": {}, + "desc": "设置线程的名称。\n\n> 需要在调用start之前调用本函数。", + "name": "tk_thread_set_name", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "tk_thread_t*", + "name": "thread", + "desc": "thread对象。" + }, + { + "type": "uint32_t", + "name": "stack_size", + "desc": "栈的大小。" + } + ], + "annotation": {}, + "desc": "设置线程的栈大小。\n\n> 需要在调用start之前调用本函数。", + "name": "tk_thread_set_stack_size", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "tk_thread_t*", + "name": "thread", + "desc": "thread对象。" + }, + { + "type": "uint32_t", + "name": "priority", + "desc": "优先级。" + } + ], + "annotation": {}, + "desc": "设置线程的优先级。\n\n> 部分平台支持。", + "name": "tk_thread_set_priority", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "tk_thread_t*", + "name": "thread", + "desc": "thread对象。" + } + ], + "annotation": {}, + "desc": "启动线程。", + "name": "tk_thread_start", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "tk_thread_t*", + "name": "thread", + "desc": "thread对象。" + } + ], + "annotation": {}, + "desc": "等待线程退出。\n必须调用 tk_thread_destroy 函数来释放线程资源,以免出现内存泄漏的问题。", + "name": "tk_thread_join", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "tk_thread_t*", + "name": "thread", + "desc": "thread对象。" + } + ], + "annotation": {}, + "desc": "获取线程的参数。", + "name": "tk_thread_get_args", + "return": { + "type": "void*", + "desc": "返回线程的参数。" + } + }, + { + "params": [ + { + "type": "tk_thread_t*", + "name": "thread", + "desc": "thread对象。" + } + ], + "annotation": {}, + "desc": "销毁thread对象。\n在销毁对象前必须调用 tk_thread_join 函数等待退出线程", + "name": "tk_thread_destroy", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [], + "annotation": {}, + "desc": "获取当前线程的原生句柄。", + "name": "tk_thread_self", + "return": { + "type": "uint64_t", + "desc": "返回当前线程的原生句柄。" + } + } + ], + "events": [], + "properties": [], + "header": "tkc/thread.h", + "desc": "线程对象。", + "name": "tk_thread_t", + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [], + "annotation": { + "scriptable": true, + "static": true + }, + "desc": "获取当前时间(秒)。", + "name": "time_now_s", + "return": { + "type": "uint64_t", + "desc": "返回当前时间(秒)。" + } + }, + { + "params": [], + "annotation": { + "scriptable": true, + "static": true + }, + "desc": "获取当前时间(毫秒)。", + "name": "time_now_ms", + "return": { + "type": "uint64_t", + "desc": "返回当前时间(毫秒)。" + } + } + ], + "events": [], + "properties": [], + "header": "tkc/time_now.h", + "desc": "获取当前时间的函数。\n这里的当前时间是相对的,在嵌入式系统一般相对于开机时间。\n它本身并没有任何意义,一般用来计算时间间隔,如实现定时器和动画等等。", + "name": "time_now_t", + "annotation": { + "scriptable": true, + "fake": true }, - "type": "method", - "header": "tkc/wstr.h", + "level": 1 + }, + { + "type": "enum", + "desc": "类型常量定义。", + "consts": [ + { + "desc": "无效类型。", + "name": "VALUE_TYPE_INVALID" + }, + { + "desc": "BOOL类型。", + "name": "VALUE_TYPE_BOOL" + }, + { + "desc": "int8_t类型。", + "name": "VALUE_TYPE_INT8" + }, + { + "desc": "uint8_t类型。", + "name": "VALUE_TYPE_UINT8" + }, + { + "desc": "int16_t类型。", + "name": "VALUE_TYPE_INT16" + }, + { + "desc": "uint16_t类型。", + "name": "VALUE_TYPE_UINT16" + }, + { + "desc": "int32_t类型。", + "name": "VALUE_TYPE_INT32" + }, + { + "desc": "uint32_t类型。", + "name": "VALUE_TYPE_UINT32" + }, + { + "desc": "int64_t类型。", + "name": "VALUE_TYPE_INT64" + }, + { + "desc": "uint64_t类型。", + "name": "VALUE_TYPE_UINT64" + }, + { + "desc": "void*类型。", + "name": "VALUE_TYPE_POINTER" + }, + { + "desc": "float_t类型。", + "name": "VALUE_TYPE_FLOAT" + }, + { + "desc": "float类型。", + "name": "VALUE_TYPE_FLOAT32" + }, + { + "desc": "double类型。", + "name": "VALUE_TYPE_DOUBLE" + }, + { + "desc": "char*类型。", + "name": "VALUE_TYPE_STRING" + }, + { + "desc": "wchar_t*类型。", + "name": "VALUE_TYPE_WSTRING" + }, + { + "desc": "object_t*类型。", + "name": "VALUE_TYPE_OBJECT" + }, + { + "desc": "带长度的字符串。", + "name": "VALUE_TYPE_SIZED_STRING" + }, + { + "desc": "二进制数据。", + "name": "VALUE_TYPE_BINARY" + }, + { + "desc": "二进制数据(UBJSON)。", + "name": "VALUE_TYPE_UBJSON" + }, + { + "desc": "特殊用途。", + "name": "VALUE_TYPE_TOKEN" + } + ], + "header": "tkc/value.h", + "name": "value_type_t", + "prefix": "VALUE_TYPE_", + "annotation": { + "scriptable": true + }, + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [], + "annotation": { + "constructor": true + }, + "desc": "获取缺省的定时器管理器。", + "name": "timer_manager", + "return": { + "type": "timer_manager_t*", + "desc": "返回定时器管理器对象。" + } + }, + { + "params": [ + { + "type": "timer_manager_t*", + "name": "timer_manager_t", + "desc": "定时器管理器对象。" + } + ], + "annotation": {}, + "desc": "设置缺省的定时器管理器。", + "name": "timer_manager_set", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "timer_get_time_t", + "name": "get_time", + "desc": "获取当前时间的函数。" + } + ], + "annotation": { + "constructor": true + }, + "desc": "创建定时器管理器。", + "name": "timer_manager_create", + "return": { + "type": "timer_manager_t*", + "desc": "返回定时器管理器对象。" + } + }, + { + "params": [ + { + "type": "timer_manager_t*", + "name": "timer_manager", + "desc": "定时器管理器对象。" + }, + { + "type": "timer_get_time_t", + "name": "get_time", + "desc": "获取当前时间的函数。" + } + ], + "annotation": { + "constructor": true + }, + "desc": "初始化定时器管理器。", + "name": "timer_manager_init", + "return": { + "type": "timer_manager_t*", + "desc": "返回定时器管理器对象。" + } + }, + { + "params": [ + { + "type": "timer_manager_t*", + "name": "timer_manager", + "desc": "定时器管理器对象。" + } + ], + "annotation": {}, + "desc": "析构定时器管理器。", + "name": "timer_manager_deinit", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "timer_manager_t*", + "name": "timer_manager", + "desc": "定时器管理器对象。" + } + ], + "annotation": {}, + "desc": "析构并释放定时器管理器。", + "name": "timer_manager_destroy", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "timer_manager_t*", + "name": "timer_manager", + "desc": "定时器管理器对象。" + }, + { + "type": "timer_func_t*", + "name": "on_timer", + "desc": "timer回调函数。" + }, + { + "type": "void*", + "name": "ctx", + "desc": "timer回调函数的上下文。" + }, + { + "type": "uint32_t", + "name": "duration", + "desc": "时间。" + } + ], + "annotation": {}, + "desc": "添加定时器。", + "name": "timer_manager_add", + "return": { + "type": "uint32_t", + "desc": "返回timer的ID,TK_INVALID_ID表示失败。" + } + }, + { + "params": [ + { + "type": "timer_manager_t*", + "name": "timer_manager", + "desc": "定时器管理器对象。" + }, + { + "type": "uint32_t", + "name": "timer_id", + "desc": "timer_id。" + } + ], + "annotation": {}, + "desc": "根据id删除定时器。", + "name": "timer_manager_remove", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "timer_manager_t*", + "name": "timer_manager", + "desc": "定时器管理器对象。" + }, + { + "type": "uint32_t*", + "name": "timer_id", + "desc": "timer_id。" + } + ], + "annotation": {}, + "desc": "重置定时器。", + "name": "timer_manager_reset", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "timer_manager_t*", + "name": "timer_manager", + "desc": "定时器管理器对象。" + }, + { + "type": "uint32_t", + "name": "timer_id", + "desc": "timer_id" + } + ], + "annotation": {}, + "desc": "查找指定ID的定时器。", + "name": "timer_manager_find", + "return": { + "type": "timer_info_t*", + "desc": "返回timer的信息。" + } + }, + { + "params": [ + { + "type": "timer_manager_t*", + "name": "timer_manager", + "desc": "定时器管理器对象。" + } + ], + "annotation": {}, + "desc": "返回定时器的个数。", + "name": "timer_manager_count", + "return": { + "type": "uint32_t", + "desc": "返回timer的个数。" + } + }, + { + "params": [ + { + "type": "timer_manager_t*", + "name": "timer_manager", + "desc": "定时器管理器对象。" + } + ], + "annotation": {}, + "desc": "返回最近的定时器到期时间。", + "name": "timer_manager_next_time", + "return": { + "type": "uint64_t", + "desc": "返回最近的timer到期时间。" + } + }, + { + "params": [ + { + "type": "timer_manager_t*", + "name": "timer_manager", + "desc": "定时器管理器对象。。" + }, + { + "type": "timer_info_t*", + "name": "timer", + "desc": "timer对象。" + } + ], + "annotation": {}, + "desc": "追加定时器。", + "name": "timer_manager_append", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [], + "properties": [], + "header": "tkc/timer_manager.h", + "desc": "定时器管理器。", + "name": "timer_manager_t", + "annotation": { + "scriptable": true + }, + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "tokenizer_t*", + "name": "tokenizer", + "desc": "tokenizer对象。" + }, + { + "type": "char*", + "name": "str", + "desc": "要解析的字符串。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "字符串长度。" + }, + { + "type": "char*", + "name": "separtor", + "desc": "分隔字符。" + } + ], + "annotation": { + "constructor": true + }, + "desc": "初始化tokenizer对象。", + "name": "tokenizer_init", + "return": { + "type": "tokenizer_t*", + "desc": "tokenizer对象本身。" + } + }, + { + "params": [ + { + "type": "tokenizer_t*", + "name": "tokenizer", + "desc": "tokenizer对象。" + }, + { + "type": "char*", + "name": "str", + "desc": "要解析的字符串。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "字符串长度。" + }, + { + "type": "char*", + "name": "separtor", + "desc": "分隔字符。" + }, + { + "type": "char*", + "name": "single_char_token", + "desc": "单字符token。" + } + ], + "annotation": { + "constructor": true + }, + "desc": "初始化tokenizer对象。", + "name": "tokenizer_init_ex", + "return": { + "type": "tokenizer_t*", + "desc": "tokenizer对象本身。" + } + }, + { + "params": [ + { + "type": "tokenizer_t*", + "name": "tokenizer", + "desc": "tokenizer对象。" + } + ], + "annotation": {}, + "desc": "是否还有下一个token。", + "name": "tokenizer_has_more", + "return": { + "type": "bool_t", + "desc": "还有下一个token返回TRUE,否则返回FALSE。" + } + }, + { + "params": [ + { + "type": "tokenizer_t*", + "name": "tokenizer", + "desc": "tokenizer对象。" + } + ], + "annotation": {}, + "desc": "获取下一个token。", + "name": "tokenizer_next", + "return": { + "type": "char*", + "desc": "成功返回token,失败返回NULL。" + } + }, + { + "params": [ + { + "type": "tokenizer_t*", + "name": "tokenizer", + "desc": "tokenizer对象。" + }, + { + "type": "const char*", + "name": "str", + "desc": "字符集。" + } + ], + "annotation": {}, + "desc": "获取下一个token,该token直到遇到指定的char。", + "name": "tokenizer_next_until", + "return": { + "type": "char*", + "desc": "成功返回token,失败返回NULL。" + } + }, + { + "params": [ + { + "type": "tokenizer_t*", + "name": "tokenizer", + "desc": "tokenizer对象。" + }, + { + "type": "const char*", + "name": "str", + "desc": "字符集。" + } + ], + "annotation": {}, + "desc": "获取下一个expr,该expr直到遇到指定的char。", + "name": "tokenizer_next_expr_until", + "return": { + "type": "char*", + "desc": "成功返回token,失败返回NULL。" + } + }, + { + "params": [ + { + "type": "tokenizer_t*", + "name": "tokenizer", + "desc": "tokenizer对象。" + }, + { + "type": "int", + "name": "defval", + "desc": "缺省值。" + } + ], + "annotation": {}, + "desc": "获取下一个token,并转换成int。", + "name": "tokenizer_next_int", + "return": { + "type": "char*", + "desc": "成功返回token的int值,失败返回缺省值。" + } + }, + { + "params": [ + { + "type": "tokenizer_t*", + "name": "tokenizer", + "desc": "tokenizer对象。" + }, + { + "type": "float", + "name": "defval", + "desc": "缺省值。" + } + ], + "annotation": {}, + "desc": "获取下一个token,并转换成float。", + "name": "tokenizer_next_float", + "return": { + "type": "char*", + "desc": "成功返回token的float值,失败返回缺省值。" + } + }, + { + "params": [ + { + "type": "tokenizer_t*", + "name": "tokenizer", + "desc": "tokenizer对象。" + } + ], + "annotation": {}, + "desc": "重置tokenizer。", + "name": "tokenizer_deinit", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [], + "properties": [ + { + "name": "str", + "desc": "字符串。", + "type": "char*", + "annotation": { + "readable": true + } + }, + { + "name": "size", + "desc": "字符串的长度。", + "type": "uint32_t", + "annotation": { + "readable": true + } + }, + { + "name": "cursor", + "desc": "当前位置。", + "type": "uint32_t", + "annotation": { + "readable": true + } + }, + { + "name": "separtor", + "desc": "分隔字符串。", + "type": "char*", + "annotation": { + "readable": true + } + }, + { + "name": "single_char_token", + "desc": "单字符的token。", + "type": "char*", + "annotation": { + "readable": true + } + } + ], + "header": "tkc/tokenizer.h", + "desc": "从字符串中解析出一个一个的token。\n\n```c\ntokenizer_t tokenizer;\ntokenizer_t* t = tokenizer_init(&tokenizer, \"20,111.2,22.3,333.3,44,555.5\", 0xffffff, \",\");\n\nwhile(tokenizer_has_more(t)) {\ndouble v = tokenizer_next_float(t, 0);\nlog_debug(\"%lf\\n\", v);\n}\n\ntokenizer_deinit(t);\n```", + "name": "tokenizer_t", + "level": 1 + }, + { + "type": "enum", + "desc": "函数返回值常量定义。", + "consts": [ + { + "desc": "成功。", + "name": "RET_OK" + }, + { + "desc": "Out of memory。", + "name": "RET_OOM" + }, + { + "desc": "失败。", + "name": "RET_FAIL" + }, + { + "desc": "没有实现/不支持。", + "name": "RET_NOT_IMPL" + }, + { + "desc": "退出。通常用于主循环。", + "name": "RET_QUIT" + }, + { + "desc": "找到。", + "name": "RET_FOUND" + }, + { + "desc": "对象忙。", + "name": "RET_BUSY" + }, + { + "desc": "移出。通常用于定时器。", + "name": "RET_REMOVE" + }, + { + "desc": "重复。通常用于定时器。", + "name": "RET_REPEAT" + }, + { + "desc": "没找到。", + "name": "RET_NOT_FOUND" + }, + { + "desc": "操作完成。", + "name": "RET_DONE" + }, + { + "desc": "停止后续操作。", + "name": "RET_STOP" + }, + { + "desc": "跳过当前项。", + "name": "RET_SKIP" + }, + { + "desc": "继续后续操作。", + "name": "RET_CONTINUE" + }, + { + "desc": "对象属性变化。", + "name": "RET_OBJECT_CHANGED" + }, + { + "desc": "集合数目变化。", + "name": "RET_ITEMS_CHANGED" + }, + { + "desc": "无效参数。", + "name": "RET_BAD_PARAMS" + }, + { + "desc": "超时。", + "name": "RET_TIMEOUT" + }, + { + "desc": "CRC错误。", + "name": "RET_CRC" + }, + { + "desc": "IO错误。", + "name": "RET_IO" + }, + { + "desc": "End of Stream", + "name": "RET_EOS" + } + ], + "header": "tkc/types_def.h", + "name": "ret_t", + "prefix": "RET_", + "annotation": { + "scriptable": true + }, + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "const wchar_t*", + "name": "in", + "desc": "输入字符串。" + }, + { + "type": "const char*", + "name": "out", + "desc": "输出字符串。" + }, + { + "type": "uint32_t", + "name": "out_size", + "desc": "输出字符串的最大长度。" + } + ], + "annotation": {}, + "desc": "把ucs字符串转成UTF8字符串。", + "name": "tk_utf8_from_utf16", + "return": { + "type": "char*", + "desc": "返回UTF8字符串。" + } + }, + { + "params": [ + { + "type": "const wchar_t*", + "name": "in", + "desc": "输入字符串。" + }, + { + "type": "uint32_t", + "name": "in_size", + "desc": "输入字符串的长度。" + }, + { + "type": "const char*", + "name": "out", + "desc": "输出字符串。" + }, + { + "type": "uint32_t", + "name": "out_size", + "desc": "输出字符串的最大长度。" + } + ], + "annotation": {}, + "desc": "把ucs字符串转成UTF8字符串。", + "name": "tk_utf8_from_utf16_ex", + "return": { + "type": "char*", + "desc": "返回UTF8字符串。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "str", + "desc": "str。" + }, + { + "type": "const wchar_t*", + "name": "out", + "desc": "返回结果缓冲区。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "缓冲区大小。" + } + ], + "annotation": {}, + "desc": "将char类型转换为wchar_t类型。", + "name": "tk_utf8_to_utf16", + "return": { + "type": "wchar_t*", + "desc": "值。" + } + } + ], + "events": [], + "properties": [], + "header": "tkc/utf8.h", + "desc": "wchar_t和char类型转换接口。\n\n示例:\n\n```c\nconst char* str = \"hello\";\nconst wchar_t* wstr = L\"hello\";\nchar res_str[128];\nwchar_t res_wstr[128];\n\ntk_utf8_to_utf16(str, res_wstr, ARRAY_SIZE(res_wstr));\ntk_utf8_from_utf16(wstr, res_str, ARRAY_SIZE(res_str));\n```", + "name": "utf8_t", + "annotation": { + "fake": true + }, + "level": 1 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "const char*", + "name": "str", + "desc": "要转换为整形的字符串。" + } + ], + "annotation": {}, + "desc": "将字符串转换为整形。", + "name": "tk_atoi", + "return": { + "type": "int", + "desc": "返回转换后的整形。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "str", + "desc": "要转换为布尔类型的字符串。" + } + ], + "annotation": {}, + "desc": "将字符串转换为布尔类型。", + "name": "tk_atob", + "return": { + "type": "bool_t", + "desc": "返回转换后的布尔类型。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "str", + "desc": "要转换为浮点类型的字符串。" + } + ], + "annotation": {}, + "desc": "将字符串转换为浮点类型。", + "name": "tk_atof", + "return": { + "type": "double", + "desc": "返回转换后的浮点类型。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "a", + "desc": "要进行比较的第一个字符串。" + }, + { + "type": "const char*", + "name": "b", + "desc": "要进行比较的第二个字符串。" + } + ], + "annotation": {}, + "desc": "字符串比较函数。", + "name": "tk_str_cmp", + "return": { + "type": "int32_t", + "desc": "如果返回值=-1,则表示a为NULL;如果返回值=1,则表示b为NULL;如果返回值<0,则表示a小于b;如果返回值>0,则表示a大于b;如果返回值=0,则表示a等于b。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "a", + "desc": "要进行比较的第一个字符串。" + }, + { + "type": "const char*", + "name": "b", + "desc": "要进行比较的第二个字符串。" + } + ], + "annotation": {}, + "desc": "字符串比较函数(不区分大小写)。", + "name": "tk_str_icmp", + "return": { + "type": "int32_t", + "desc": "如果返回值=-1,则表示a为NULL;如果返回值=1,则表示b为NULL;如果返回值<0,则表示a小于b;如果返回值>0,则表示a大于b;如果返回值=0,则表示a等于b。" + } + }, + { + "params": [ + { + "type": "const wchar_t*", + "name": "str", + "desc": "要转换为整形的宽字符串。" + } + ], + "annotation": {}, + "desc": "将宽字符串转换为整形。", + "name": "tk_watoi", + "return": { + "type": "int", + "desc": "返回转换后的整形。" + } + }, + { + "params": [ + { + "type": "const wchar_t*", + "name": "str", + "desc": "要转换为整形的宽字符串。" + }, + { + "type": "uint32_t", + "name": "len", + "desc": "字符串长度。" + } + ], + "annotation": {}, + "desc": "将宽字符串转换为整形。", + "name": "tk_watoi_n", + "return": { + "type": "int", + "desc": "返回转换后的整形。" + } + }, + { + "params": [ + { + "type": "const wchar_t*", + "name": "str", + "desc": "要转换为布尔类型的宽字符串。" + } + ], + "annotation": {}, + "desc": "将宽字符串转换为布尔类型。", + "name": "tk_watob", + "return": { + "type": "bool_t", + "desc": "返回转换后的布尔类型。" + } + }, + { + "params": [ + { + "type": "const wchar_t*", + "name": "str", + "desc": "要转换为浮点类型的宽字符串。" + } + ], + "annotation": {}, + "desc": "将宽字符串转换为浮点类型。", + "name": "tk_watof", + "return": { + "type": "double", + "desc": "返回转换后的浮点类型。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "str", + "desc": "要输入的原始字符串。" + } + ], + "annotation": {}, + "desc": "跳过字符串函数,如:字符串\"hello123world\",返回的结果是\"123world\"。", + "name": "tk_skip_to_num", + "return": { + "type": "const char*", + "desc": "返回转换后的字符串。" + } + }, + { + "params": [ + { + "type": "char*", + "name": "str", + "desc": "保存字符串缓冲区。" + }, + { + "type": "int", + "name": "len", + "desc": "缓冲区大小。" + }, + { + "type": "int", + "name": "n", + "desc": "要转换的整形。" + } + ], + "annotation": {}, + "desc": "将整形转换为字符串。", + "name": "tk_itoa", + "return": { + "type": "const char*", + "desc": "返回字符串。" + } + }, + { + "params": [ + { + "type": "char*", + "name": "str", + "desc": "保存字符串缓冲区。" + }, + { + "type": "int", + "name": "len", + "desc": "缓冲区大小。" + }, + { + "type": "double", + "name": "f", + "desc": "要转换的浮点型。" + } + ], + "annotation": {}, + "desc": "将浮点型转换为字符串。", + "name": "tk_ftoa", + "return": { + "type": "const char*", + "desc": "返回字符串。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "str", + "desc": "要转换为长整形的字符串。" + }, + { + "type": "const char**", + "name": "end", + "desc": "对类型char*的对象的引用。" + }, + { + "type": "int", + "name": "base", + "desc": "基数。" + } + ], + "annotation": {}, + "desc": "将字符串转换为长整形。", + "name": "tk_strtol", + "return": { + "type": "long", + "desc": "返回转换后的长整形。" + } + }, + { + "params": [ + { + "type": "char*", + "name": "dst", + "desc": "目标字符串。" + }, + { + "type": "const char*", + "name": "src", + "desc": "原字符串。" + } + ], + "annotation": {}, + "desc": "将src所指向的字符串复制到dst。", + "name": "tk_strcpy", + "return": { + "type": "char*", + "desc": "返回目标字符串。" + } + }, + { + "params": [ + { + "type": "char*", + "name": "dst", + "desc": "目标字符串。" + }, + { + "type": "const char*", + "name": "src", + "desc": "原字符串。" + }, + { + "type": "size_t", + "name": "len", + "desc": "要复制的字符串个数。" + } + ], + "annotation": {}, + "desc": "将src所指向的字符串复制到dst,最多复制len个字符串,并在[len]位置添加'\\0'。\n\n> 请确保dst的长度>=(len+1)", + "name": "tk_strncpy", + "return": { + "type": "char*", + "desc": "返回目标字符串。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "str", + "desc": "原字符串。" + } + ], + "annotation": {}, + "desc": "字符串拷贝函数。", + "name": "tk_strdup", + "return": { + "type": "char*", + "desc": "返回指向的复制字符串指针,如果失败则返回NULL。" + } + }, + { + "params": [ + { + "type": "const wchar_t*", + "name": "str", + "desc": "原宽字符串。" + } + ], + "annotation": {}, + "desc": "宽字符串拷贝函数。", + "name": "tk_wstrdup", + "return": { + "type": "wchar_t*", + "desc": "返回指向的复制宽字符串指针,如果失败则返回NULL。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "str", + "desc": "原字符串。" + }, + { + "type": "uint32_t", + "name": "len", + "desc": "要复制的字符串个数。" + } + ], + "annotation": {}, + "desc": "字符串拷贝函数,最多复制len个字符串。", + "name": "tk_strndup", + "return": { + "type": "char*", + "desc": "返回指向的复制字符串指针,如果失败则返回NULL。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "str", + "desc": "字符串。" + } + ], + "annotation": {}, + "desc": "获取字符串的长度。str为空时返回0。", + "name": "tk_strlen", + "return": { + "type": "uint32_t", + "desc": "返回字符串的长度。" + } + }, + { + "params": [ + { + "type": "char*", + "name": "str", + "desc": "被追加字符串。" + }, + { + "type": "uint32_t", + "name": "max_len", + "desc": "字符串的最大长度。" + }, + { + "type": "const char*", + "name": "s", + "desc": "要追加的字符串。" + } + ], + "annotation": {}, + "desc": "字符串追加函数。", + "name": "tk_str_append", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "uint16_t*", + "name": "buff", + "desc": "buff" + }, + { + "type": "uint16_t", + "name": "val", + "desc": "值。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "个数。" + } + ], + "annotation": {}, + "desc": "设置数据2字节。", + "name": "tk_memset16", + "return": { + "type": "uint16_t*", + "desc": "返回设置好的buff。" + } + }, + { + "params": [ + { + "type": "uint32_t*", + "name": "buff", + "desc": "buff。" + }, + { + "type": "void*", + "name": "val", + "desc": "值。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "个数。" + } + ], + "annotation": {}, + "desc": "设置数据3字节。", + "name": "tk_memset24", + "return": { + "type": "uint32_t*", + "desc": "返回设置好的buff。" + } + }, + { + "params": [ + { + "type": "uint32_t*", + "name": "buff", + "desc": "buff。" + }, + { + "type": "uint32_t", + "name": "val", + "desc": "值。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "个数。" + } + ], + "annotation": {}, + "desc": "设置数据4字节。", + "name": "tk_memset32", + "return": { + "type": "uint32_t*", + "desc": "返回设置好的buff。" + } + }, + { + "params": [ + { + "type": "uint16_t*", + "name": "dst", + "desc": "目标" + }, + { + "type": "uint16_t*", + "name": "src", + "desc": "源。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "个数。" + } + ], + "annotation": {}, + "desc": "拷贝数据2字节。", + "name": "tk_memcpy16", + "return": { + "type": "uint16_t*", + "desc": "返回设置好的buff。" + } + }, + { + "params": [ + { + "type": "uint32_t*", + "name": "dst", + "desc": "目标" + }, + { + "type": "uint32_t*", + "name": "src", + "desc": "源。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "个数。" + } + ], + "annotation": {}, + "desc": "拷贝数据4字节。", + "name": "tk_memcpy32", + "return": { + "type": "uint32_t*", + "desc": "返回设置好的buff。" + } + }, + { + "params": [ + { + "type": "void*", + "name": "dst", + "desc": "目标" + }, + { + "type": "void*", + "name": "src", + "desc": "源。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "个数。" + }, + { + "type": "uint8_t", + "name": "bpp", + "desc": "单个数据的字节数。" + } + ], + "annotation": {}, + "desc": "已bpp字节为标准拷贝数据。", + "name": "tk_pixel_copy", + "return": { + "type": "void*", + "desc": "返回设置好的buff。" + } + }, + { + "params": [ + { + "type": "char*", + "name": "str", + "desc": "目标字符串。" + }, + { + "type": "size_t", + "name": "size", + "desc": "拷贝字节数。" + }, + { + "type": "const char*", + "name": "format", + "desc": "格式化字符串。" + } + ], + "annotation": {}, + "desc": "将可变参数(...)按照format格式化字符串,并将字符串复制到str中。", + "name": "tk_snprintf", + "return": { + "type": "int", + "desc": "返回格式化后的字符串长度+1。" + } + }, + { + "params": [ + { + "type": "char*", + "name": "str", + "desc": "要输入的字符串。" + }, + { + "type": "const char*", + "name": "format", + "desc": "格式化字符串。" + } + ], + "annotation": {}, + "desc": "从字符串读取格式化输入。", + "name": "tk_sscanf", + "return": { + "type": "int", + "desc": "返回成功匹配和赋值的个数。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "filename", + "desc": "完整的文件名。" + }, + { + "type": "char*", + "name": "str", + "desc": "用于返回文件名。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "文件名(str参数)的最大长度。" + } + ], + "annotation": {}, + "desc": "从完整文件名中获取文件名。", + "name": "filename_to_name", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "filename", + "desc": "完整的文件名。" + }, + { + "type": "char*", + "name": "str", + "desc": "用于返回文件名。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "文件名(str参数)的最大长度。" + }, + { + "type": "bool_t", + "name": "remove_extname", + "desc": "是否移除扩展名。" + } + ], + "annotation": {}, + "desc": "从完整文件名中获取文件名。", + "name": "filename_to_name_ex", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "filename", + "desc": "文件名。" + }, + { + "type": "str_t*", + "name": "s", + "desc": "用于返回内容。" + } + ], + "annotation": {}, + "desc": "expand include process instruction to file content: ", + "name": "xml_file_expand_read", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "dst", + "desc": "目标字符串。" + }, + { + "type": "const char*", + "name": "src", + "desc": "源字符串。" + } + ], + "annotation": {}, + "desc": "字符串拷贝函数。\n> XXX: 要求dst为NULL或内存块的首地址,本函数调用之后,dst可能无效,请保留返回的地址", + "name": "tk_str_copy", + "return": { + "type": "char*", + "desc": "返回指向的复制字符串指针,如果失败则返回NULL。" + } + }, + { + "params": [ + { + "type": "void*", + "name": "data", + "desc": "数据。" + } + ], + "annotation": {}, + "desc": "空的destroy函数。", + "name": "dummy_destroy", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "void*", + "name": "data", + "desc": "数据。" + } + ], + "annotation": {}, + "desc": "缺省的destroy函数。释放data指向的内存。", + "name": "default_destroy", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "const void*", + "name": "a", + "desc": "数据a。" + }, + { + "type": "const void*", + "name": "b", + "desc": "数据b。" + } + ], + "annotation": {}, + "desc": "指针比较。", + "name": "pointer_compare", + "return": { + "type": "int", + "desc": "返回0表示相等,返回负数表示小于,返回整数表示大于。" + } + }, + { + "params": [ + { + "type": "const void*", + "name": "a", + "desc": "数据a。" + }, + { + "type": "const void*", + "name": "b", + "desc": "数据b。" + } + ], + "annotation": {}, + "desc": "始终返回相等。", + "name": "compare_always_equal", + "return": { + "type": "int", + "desc": "始终返回0。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "name", + "desc": "名字字符串。" + } + ], + "annotation": {}, + "desc": "判断是否是有效的属性名。", + "name": "tk_is_valid_name", + "return": { + "type": "bool_t", + "desc": "如果名称有效返回TRUE,否则返回FALSE。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "str", + "desc": "要检查字符串。" + }, + { + "type": "const char*", + "name": "prefix", + "desc": "被检查的字符串。" + } + ], + "annotation": {}, + "desc": "检查字符串是否以指定的字符串prefix开头。", + "name": "tk_str_start_with", + "return": { + "type": "bool_t", + "desc": "返回TRUE表示是;否则表示不是。" + } + }, + { + "params": [ + { + "type": "const char*", + "name": "name", + "desc": "下划线名字。" + }, + { + "type": "char*", + "name": "out", + "desc": "驼峰名字(保存结果)。" + }, + { + "type": "uint32_t", + "name": "max_out_size", + "desc": "结果最大长度。" + } + ], + "annotation": {}, + "desc": "将下划线名字转成驼峰名字。", + "name": "tk_under_score_to_camel", + "return": { + "type": "const char*", + "desc": "返回T驼峰名字。" + } + }, + { + "params": [ + { + "type": "const void*", + "name": "p", + "desc": "指针。" + } + ], + "annotation": {}, + "desc": "将指针转换成int。\n\n>与tk_pointer_from_int配套使用,也就是pointer本身必须就是整数,而不是指针,否则pointer会被截断。", + "name": "tk_pointer_to_int", + "return": { + "type": "int32_t", + "desc": "返回对应的int数据。" + } + }, + { + "params": [ + { + "type": "int32_t", + "name": "v", + "desc": "整数。" + } + ], + "annotation": {}, + "desc": "将int转换成指针。\n\n> 常用于将int类型的数据作为回调函数的ctx。", + "name": "tk_pointer_from_int", + "return": { + "type": "void*", + "desc": "返回对应的指针。" + } + }, + { + "params": [ + { + "type": "char*", + "name": "str", + "desc": "要被转换成大写字母的字符串。" + } + ], + "annotation": {}, + "desc": "将小写字母转换为大写字母。", + "name": "tk_str_toupper", + "return": { + "type": "char*", + "desc": "返回转换后的大写字母字符串。" + } + }, + { + "params": [ + { + "type": "char*", + "name": "str", + "desc": "要被转换成小写字母的字符串。" + } + ], + "annotation": {}, + "desc": "将大写字母转换为小写字母。", + "name": "tk_str_tolower", + "return": { + "type": "char*", + "desc": "返回转换后的小写字母字符串。" + } + }, + { + "params": [ + { + "type": "char*", + "name": "str", + "desc": "utf8编码的字符串。" + } + ], + "annotation": {}, + "desc": "将utf8字符串拷贝为UCS字符串。", + "name": "tk_wstr_dup_utf8", + "return": { + "type": "wchar_t*", + "desc": "返回UCS字符串(需要调用TKMEM_FREE释放)。" + } + }, + { + "params": [ + { + "type": "const wchar_t*", + "name": "str", + "desc": "字符串。" + }, + { + "type": "wchar_t", + "name": "c", + "desc": "字符。" + } + ], + "annotation": {}, + "desc": "统计UCS字符串中某个字符出现的次数。", + "name": "tk_wstr_count_c", + "return": { + "type": "uint32_t", + "desc": "返回字符出现的次数。" + } + }, + { + "params": [ + { + "type": "uint32_t", + "name": "img_w", + "desc": "图片宽度。" + }, + { + "type": "uint32_t", + "name": "img_h", + "desc": "图片宽度。" + }, + { + "type": "const char*", + "name": "region", + "desc": "region。" + }, + { + "type": "rect_t*", + "name": "r", + "desc": "返回具体位置。" + } + ], + "annotation": {}, + "desc": "解析子图的区域信息。", + "name": "image_region_parse", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [], + "properties": [], + "header": "tkc/utils.h", + "desc": "工具类。", + "name": "utils_t", + "annotation": { + "fake": true + }, + "level": 1 + }, + { + "type": "enum", + "desc": "属性描述类型常量定义。", + "consts": [ + { + "desc": "有符号8位整数类型。", + "name": "VALUE_DESC_TYPE_INT8" + }, + { + "desc": "无符号8位整数类型。", + "name": "VALUE_DESC_TYPE_UINT8" + }, + { + "desc": "有符号16位整数类型。", + "name": "VALUE_DESC_TYPE_INT16" + }, + { + "desc": "无符号16位整数类型。", + "name": "VALUE_DESC_TYPE_UINT16" + }, + { + "desc": "有符号32位整数类型。", + "name": "VALUE_DESC_TYPE_INT32" + }, + { + "desc": "无符号32位整数类型。", + "name": "VALUE_DESC_TYPE_UINT32" + }, + { + "desc": "有符号64位整数类型。", + "name": "VALUE_DESC_TYPE_INT64" + }, + { + "desc": "无符号64位整数类型。", + "name": "VALUE_DESC_TYPE_UINT64" + }, + { + "desc": "单精度浮点数类型。", + "name": "VALUE_DESC_TYPE_FLOAT" + }, + { + "desc": "双精度浮点数类型。", + "name": "VALUE_DESC_TYPE_DOUBLE" + }, + { + "desc": "布尔类型。", + "name": "VALUE_DESC_TYPE_BOOL" + }, + { + "desc": "字符串类型。", + "name": "VALUE_DESC_TYPE_STRING" + }, + { + "desc": "二进制类型。", + "name": "VALUE_DESC_TYPE_BINARY" + }, + { + "desc": "整数枚举类型。", + "name": "VALUE_DESC_TYPE_INT_ENUMS" + }, + { + "desc": "字符串枚举类型。", + "name": "VALUE_DESC_TYPE_STRING_ENUMS" + } + ], + "header": "tkc/value_desc.h", + "name": "value_desc_type_t", + "prefix": "VALUE_DESC_TYPE_", + "level": 1 + }, + { + "type": "enum", + "desc": "属性描述格式常量定义。", + "consts": [ + { + "desc": "无特殊格式。", + "name": "VALUE_FORMAT_TYPE_NONE" + }, + { + "desc": "16进制格式。", + "name": "VALUE_FORMAT_TYPE_HEX" + }, + { + "desc": "非负格式(用于进一步限制float/double)。", + "name": "VALUE_FORMAT_TYPE_HEX" + }, + { + "desc": "手机号码格式。", + "name": "VALUE_FORMAT_TYPE_PHONE" + }, + { + "desc": "邮件格式。", + "name": "VALUE_FORMAT_TYPE_PHONE" + }, + { + "desc": "ip4地址格式。", + "name": "VALUE_FORMAT_TYPE_IP4_ADDRESS" + }, + { + "desc": "域名格式。", + "name": "VALUE_FORMAT_TYPE_DOMAIN_NAME" + }, + { + "desc": "URL格式。", + "name": "VALUE_FORMAT_TYPE_URL" + }, + { + "desc": "JSON格式。", + "name": "VALUE_FORMAT_TYPE_JSON" + }, + { + "desc": "XML格式。", + "name": "VALUE_FORMAT_TYPE_XML" + }, + { + "desc": "UBJSON格式。", + "name": "VALUE_FORMAT_TYPE_UBJSON" + } + ], + "header": "tkc/value_desc.h", + "name": "value_format_type_t", + "prefix": "VALUE_FORMAT_TYPE_", + "level": 1 + }, + { + "type": "enum", + "desc": "属性描述范围常量定义。", + "consts": [ + { + "desc": "单个对象的属性。", + "name": "PROP_DESC_FLAG_OBJECT" + }, + { + "desc": "同一个类所有实例共享属性。", + "name": "PROP_DESC_FLAG_CLASS" + }, + { + "desc": "全局属性。", + "name": "PROP_DESC_FLAG_GLOBAL" + }, + { + "desc": "可读取。", + "name": "PROP_DESC_FLAG_READABLE," + }, + { + "desc": "可修改。", + "name": "PROP_DESC_FLAG_WRITBALE," + }, + { + "desc": "可配置。", + "name": "PROP_DESC_FLAG_CONFIGURABLE" + }, + { + "desc": "需要持久化。", + "name": "PROP_DESC_FLAG_PERSISTENT" + } + ], + "header": "tkc/value_desc.h", + "name": "prop_desc_flags_t", + "prefix": "PROP_DESC_FLAGS_", + "level": 1 + }, + { + "type": "enum", + "desc": "参数描述范围常量定义。", + "consts": [ + { + "desc": "必须提供。", + "name": "ARG_DESC_FLAGS_REQUIRED" + } + ], + "header": "tkc/value_desc.h", + "name": "arg_desc_flags_t", + "prefix": "ARG_DESC_FLAGS_", + "level": 1 + }, + { + "type": "class", + "methods": [], + "events": [], + "properties": [ + { + "name": "type", + "desc": "类型。", + "type": "uint8_t", + "annotation": { + "readable": true + } + }, + { + "name": "format", + "desc": "格式。", + "type": "uint8_t", + "annotation": { + "readable": true + } + }, + { + "name": "flags", + "desc": "flags。", + "type": "uint8_t", + "annotation": { + "readable": true + } + }, + { + "name": "name", + "desc": "名称。", + "type": "const char*", + "annotation": { + "readable": true + } + }, + { + "name": "display_name", + "desc": "显示名称。", + "type": "const char*", + "annotation": { + "readable": true + } + }, + { + "name": "desc", + "desc": "描述。", + "type": "const char*", + "annotation": { + "readable": true + } + } + ], + "header": "tkc/value_desc.h", + "desc": "属性描述。", + "name": "value_desc_t", "level": 1 }, { @@ -15672,294 +18111,24 @@ { "name": "defvalue", "desc": "缺省值。", - "type": "uint32_t", + "type": "const char*", "annotation": { "readable": true } }, { - "name": "min", - "desc": "最小值。", - "type": "uint32_t", - "annotation": { - "readable": true - } - }, - { - "name": "max", - "desc": "最大值。", - "type": "uint32_t", - "annotation": { - "readable": true - } - }, - { - "name": "step", - "desc": "步长。", - "type": "uint32_t", - "annotation": { - "readable": true - } - }, - { - "name": "unit", - "desc": "单位。", - "type": "const char*", + "name": "enums", + "desc": "枚举值。", + "type": "const char**", "annotation": { "readable": true } } ], "header": "tkc/value_desc.h", - "desc": "无符号32位整数类型属性描述。", - "name": "value_desc_uint32_t", - "parent": "value_desc_t", - "level": 2 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "event_source_manager_t*", - "name": "manager", - "desc": "event_source_manager对象。" - } - ], - "annotation": {}, - "desc": "创建事件源管理器。", - "name": "event_source_manager_default_create", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - } - ], - "events": [], - "properties": [], - "header": "tkc/event_source_manager_default.h", - "desc": "缺省的事件源管理器。", - "name": "event_source_manager_default_t", - "parent": "event_source_manager_t", - "annotation": { - "fake": true - }, - "level": 2 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "event_t*", - "name": "event", - "desc": "event对象。" - } - ], - "annotation": { - "cast": true, - "scriptable": true - }, - "desc": "把event对象转prop_change_event_t对象,主要给脚本语言使用。", - "name": "prop_change_event_cast", - "return": { - "type": "prop_change_event_t*", - "desc": "返回event对象。" - } - }, - { - "params": [ - { - "type": "prop_change_event_t*", - "name": "event", - "desc": "event对象。" - }, - { - "type": "uint32_t", - "name": "type", - "desc": "事件类型。" - }, - { - "type": "const char*", - "name": "name", - "desc": "属性名。" - }, - { - "type": "const value_t*", - "name": "value", - "desc": "属性的值。" - } - ], - "annotation": {}, - "desc": "初始prop change event。", - "name": "prop_change_event_init", - "return": { - "type": "event_t*", - "desc": "返回event对象。" - } - } - ], - "events": [], - "properties": [ - { - "name": "name", - "desc": "属性的名称。", - "type": "const char*", - "annotation": { - "readable": true, - "scriptable": true - } - }, - { - "name": "value", - "desc": "属性的值。", - "type": "const value_t*", - "annotation": { - "readable": true, - "scriptable": true - } - } - ], - "header": "tkc/event.h", - "desc": "对象属性变化事件。", - "name": "prop_change_event_t", - "annotation": { - "scriptable": true - }, - "parent": "event_t", - "level": 2 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "event_t*", - "name": "event", - "desc": "event对象。" - } - ], - "annotation": { - "cast": true, - "scriptable": true - }, - "desc": "把event对象转progress_event_t对象,主要给脚本语言使用。", - "name": "progress_event_cast", - "return": { - "type": "progress_event_t*", - "desc": "返回event对象。" - } - }, - { - "params": [ - { - "type": "progress_event_t*", - "name": "event", - "desc": "event对象。" - }, - { - "type": "uint32_t", - "name": "percent", - "desc": "进度。" - } - ], - "annotation": {}, - "desc": "初始progress event。", - "name": "progress_event_init", - "return": { - "type": "event_t*", - "desc": "返回event对象。" - } - } - ], - "events": [], - "properties": [ - { - "name": "percent", - "desc": "进度百分比。", - "type": "uint32_t", - "annotation": { - "readable": true, - "scriptable": true - } - } - ], - "header": "tkc/event.h", - "desc": "进度变化事件。", - "name": "progress_event_t", - "annotation": { - "scriptable": true - }, - "parent": "event_t", - "level": 2 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "event_t*", - "name": "event", - "desc": "event对象。" - } - ], - "annotation": { - "cast": true, - "scriptable": true - }, - "desc": "把event对象转done_event_t对象,主要给脚本语言使用。", - "name": "done_event_cast", - "return": { - "type": "done_event_t*", - "desc": "返回event对象。" - } - }, - { - "params": [ - { - "type": "done_event_t*", - "name": "event", - "desc": "event对象。" - }, - { - "type": "ret_t", - "name": "result", - "desc": "结果。" - } - ], - "annotation": {}, - "desc": "初始done event。", - "name": "done_event_init", - "return": { - "type": "event_t*", - "desc": "返回event对象。" - } - } - ], - "events": [], - "properties": [ - { - "name": "result", - "desc": "执行结果。", - "type": "ret_t", - "annotation": { - "readable": true, - "scriptable": true - } - } - ], - "header": "tkc/event.h", - "desc": "执行完成事件。", - "name": "done_event_t", - "annotation": { - "scriptable": true - }, - "parent": "event_t", - "level": 2 + "desc": "字符串枚举类型属性描述。", + "name": "value_desc_string_enums_t", + "level": 1 }, { "type": "class", @@ -15975,322 +18144,6 @@ }, "level": 2 }, - { - "type": "class", - "methods": [], - "events": [], - "properties": [], - "header": "tkc/mem_allocator_simple.h", - "desc": "简单的内存分配器。", - "name": "mem_allocator_simple_t", - "parent": "mem_allocator_t", - "level": 2 - }, - { - "type": "class", - "methods": [], - "events": [], - "properties": [], - "header": "tkc/mem_allocator_pool.h", - "desc": "对现有的allocator进行包装,预先分配一部分内存,用于分配小块内存,可以避免内存碎片。", - "name": "mem_allocator_pool_t", - "parent": "mem_allocator_t", - "level": 2 - }, - { - "type": "class", - "methods": [], - "events": [], - "properties": [], - "header": "tkc/mem_allocator_oom.h", - "desc": "对现有的allocator进行包装,如果分配内存失败,调用预先设置的回调函数释放内存,然后再重试。", - "name": "mem_allocator_oom_t", - "parent": "mem_allocator_t", - "level": 2 - }, - { - "type": "class", - "methods": [], - "events": [], - "properties": [], - "header": "tkc/mem_allocator_lock.h", - "desc": "对现有的allocator进行包装,提供互斥功能。", - "name": "mem_allocator_lock_t", - "parent": "mem_allocator_t", - "level": 2 - }, - { - "type": "class", - "methods": [], - "events": [], - "properties": [], - "header": "tkc/mem_allocator_debug.h", - "desc": "对现有的allocator进行包装,记录分配的内存,用于帮助分析内存的使用和泄露。", - "name": "mem_allocator_debug_t", - "parent": "mem_allocator_t", - "level": 2 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "event_t*", - "name": "event", - "desc": "event对象。" - } - ], - "annotation": { - "cast": true, - "scriptable": true - }, - "desc": "把event对象转error_event_t对象,主要给脚本语言使用。", - "name": "error_event_cast", - "return": { - "type": "error_event_t*", - "desc": "返回event对象。" - } - }, - { - "params": [ - { - "type": "error_event_t*", - "name": "event", - "desc": "event对象。" - }, - { - "type": "int32_t", - "name": "code", - "desc": "错误码。" - }, - { - "type": "const char*", - "name": "message", - "desc": "错误消息。" - } - ], - "annotation": {}, - "desc": "初始error event。", - "name": "error_event_init", - "return": { - "type": "event_t*", - "desc": "返回event对象。" - } - } - ], - "events": [], - "properties": [ - { - "name": "code", - "desc": "错误码。", - "type": "int32_t", - "annotation": { - "readable": true, - "scriptable": true - } - }, - { - "name": "message", - "desc": "错误信息。", - "type": "const char*", - "annotation": { - "readable": true, - "scriptable": true - } - } - ], - "header": "tkc/event.h", - "desc": "执行完成事件。", - "name": "error_event_t", - "annotation": { - "scriptable": true - }, - "parent": "event_t", - "level": 2 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "event_t*", - "name": "event", - "desc": "event对象。" - } - ], - "annotation": { - "cast": true, - "scriptable": true - }, - "desc": "把event对象转cmd_exec_event_t对象,主要给脚本语言使用。", - "name": "cmd_exec_event_cast", - "return": { - "type": "cmd_exec_event_t*", - "desc": "返回event对象。" - } - }, - { - "params": [ - { - "type": "cmd_exec_event_t*", - "name": "event", - "desc": "event对象。" - }, - { - "type": "uint32_t", - "name": "type", - "desc": "事件类型。" - }, - { - "type": "const char*", - "name": "name", - "desc": "命令名。" - }, - { - "type": "const char*", - "name": "args", - "desc": "命令参数。" - } - ], - "annotation": {}, - "desc": "初始命令执行事件。", - "name": "cmd_exec_event_init", - "return": { - "type": "event_t*", - "desc": "返回event对象。" - } - } - ], - "events": [], - "properties": [ - { - "name": "name", - "desc": "命令的名称。", - "type": "const char*", - "annotation": { - "readable": true, - "scriptable": true - } - }, - { - "name": "args", - "desc": "命令的参数。", - "type": "const char*", - "annotation": { - "readable": true, - "scriptable": true - } - }, - { - "name": "result", - "desc": "执行结果(适用于EXECED)。", - "type": "ret_t", - "annotation": { - "readable": true, - "scriptable": true - } - }, - { - "name": "can_exec", - "desc": "执行结果(适用于CAN_EXEC)。", - "type": "bool_t", - "annotation": { - "readable": true, - "scriptable": true - } - } - ], - "header": "tkc/event.h", - "desc": "对象执行命令的事件。", - "name": "cmd_exec_event_t", - "annotation": { - "scriptable": true - }, - "parent": "event_t", - "level": 2 - }, - { - "type": "class", - "methods": [], - "events": [], - "properties": [ - { - "name": "defvalue", - "desc": "缺省值。", - "type": "int32_t", - "annotation": { - "readable": true - } - }, - { - "name": "enums", - "desc": "枚举值(每一项用英文冒号分隔值和名称)。", - "type": "const char**", - "annotation": { - "readable": true - } - } - ], - "header": "tkc/value_desc.h", - "desc": "整数枚举类型属性描述。", - "name": "value_desc_int_enums_t", - "parent": "value_desc_t", - "level": 2 - }, - { - "type": "class", - "methods": [], - "events": [], - "properties": [ - { - "name": "defvalue", - "desc": "缺省值。", - "type": "int8_t", - "annotation": { - "readable": true - } - }, - { - "name": "min", - "desc": "最小值。", - "type": "int8_t", - "annotation": { - "readable": true - } - }, - { - "name": "max", - "desc": "最大值。", - "type": "int8_t", - "annotation": { - "readable": true - } - }, - { - "name": "step", - "desc": "步长。", - "type": "int8_t", - "annotation": { - "readable": true - } - }, - { - "name": "unit", - "desc": "单位。", - "type": "const char*", - "annotation": { - "readable": true - } - } - ], - "header": "tkc/value_desc.h", - "desc": "有符号8位整数类型属性描述。", - "name": "value_desc_int8_t", - "parent": "value_desc_t", - "level": 2 - }, { "type": "class", "methods": [], @@ -16343,110 +18196,6 @@ "parent": "value_desc_t", "level": 2 }, - { - "type": "class", - "methods": [], - "events": [], - "properties": [ - { - "name": "defvalue", - "desc": "缺省值。", - "type": "int16_t", - "annotation": { - "readable": true - } - }, - { - "name": "min", - "desc": "最小值。", - "type": "int16_t", - "annotation": { - "readable": true - } - }, - { - "name": "max", - "desc": "最大值。", - "type": "int16_t", - "annotation": { - "readable": true - } - }, - { - "name": "step", - "desc": "步长。", - "type": "int16_t", - "annotation": { - "readable": true - } - }, - { - "name": "unit", - "desc": "单位。", - "type": "const char*", - "annotation": { - "readable": true - } - } - ], - "header": "tkc/value_desc.h", - "desc": "有符号16位整数类型属性描述。", - "name": "value_desc_int16_t", - "parent": "value_desc_t", - "level": 2 - }, - { - "type": "class", - "methods": [], - "events": [], - "properties": [ - { - "name": "defvalue", - "desc": "缺省值。", - "type": "uint16_t", - "annotation": { - "readable": true - } - }, - { - "name": "min", - "desc": "最小值。", - "type": "uint16_t", - "annotation": { - "readable": true - } - }, - { - "name": "max", - "desc": "最大值。", - "type": "uint16_t", - "annotation": { - "readable": true - } - }, - { - "name": "step", - "desc": "步长。", - "type": "uint16_t", - "annotation": { - "readable": true - } - }, - { - "name": "unit", - "desc": "单位。", - "type": "const char*", - "annotation": { - "readable": true - } - } - ], - "header": "tkc/value_desc.h", - "desc": "无符号16位整数类型属性描述。", - "name": "value_desc_uint16_t", - "parent": "value_desc_t", - "level": 2 - }, { "type": "class", "methods": [], @@ -16504,9 +18253,17 @@ "methods": [], "events": [], "properties": [ + { + "name": "defvalue", + "desc": "缺省值。", + "type": "uint32_t", + "annotation": { + "readable": true + } + }, { "name": "min", - "desc": "最小长度。", + "desc": "最小值。", "type": "uint32_t", "annotation": { "readable": true @@ -16514,16 +18271,32 @@ }, { "name": "max", - "desc": "最大长度。", + "desc": "最大值。", "type": "uint32_t", "annotation": { "readable": true } + }, + { + "name": "step", + "desc": "步长。", + "type": "uint32_t", + "annotation": { + "readable": true + } + }, + { + "name": "unit", + "desc": "单位。", + "type": "const char*", + "annotation": { + "readable": true + } } ], "header": "tkc/value_desc.h", - "desc": "二进制类型属性描述。", - "name": "value_desc_binary_t", + "desc": "无符号32位整数类型属性描述。", + "name": "value_desc_uint32_t", "parent": "value_desc_t", "level": 2 }, @@ -16791,38 +18564,1442 @@ "parent": "value_desc_t", "level": 2 }, + { + "type": "class", + "methods": [], + "events": [], + "properties": [ + { + "name": "min", + "desc": "最小长度。", + "type": "uint32_t", + "annotation": { + "readable": true + } + }, + { + "name": "max", + "desc": "最大长度。", + "type": "uint32_t", + "annotation": { + "readable": true + } + } + ], + "header": "tkc/value_desc.h", + "desc": "二进制类型属性描述。", + "name": "value_desc_binary_t", + "parent": "value_desc_t", + "level": 2 + }, + { + "type": "class", + "methods": [], + "events": [], + "properties": [ + { + "name": "defvalue", + "desc": "缺省值。", + "type": "int32_t", + "annotation": { + "readable": true + } + }, + { + "name": "enums", + "desc": "枚举值(每一项用英文冒号分隔值和名称)。", + "type": "const char**", + "annotation": { + "readable": true + } + } + ], + "header": "tkc/value_desc.h", + "desc": "整数枚举类型属性描述。", + "name": "value_desc_int_enums_t", + "parent": "value_desc_t", + "level": 2 + }, + { + "type": "class", + "methods": [], + "events": [], + "properties": [ + { + "name": "defvalue", + "desc": "缺省值。", + "type": "int8_t", + "annotation": { + "readable": true + } + }, + { + "name": "min", + "desc": "最小值。", + "type": "int8_t", + "annotation": { + "readable": true + } + }, + { + "name": "max", + "desc": "最大值。", + "type": "int8_t", + "annotation": { + "readable": true + } + }, + { + "name": "step", + "desc": "步长。", + "type": "int8_t", + "annotation": { + "readable": true + } + }, + { + "name": "unit", + "desc": "单位。", + "type": "const char*", + "annotation": { + "readable": true + } + } + ], + "header": "tkc/value_desc.h", + "desc": "有符号8位整数类型属性描述。", + "name": "value_desc_int8_t", + "parent": "value_desc_t", + "level": 2 + }, + { + "type": "class", + "methods": [], + "events": [], + "properties": [ + { + "name": "defvalue", + "desc": "缺省值。", + "type": "uint16_t", + "annotation": { + "readable": true + } + }, + { + "name": "min", + "desc": "最小值。", + "type": "uint16_t", + "annotation": { + "readable": true + } + }, + { + "name": "max", + "desc": "最大值。", + "type": "uint16_t", + "annotation": { + "readable": true + } + }, + { + "name": "step", + "desc": "步长。", + "type": "uint16_t", + "annotation": { + "readable": true + } + }, + { + "name": "unit", + "desc": "单位。", + "type": "const char*", + "annotation": { + "readable": true + } + } + ], + "header": "tkc/value_desc.h", + "desc": "无符号16位整数类型属性描述。", + "name": "value_desc_uint16_t", + "parent": "value_desc_t", + "level": 2 + }, + { + "type": "class", + "methods": [], + "events": [], + "properties": [], + "header": "tkc/mem_allocator_simple.h", + "desc": "简单的内存分配器。", + "name": "mem_allocator_simple_t", + "parent": "mem_allocator_t", + "level": 2 + }, + { + "type": "class", + "methods": [], + "events": [], + "properties": [], + "header": "tkc/mem_allocator_pool.h", + "desc": "对现有的allocator进行包装,预先分配一部分内存,用于分配小块内存,可以避免内存碎片。", + "name": "mem_allocator_pool_t", + "parent": "mem_allocator_t", + "level": 2 + }, + { + "type": "class", + "methods": [], + "events": [], + "properties": [], + "header": "tkc/mem_allocator_oom.h", + "desc": "对现有的allocator进行包装,如果分配内存失败,调用预先设置的回调函数释放内存,然后再重试。", + "name": "mem_allocator_oom_t", + "parent": "mem_allocator_t", + "level": 2 + }, + { + "type": "class", + "methods": [], + "events": [], + "properties": [], + "header": "tkc/mem_allocator_lock.h", + "desc": "对现有的allocator进行包装,提供互斥功能。", + "name": "mem_allocator_lock_t", + "parent": "mem_allocator_t", + "level": 2 + }, + { + "type": "class", + "methods": [], + "events": [], + "properties": [], + "header": "tkc/mem_allocator_debug.h", + "desc": "对现有的allocator进行包装,记录分配的内存,用于帮助分析内存的使用和泄露。", + "name": "mem_allocator_debug_t", + "parent": "mem_allocator_t", + "level": 2 + }, { "type": "class", "methods": [ { "params": [ { - "type": "object_t*", - "name": "obj1", - "desc": "对象1。" - }, - { - "type": "object_t*", - "name": "obj2", - "desc": "对象2。" + "type": "event_source_manager_t*", + "name": "manager", + "desc": "event_source_manager对象。" } ], - "annotation": { - "constructor": true - }, - "desc": "创建对象。", - "name": "object_compositor_create", + "annotation": {}, + "desc": "创建事件源管理器。", + "name": "event_source_manager_default_create", "return": { - "type": "object_t*", - "desc": "返回object对象。" + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" } } ], "events": [], "properties": [], - "header": "tkc/object_compositor.h", - "desc": "将两个对象包装为一个对象,优先访问第一个对象,如果访问失败则访问第二个对象。", - "name": "object_compositor_t", + "header": "tkc/event_source_manager_default.h", + "desc": "缺省的事件源管理器。", + "name": "event_source_manager_default_t", + "parent": "event_source_manager_t", + "annotation": { + "fake": true + }, + "level": 2 + }, + { + "type": "class", + "methods": [], + "events": [], + "properties": [ + { + "name": "defvalue", + "desc": "缺省值。", + "type": "int16_t", + "annotation": { + "readable": true + } + }, + { + "name": "min", + "desc": "最小值。", + "type": "int16_t", + "annotation": { + "readable": true + } + }, + { + "name": "max", + "desc": "最大值。", + "type": "int16_t", + "annotation": { + "readable": true + } + }, + { + "name": "step", + "desc": "步长。", + "type": "int16_t", + "annotation": { + "readable": true + } + }, + { + "name": "unit", + "desc": "单位。", + "type": "const char*", + "annotation": { + "readable": true + } + } + ], + "header": "tkc/value_desc.h", + "desc": "有符号16位整数类型属性描述。", + "name": "value_desc_int16_t", + "parent": "value_desc_t", + "level": 2 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "event_t*", + "name": "event", + "desc": "event对象。" + } + ], + "annotation": { + "cast": true, + "scriptable": true + }, + "desc": "把event对象转prop_change_event_t对象,主要给脚本语言使用。", + "name": "prop_change_event_cast", + "return": { + "type": "prop_change_event_t*", + "desc": "返回event对象。" + } + }, + { + "params": [ + { + "type": "prop_change_event_t*", + "name": "event", + "desc": "event对象。" + }, + { + "type": "uint32_t", + "name": "type", + "desc": "事件类型。" + }, + { + "type": "const char*", + "name": "name", + "desc": "属性名。" + }, + { + "type": "const value_t*", + "name": "value", + "desc": "属性的值。" + } + ], + "annotation": {}, + "desc": "初始prop change event。", + "name": "prop_change_event_init", + "return": { + "type": "event_t*", + "desc": "返回event对象。" + } + } + ], + "events": [], + "properties": [ + { + "name": "name", + "desc": "属性的名称。", + "type": "const char*", + "annotation": { + "readable": true, + "scriptable": true + } + }, + { + "name": "value", + "desc": "属性的值。", + "type": "const value_t*", + "annotation": { + "readable": true, + "scriptable": true + } + } + ], + "header": "tkc/event.h", + "desc": "对象属性变化事件。", + "name": "prop_change_event_t", + "annotation": { + "scriptable": true + }, + "parent": "event_t", + "level": 2 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "event_t*", + "name": "event", + "desc": "event对象。" + } + ], + "annotation": { + "cast": true, + "scriptable": true + }, + "desc": "把event对象转progress_event_t对象,主要给脚本语言使用。", + "name": "progress_event_cast", + "return": { + "type": "progress_event_t*", + "desc": "返回event对象。" + } + }, + { + "params": [ + { + "type": "progress_event_t*", + "name": "event", + "desc": "event对象。" + }, + { + "type": "uint32_t", + "name": "percent", + "desc": "进度。" + } + ], + "annotation": {}, + "desc": "初始progress event。", + "name": "progress_event_init", + "return": { + "type": "event_t*", + "desc": "返回event对象。" + } + } + ], + "events": [], + "properties": [ + { + "name": "percent", + "desc": "进度百分比。", + "type": "uint32_t", + "annotation": { + "readable": true, + "scriptable": true + } + } + ], + "header": "tkc/event.h", + "desc": "进度变化事件。", + "name": "progress_event_t", + "annotation": { + "scriptable": true + }, + "parent": "event_t", + "level": 2 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "event_t*", + "name": "event", + "desc": "event对象。" + } + ], + "annotation": { + "cast": true, + "scriptable": true + }, + "desc": "把event对象转done_event_t对象,主要给脚本语言使用。", + "name": "done_event_cast", + "return": { + "type": "done_event_t*", + "desc": "返回event对象。" + } + }, + { + "params": [ + { + "type": "done_event_t*", + "name": "event", + "desc": "event对象。" + }, + { + "type": "ret_t", + "name": "result", + "desc": "结果。" + } + ], + "annotation": {}, + "desc": "初始done event。", + "name": "done_event_init", + "return": { + "type": "event_t*", + "desc": "返回event对象。" + } + } + ], + "events": [], + "properties": [ + { + "name": "result", + "desc": "执行结果。", + "type": "ret_t", + "annotation": { + "readable": true, + "scriptable": true + } + } + ], + "header": "tkc/event.h", + "desc": "执行完成事件。", + "name": "done_event_t", + "annotation": { + "scriptable": true + }, + "parent": "event_t", + "level": 2 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "event_t*", + "name": "event", + "desc": "event对象。" + } + ], + "annotation": { + "cast": true, + "scriptable": true + }, + "desc": "把event对象转error_event_t对象,主要给脚本语言使用。", + "name": "error_event_cast", + "return": { + "type": "error_event_t*", + "desc": "返回event对象。" + } + }, + { + "params": [ + { + "type": "error_event_t*", + "name": "event", + "desc": "event对象。" + }, + { + "type": "int32_t", + "name": "code", + "desc": "错误码。" + }, + { + "type": "const char*", + "name": "message", + "desc": "错误消息。" + } + ], + "annotation": {}, + "desc": "初始error event。", + "name": "error_event_init", + "return": { + "type": "event_t*", + "desc": "返回event对象。" + } + } + ], + "events": [], + "properties": [ + { + "name": "code", + "desc": "错误码。", + "type": "int32_t", + "annotation": { + "readable": true, + "scriptable": true + } + }, + { + "name": "message", + "desc": "错误信息。", + "type": "const char*", + "annotation": { + "readable": true, + "scriptable": true + } + } + ], + "header": "tkc/event.h", + "desc": "执行完成事件。", + "name": "error_event_t", + "annotation": { + "scriptable": true + }, + "parent": "event_t", + "level": 2 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "event_t*", + "name": "event", + "desc": "event对象。" + } + ], + "annotation": { + "cast": true, + "scriptable": true + }, + "desc": "把event对象转cmd_exec_event_t对象,主要给脚本语言使用。", + "name": "cmd_exec_event_cast", + "return": { + "type": "cmd_exec_event_t*", + "desc": "返回event对象。" + } + }, + { + "params": [ + { + "type": "cmd_exec_event_t*", + "name": "event", + "desc": "event对象。" + }, + { + "type": "uint32_t", + "name": "type", + "desc": "事件类型。" + }, + { + "type": "const char*", + "name": "name", + "desc": "命令名。" + }, + { + "type": "const char*", + "name": "args", + "desc": "命令参数。" + } + ], + "annotation": {}, + "desc": "初始命令执行事件。", + "name": "cmd_exec_event_init", + "return": { + "type": "event_t*", + "desc": "返回event对象。" + } + } + ], + "events": [], + "properties": [ + { + "name": "name", + "desc": "命令的名称。", + "type": "const char*", + "annotation": { + "readable": true, + "scriptable": true + } + }, + { + "name": "args", + "desc": "命令的参数。", + "type": "const char*", + "annotation": { + "readable": true, + "scriptable": true + } + }, + { + "name": "result", + "desc": "执行结果(适用于EXECED)。", + "type": "ret_t", + "annotation": { + "readable": true, + "scriptable": true + } + }, + { + "name": "can_exec", + "desc": "执行结果(适用于CAN_EXEC)。", + "type": "bool_t", + "annotation": { + "readable": true, + "scriptable": true + } + } + ], + "header": "tkc/event.h", + "desc": "对象执行命令的事件。", + "name": "cmd_exec_event_t", + "annotation": { + "scriptable": true + }, + "parent": "event_t", + "level": 2 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "conf_doc_save_t", + "name": "save", + "desc": "保存函数。" + }, + { + "type": "conf_doc_load_t", + "name": "load", + "desc": "加载函数。" + }, + { + "type": "const char*", + "name": "url", + "desc": "路径。" + }, + { + "type": "bool_t", + "name": "create_if_not_exist", + "desc": "如果不存在是否创建。" + } + ], + "annotation": { + "constructor": true + }, + "desc": "", + "name": "conf_obj_create", + "return": { + "type": "object_t*", + "desc": "返回配置对象。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "conf", + "desc": "conf对象。" + } + ], + "annotation": {}, + "desc": "获取doc对象,用于更高级的操作。", + "name": "conf_obj_get_doc", + "return": { + "type": "conf_dot_t", + "desc": "返回doc对象。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "conf", + "desc": "conf对象。" + } + ], + "annotation": {}, + "desc": "保存文档。", + "name": "conf_obj_save", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "conf", + "desc": "conf对象。" + }, + { + "type": "bool_t", + "name": "readonly", + "desc": "只读模式。" + } + ], + "annotation": {}, + "desc": "设置为只读模式。", + "name": "conf_obj_set_readonly", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败" + } + } + ], + "events": [], + "properties": [], + "header": "conf_io/conf_obj.h", + "desc": "conf对象。", + "name": "conf_obj_t", + "parent": "object_t", + "annotation": { + "fake": true + }, + "level": 3 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "int", + "name": "fd", + "desc": "可以用select等待的文件描述符。" + }, + { + "type": "event_source_on_event_t", + "name": "on_event", + "desc": "用户的事件处理函数。" + }, + { + "type": "void*", + "name": "ctx", + "desc": "on_event函数的上下文。" + } + ], + "annotation": {}, + "desc": "创建fd事件源。", + "name": "event_source_fd_create", + "return": { + "type": "event_source_t*", + "desc": "返回事件源对象。" + } + } + ], + "events": [], + "properties": [], + "header": "tkc/event_source_fd.h", + "desc": "fd事件源。用于文件、管道和套接字。", + "name": "event_source_fd_t", + "parent": "object_t", + "level": 3 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "idle_manager_t*", + "name": "idle_manager", + "desc": "定时器管理器对象。" + } + ], + "annotation": {}, + "desc": "创建idle事件源。", + "name": "event_source_idle_create", + "return": { + "type": "event_source_t*", + "desc": "返回事件源对象。" + } + } + ], + "events": [], + "properties": [], + "header": "tkc/event_source_idle.h", + "desc": "idle事件源。", + "name": "event_source_idle_t", + "parent": "object_t", + "level": 3 + }, + { + "type": "class", + "methods": [ + { + "params": [], + "annotation": { + "constructor": true, + "scriptable": true, + "gc": true + }, + "desc": "创建对象。", + "name": "object_array_create", + "return": { + "type": "object_t*", + "desc": "返回object对象。" + } + }, + { + "params": [ + { + "type": "object_array_t*", + "name": "o", + "desc": "被克隆的对象。" + } + ], + "annotation": { + "constructor": true + }, + "desc": "克隆对象。", + "name": "object_array_clone", + "return": { + "type": "object_t*", + "desc": "返回object对象。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "对象。" + } + ], + "annotation": { + "deconstructor": true, + "scriptable": true, + "gc": true + }, + "desc": "for script gc", + "name": "object_array_unref", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "object_t*", + "name": "obj", + "desc": "对象。" + } + ], + "annotation": { + "scriptable": true + }, + "desc": "清除全部属性。", + "name": "object_array_clear_props", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [], + "properties": [ + { + "name": "props_size", + "desc": "属性个数。", + "type": "uint32_t", + "annotation": { + "readable": true, + "scriptable": true + } + }, + { + "name": "props_capacity", + "desc": "属性数组的容量。", + "type": "uint32_t", + "annotation": { + "readable": true + } + }, + { + "name": "props", + "desc": "属性数组。", + "type": "value_t", + "annotation": { + "readable": true + } + } + ], + "header": "tkc/object_array.h", + "desc": "简单的动态数组,内部存放value对象。\n\n访问时属性名称为:\n\n* \"size\"/\"length\" 用于获取数组的长度。\n* index 用于访问属性,-1可以用来追加新元素。", + "name": "object_array_t", + "parent": "object_t", + "annotation": { + "scriptable": true + }, + "level": 3 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "timer_manager_t*", + "name": "timer_manager", + "desc": "定时器管理器对象。" + } + ], + "annotation": {}, + "desc": "创建timer事件源。", + "name": "event_source_timer_create", + "return": { + "type": "event_source_t*", + "desc": "返回事件源对象。" + } + } + ], + "events": [], + "properties": [], + "header": "tkc/event_source_timer.h", + "desc": "timer事件源。", + "name": "event_source_timer_t", + "parent": "object_t", + "level": 3 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "event_source_t*", + "name": "source", + "desc": "event_source对象。" + } + ], + "annotation": {}, + "desc": "获取文件描述符。", + "name": "event_source_get_fd", + "return": { + "type": "int32_t", + "desc": "返回文件描述符。" + } + }, + { + "params": [ + { + "type": "event_source_t*", + "name": "source", + "desc": "event_source对象。" + } + ], + "annotation": {}, + "desc": "分发事件。", + "name": "event_source_dispatch", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "event_source_t*", + "name": "source", + "desc": "event_source对象。" + }, + { + "type": "void*", + "name": "tag", + "desc": "tag。" + } + ], + "annotation": {}, + "desc": "设置tag,方便通过tag一次移除多个事件源。", + "name": "event_source_set_tag", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "event_source_t*", + "name": "source", + "desc": "event_source对象。" + } + ], + "annotation": {}, + "desc": "对于没有文件描述符的事件源,需要自己检查是否准备就绪。", + "name": "event_source_check", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "event_source_t*", + "name": "source", + "desc": "event_source对象。" + } + ], + "annotation": {}, + "desc": "获取唤醒时间(ms)。", + "name": "event_source_get_wakeup_time", + "return": { + "type": "uint32_t", + "desc": "返回唤醒时间(ms)。" + } + } + ], + "events": [], + "properties": [], + "header": "tkc/event_source.h", + "desc": "表示一个事件源。\n\n事件源有下列两种方式:\n\n* 对于有文件描述符的事件源(如socket),get_fd返回一个有效的文件描述符。\n* 对于定时器,则get_wakeup_time返回下次唤醒的时间。", + "name": "event_source_t", + "parent": "object_t", + "level": 3 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "const char*", + "name": "url", + "desc": "路径(通常是文件路径)。" + }, + { + "type": "bool_t", + "name": "create_if_not_exist", + "desc": "如果不存在是否创建。" + } + ], + "annotation": { + "constructor": true + }, + "desc": "", + "name": "conf_ubjson_load", + "return": { + "type": "object_t*", + "desc": "返回配置对象。" + } + } + ], + "events": [], + "properties": [], + "header": "conf_io/conf_ubjson.h", + "desc": "conf json对象。", + "name": "conf_ubjson_t", + "parent": "object_t", + "annotation": { + "fake": true + }, + "level": 3 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "timer_info_t*", + "name": "timer", + "desc": "timer_info对象。" + } + ], + "annotation": { + "cast": true, + "scriptable": true + }, + "desc": "转换为timer_info对象(供脚本语言使用)。", + "name": "timer_info_cast", + "return": { + "type": "timer_info_t*", + "desc": "timer_info对象。" + } + } + ], + "events": [], + "properties": [ + { + "name": "on_timer", + "desc": "定时器回调函数。", + "type": "timer_func_t", + "annotation": { + "readable": true + } + }, + { + "name": "ctx", + "desc": "定时器回调函数的上下文", + "type": "void*", + "annotation": { + "readable": true, + "scriptable": true + } + }, + { + "name": "id", + "desc": "定时器的ID\n\n> 为TK\\_INVALID\\_ID时表示无效定时器。", + "type": "uint32_t", + "annotation": { + "readable": true, + "scriptable": true + } + }, + { + "name": "now", + "desc": "当前时间(相对时间,单位为毫秒)。", + "type": "uint64_t", + "annotation": { + "readable": true, + "scriptable": true + } + }, + { + "name": "start", + "desc": "起始时间(相对时间,单位为毫秒)。", + "type": "uint64_t", + "annotation": { + "readable": true + } + }, + { + "name": "duration", + "desc": "时间间隔(单位为毫秒)。", + "type": "uint32_t", + "annotation": { + "readable": true + } + }, + { + "name": "on_destroy", + "desc": "定时器销毁时的回调函数。", + "type": "tk_destroy_t", + "annotation": { + "readable": true + } + }, + { + "name": "on_destroy_ctx", + "desc": "定时器销毁时的回调函数上下文。", + "type": "void*", + "annotation": { + "readable": true + } + } + ], + "header": "tkc/timer_info.h", + "desc": "单个定时器的信息。", + "name": "timer_info_t", + "parent": "object_t", + "annotation": { + "scriptable": true + }, + "level": 3 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "const char*", + "name": "url", + "desc": "路径(通常是文件路径)。" + }, + { + "type": "bool_t", + "name": "create_if_not_exist", + "desc": "如果不存在是否创建。" + } + ], + "annotation": { + "constructor": true + }, + "desc": "", + "name": "conf_json_load", + "return": { + "type": "object_t*", + "desc": "返回配置对象。" + } + } + ], + "events": [], + "properties": [], + "header": "conf_io/conf_json.h", + "desc": "conf json对象。", + "name": "conf_json_t", + "parent": "object_t", + "annotation": { + "fake": true + }, + "level": 3 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "const char*", + "name": "url", + "desc": "路径(通常是文件路径)。" + }, + { + "type": "bool_t", + "name": "create_if_not_exist", + "desc": "如果不存在是否创建。" + } + ], + "annotation": { + "constructor": true + }, + "desc": "", + "name": "conf_ini_load", + "return": { + "type": "object_t*", + "desc": "返回配置对象。" + } + } + ], + "events": [], + "properties": [], + "header": "conf_io/conf_ini.h", + "desc": "conf ini对象。", + "name": "conf_ini_t", + "parent": "object_t", + "annotation": { + "fake": true + }, + "level": 3 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "tk_ostream_t*", + "name": "stream", + "desc": "ostream对象。" + }, + { + "type": "const void*", + "name": "buff", + "desc": "返回数据的缓冲区。" + }, + { + "type": "uint32_t", + "name": "max_size", + "desc": "缓冲区的大小。" + } + ], + "annotation": {}, + "desc": "写入数据。", + "name": "tk_ostream_write", + "return": { + "type": "int32_t", + "desc": "返回负数表示写入失败,否则返回实际写入数据的长度。" + } + }, + { + "params": [ + { + "type": "tk_ostream_t*", + "name": "stream", + "desc": "ostream对象。" + }, + { + "type": "uint32_t", + "name": "offset", + "desc": "偏移量。" + } + ], + "annotation": {}, + "desc": "设置偏移量。", + "name": "tk_ostream_seek", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "tk_ostream_t*", + "name": "stream", + "desc": "ostream对象。" + }, + { + "type": "const void*", + "name": "buff", + "desc": "数据的缓冲区。" + }, + { + "type": "uint32_t", + "name": "max_size", + "desc": "缓冲区的大小。" + }, + { + "type": "uint32_t", + "name": "timeout_ms", + "desc": "timeout." + } + ], + "annotation": {}, + "desc": "写入指定长度的数据。", + "name": "tk_ostream_write_len", + "return": { + "type": "int32_t", + "desc": "返回负数表示写入失败,否则返回实际写入数据的长度。" + } + }, + { + "params": [ + { + "type": "tk_ostream_t*", + "name": "stream", + "desc": "ostream对象。" + }, + { + "type": "uint8_t", + "name": "byte", + "desc": "数据。" + } + ], + "annotation": {}, + "desc": "写入一个字节的数据。", + "name": "tk_ostream_write_byte", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "tk_ostream_t*", + "name": "stream", + "desc": "ostream对象。" + } + ], + "annotation": {}, + "desc": "刷新数据。", + "name": "tk_ostream_flush", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [], + "properties": [], + "header": "tkc/ostream.h", + "desc": "输出流的接口。", + "name": "tk_ostream_t", "parent": "object_t", "level": 3 }, @@ -16860,158 +20037,137 @@ "type": "class", "methods": [ { - "params": [ - { - "type": "tk_iostream_t*", - "name": "stream", - "desc": "iostream对象。" - } - ], - "annotation": {}, - "desc": "获取输入流对象。", - "name": "tk_iostream_get_istream", + "params": [], + "annotation": { + "constructor": true, + "scriptable": true, + "gc": true + }, + "desc": "创建对象。", + "name": "object_default_create", "return": { - "type": "tk_istream_t*", - "desc": "返回输入流对象。" + "type": "object_t*", + "desc": "返回object对象。" } }, { "params": [ { - "type": "tk_iostream_t*", - "name": "stream", - "desc": "iostream对象。" + "type": "object_default_t*", + "name": "o", + "desc": "被克隆的对象。" } ], - "annotation": {}, - "desc": "获取输出流对象。", - "name": "tk_iostream_get_ostream", + "annotation": { + "constructor": true + }, + "desc": "克隆对象。", + "name": "object_default_clone", "return": { - "type": "tk_ostream_t*", - "desc": "返回输出流对象。" + "type": "object_t*", + "desc": "返回object对象。" } }, { "params": [ { - "type": "tk_iostream_t*", - "name": "stream", - "desc": "iostream对象。" - }, - { - "type": "void*", - "name": "buff", - "desc": "返回数据的缓冲区。" - }, - { - "type": "uint32_t", - "name": "max_size", - "desc": "缓冲区的大小。" + "type": "object_t*", + "name": "obj", + "desc": "对象。" } ], - "annotation": {}, - "desc": "读取数据。", - "name": "tk_iostream_read", + "annotation": { + "deconstructor": true, + "scriptable": true, + "gc": true + }, + "desc": "for script gc", + "name": "object_default_unref", "return": { - "type": "int32_t", - "desc": "返回负数表示读取失败,否则返回实际读取数据的长度。" + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { - "type": "tk_iostream_t*", - "name": "stream", - "desc": "iostream对象。" - }, - { - "type": "void*", - "name": "buff", - "desc": "返回数据的缓冲区。" - }, - { - "type": "uint32_t", - "name": "max_size", - "desc": "缓冲区的大小。" - }, - { - "type": "uint32_t", - "name": "timeout_ms", - "desc": "timeout." + "type": "object_t*", + "name": "obj", + "desc": "对象。" } ], - "annotation": {}, - "desc": "读取指定长度的数据。", - "name": "tk_iostream_read_len", + "annotation": { + "scriptable": true + }, + "desc": "清除全部属性。", + "name": "object_default_clear_props", "return": { - "type": "int32_t", - "desc": "返回负数表示读取失败,否则返回实际读取数据的长度。" + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" } }, { "params": [ { - "type": "tk_iostream_t*", - "name": "stream", - "desc": "iostream对象。" + "type": "object_t*", + "name": "obj", + "desc": "对象。" + }, + { + "type": "tk_compare_t", + "name": "cmp", + "desc": "比较函数。" }, { "type": "const void*", - "name": "buff", - "desc": "返回数据的缓冲区。" - }, - { - "type": "uint32_t", - "name": "max_size", - "desc": "缓冲区的大小。" + "name": "data", + "desc": "要比较的数据。" } ], "annotation": {}, - "desc": "写入数据。", - "name": "tk_iostream_write", + "desc": "查找满足条件的属性,并返回它的值。", + "name": "object_default_find_prop", "return": { - "type": "int32_t", - "desc": "返回负数表示写入失败,否则返回实际写入数据的长度。" - } - }, - { - "params": [ - { - "type": "tk_iostream_t*", - "name": "stream", - "desc": "iostream对象。" - }, - { - "type": "const void*", - "name": "buff", - "desc": "数据的缓冲区。" - }, - { - "type": "uint32_t", - "name": "max_size", - "desc": "缓冲区的大小。" - }, - { - "type": "uint32_t", - "name": "timeout_ms", - "desc": "timeout." - } - ], - "annotation": {}, - "desc": "写入指定长度的数据。", - "name": "tk_iostream_write_len", - "return": { - "type": "int32_t", - "desc": "返回负数表示写入失败,否则返回实际写入数据的长度。" + "type": "value_t*", + "desc": "返回属性的值。" } } ], "events": [], - "properties": [], - "header": "tkc/iostream.h", - "desc": "输入输出流的接口。", - "name": "tk_iostream_t", + "properties": [ + { + "name": "props_size", + "desc": "属性个数。", + "type": "uint32_t", + "annotation": { + "readable": true, + "scriptable": true + } + }, + { + "name": "props_capacity", + "desc": "属性数组的容量。", + "type": "uint32_t", + "annotation": { + "readable": true + } + }, + { + "name": "props", + "desc": "属性数组。", + "type": "named_value_t", + "annotation": { + "readable": true + } + } + ], + "header": "tkc/object_default.h", + "desc": "对象接口的缺省实现。\n\n内部使用有序数组保存所有属性,可以快速查找指定名称的属性。", + "name": "object_default_t", "parent": "object_t", + "annotation": { + "scriptable": true + }, "level": 3 }, { @@ -17228,214 +20384,36 @@ { "type": "class", "methods": [ - { - "params": [], - "annotation": { - "constructor": true, - "scriptable": true, - "gc": true - }, - "desc": "创建对象。", - "name": "object_array_create", - "return": { - "type": "object_t*", - "desc": "返回object对象。" - } - }, { "params": [ { - "type": "object_array_t*", - "name": "o", - "desc": "被克隆的对象。" + "type": "object_t*", + "name": "obj1", + "desc": "对象1。" + }, + { + "type": "object_t*", + "name": "obj2", + "desc": "对象2。" } ], "annotation": { "constructor": true }, - "desc": "克隆对象。", - "name": "object_array_clone", + "desc": "创建对象。", + "name": "object_compositor_create", "return": { "type": "object_t*", "desc": "返回object对象。" } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "对象。" - } - ], - "annotation": { - "deconstructor": true, - "scriptable": true, - "gc": true - }, - "desc": "for script gc", - "name": "object_array_unref", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "对象。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "清除全部属性。", - "name": "object_array_clear_props", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } } ], "events": [], - "properties": [ - { - "name": "props_size", - "desc": "属性个数。", - "type": "uint32_t", - "annotation": { - "readable": true, - "scriptable": true - } - }, - { - "name": "props_capacity", - "desc": "属性数组的容量。", - "type": "uint32_t", - "annotation": { - "readable": true - } - }, - { - "name": "props", - "desc": "属性数组。", - "type": "value_t", - "annotation": { - "readable": true - } - } - ], - "header": "tkc/object_array.h", - "desc": "简单的动态数组,内部存放value对象。\n\n访问时属性名称为:\n\n* \"size\"/\"length\" 用于获取数组的长度。\n* index 用于访问属性,-1可以用来追加新元素。", - "name": "object_array_t", + "properties": [], + "header": "tkc/object_compositor.h", + "desc": "将两个对象包装为一个对象,优先访问第一个对象,如果访问失败则访问第二个对象。", + "name": "object_compositor_t", "parent": "object_t", - "annotation": { - "scriptable": true - }, - "level": 3 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "timer_info_t*", - "name": "timer", - "desc": "timer_info对象。" - } - ], - "annotation": { - "cast": true, - "scriptable": true - }, - "desc": "转换为timer_info对象(供脚本语言使用)。", - "name": "timer_info_cast", - "return": { - "type": "timer_info_t*", - "desc": "timer_info对象。" - } - } - ], - "events": [], - "properties": [ - { - "name": "on_timer", - "desc": "定时器回调函数。", - "type": "timer_func_t", - "annotation": { - "readable": true - } - }, - { - "name": "ctx", - "desc": "定时器回调函数的上下文", - "type": "void*", - "annotation": { - "readable": true, - "scriptable": true - } - }, - { - "name": "id", - "desc": "定时器的ID\n\n> 为TK\\_INVALID\\_ID时表示无效定时器。", - "type": "uint32_t", - "annotation": { - "readable": true, - "scriptable": true - } - }, - { - "name": "now", - "desc": "当前时间(相对时间,单位为毫秒)。", - "type": "uint64_t", - "annotation": { - "readable": true, - "scriptable": true - } - }, - { - "name": "start", - "desc": "起始时间(相对时间,单位为毫秒)。", - "type": "uint64_t", - "annotation": { - "readable": true - } - }, - { - "name": "duration", - "desc": "时间间隔(单位为毫秒)。", - "type": "uint32_t", - "annotation": { - "readable": true - } - }, - { - "name": "on_destroy", - "desc": "定时器销毁时的回调函数。", - "type": "tk_destroy_t", - "annotation": { - "readable": true - } - }, - { - "name": "on_destroy_ctx", - "desc": "定时器销毁时的回调函数上下文。", - "type": "void*", - "annotation": { - "readable": true - } - } - ], - "header": "tkc/timer_info.h", - "desc": "单个定时器的信息。", - "name": "timer_info_t", - "parent": "object_t", - "annotation": { - "scriptable": true - }, "level": 3 }, { @@ -17521,337 +20499,98 @@ { "params": [ { - "type": "event_source_t*", - "name": "source", - "desc": "event_source对象。" + "type": "tk_iostream_t*", + "name": "stream", + "desc": "iostream对象。" } ], "annotation": {}, - "desc": "获取文件描述符。", - "name": "event_source_get_fd", + "desc": "获取输入流对象。", + "name": "tk_iostream_get_istream", + "return": { + "type": "tk_istream_t*", + "desc": "返回输入流对象。" + } + }, + { + "params": [ + { + "type": "tk_iostream_t*", + "name": "stream", + "desc": "iostream对象。" + } + ], + "annotation": {}, + "desc": "获取输出流对象。", + "name": "tk_iostream_get_ostream", + "return": { + "type": "tk_ostream_t*", + "desc": "返回输出流对象。" + } + }, + { + "params": [ + { + "type": "tk_iostream_t*", + "name": "stream", + "desc": "iostream对象。" + }, + { + "type": "void*", + "name": "buff", + "desc": "返回数据的缓冲区。" + }, + { + "type": "uint32_t", + "name": "max_size", + "desc": "缓冲区的大小。" + } + ], + "annotation": {}, + "desc": "读取数据。", + "name": "tk_iostream_read", "return": { "type": "int32_t", - "desc": "返回文件描述符。" + "desc": "返回负数表示读取失败,否则返回实际读取数据的长度。" } }, { "params": [ { - "type": "event_source_t*", - "name": "source", - "desc": "event_source对象。" - } - ], - "annotation": {}, - "desc": "分发事件。", - "name": "event_source_dispatch", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "event_source_t*", - "name": "source", - "desc": "event_source对象。" - }, - { - "type": "void*", - "name": "tag", - "desc": "tag。" - } - ], - "annotation": {}, - "desc": "设置tag,方便通过tag一次移除多个事件源。", - "name": "event_source_set_tag", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "event_source_t*", - "name": "source", - "desc": "event_source对象。" - } - ], - "annotation": {}, - "desc": "对于没有文件描述符的事件源,需要自己检查是否准备就绪。", - "name": "event_source_check", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "event_source_t*", - "name": "source", - "desc": "event_source对象。" - } - ], - "annotation": {}, - "desc": "获取唤醒时间(ms)。", - "name": "event_source_get_wakeup_time", - "return": { - "type": "uint32_t", - "desc": "返回唤醒时间(ms)。" - } - } - ], - "events": [], - "properties": [], - "header": "tkc/event_source.h", - "desc": "表示一个事件源。\n\n事件源有下列两种方式:\n\n* 对于有文件描述符的事件源(如socket),get_fd返回一个有效的文件描述符。\n* 对于定时器,则get_wakeup_time返回下次唤醒的时间。", - "name": "event_source_t", - "parent": "object_t", - "level": 3 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "timer_manager_t*", - "name": "timer_manager", - "desc": "定时器管理器对象。" - } - ], - "annotation": {}, - "desc": "创建timer事件源。", - "name": "event_source_timer_create", - "return": { - "type": "event_source_t*", - "desc": "返回事件源对象。" - } - } - ], - "events": [], - "properties": [], - "header": "tkc/event_source_timer.h", - "desc": "timer事件源。", - "name": "event_source_timer_t", - "parent": "object_t", - "level": 3 - }, - { - "type": "class", - "methods": [ - { - "params": [], - "annotation": { - "constructor": true, - "scriptable": true, - "gc": true - }, - "desc": "创建对象。", - "name": "object_default_create", - "return": { - "type": "object_t*", - "desc": "返回object对象。" - } - }, - { - "params": [ - { - "type": "object_default_t*", - "name": "o", - "desc": "被克隆的对象。" - } - ], - "annotation": { - "constructor": true - }, - "desc": "克隆对象。", - "name": "object_default_clone", - "return": { - "type": "object_t*", - "desc": "返回object对象。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "对象。" - } - ], - "annotation": { - "deconstructor": true, - "scriptable": true, - "gc": true - }, - "desc": "for script gc", - "name": "object_default_unref", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "对象。" - } - ], - "annotation": { - "scriptable": true - }, - "desc": "清除全部属性。", - "name": "object_default_clear_props", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "object_t*", - "name": "obj", - "desc": "对象。" - }, - { - "type": "tk_compare_t", - "name": "cmp", - "desc": "比较函数。" - }, - { - "type": "const void*", - "name": "data", - "desc": "要比较的数据。" - } - ], - "annotation": {}, - "desc": "查找满足条件的属性,并返回它的值。", - "name": "object_default_find_prop", - "return": { - "type": "value_t*", - "desc": "返回属性的值。" - } - } - ], - "events": [], - "properties": [ - { - "name": "props_size", - "desc": "属性个数。", - "type": "uint32_t", - "annotation": { - "readable": true, - "scriptable": true - } - }, - { - "name": "props_capacity", - "desc": "属性数组的容量。", - "type": "uint32_t", - "annotation": { - "readable": true - } - }, - { - "name": "props", - "desc": "属性数组。", - "type": "named_value_t", - "annotation": { - "readable": true - } - } - ], - "header": "tkc/object_default.h", - "desc": "对象接口的缺省实现。\n\n内部使用有序数组保存所有属性,可以快速查找指定名称的属性。", - "name": "object_default_t", - "parent": "object_t", - "annotation": { - "scriptable": true - }, - "level": 3 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "idle_manager_t*", - "name": "idle_manager", - "desc": "定时器管理器对象。" - } - ], - "annotation": {}, - "desc": "创建idle事件源。", - "name": "event_source_idle_create", - "return": { - "type": "event_source_t*", - "desc": "返回事件源对象。" - } - } - ], - "events": [], - "properties": [], - "header": "tkc/event_source_idle.h", - "desc": "idle事件源。", - "name": "event_source_idle_t", - "parent": "object_t", - "level": 3 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "int", - "name": "fd", - "desc": "可以用select等待的文件描述符。" - }, - { - "type": "event_source_on_event_t", - "name": "on_event", - "desc": "用户的事件处理函数。" - }, - { - "type": "void*", - "name": "ctx", - "desc": "on_event函数的上下文。" - } - ], - "annotation": {}, - "desc": "创建fd事件源。", - "name": "event_source_fd_create", - "return": { - "type": "event_source_t*", - "desc": "返回事件源对象。" - } - } - ], - "events": [], - "properties": [], - "header": "tkc/event_source_fd.h", - "desc": "fd事件源。用于文件、管道和套接字。", - "name": "event_source_fd_t", - "parent": "object_t", - "level": 3 - }, - { - "type": "class", - "methods": [ - { - "params": [ - { - "type": "tk_ostream_t*", + "type": "tk_iostream_t*", "name": "stream", - "desc": "ostream对象。" + "desc": "iostream对象。" + }, + { + "type": "void*", + "name": "buff", + "desc": "返回数据的缓冲区。" + }, + { + "type": "uint32_t", + "name": "max_size", + "desc": "缓冲区的大小。" + }, + { + "type": "uint32_t", + "name": "timeout_ms", + "desc": "timeout." + } + ], + "annotation": {}, + "desc": "读取指定长度的数据。", + "name": "tk_iostream_read_len", + "return": { + "type": "int32_t", + "desc": "返回负数表示读取失败,否则返回实际读取数据的长度。" + } + }, + { + "params": [ + { + "type": "tk_iostream_t*", + "name": "stream", + "desc": "iostream对象。" }, { "type": "const void*", @@ -17866,7 +20605,7 @@ ], "annotation": {}, "desc": "写入数据。", - "name": "tk_ostream_write", + "name": "tk_iostream_write", "return": { "type": "int32_t", "desc": "返回负数表示写入失败,否则返回实际写入数据的长度。" @@ -17875,30 +20614,9 @@ { "params": [ { - "type": "tk_ostream_t*", + "type": "tk_iostream_t*", "name": "stream", - "desc": "ostream对象。" - }, - { - "type": "uint32_t", - "name": "offset", - "desc": "偏移量。" - } - ], - "annotation": {}, - "desc": "设置偏移量。", - "name": "tk_ostream_seek", - "return": { - "type": "ret_t", - "desc": "返回RET_OK表示成功,否则表示失败。" - } - }, - { - "params": [ - { - "type": "tk_ostream_t*", - "name": "stream", - "desc": "ostream对象。" + "desc": "iostream对象。" }, { "type": "const void*", @@ -17918,11 +20636,617 @@ ], "annotation": {}, "desc": "写入指定长度的数据。", - "name": "tk_ostream_write_len", + "name": "tk_iostream_write_len", "return": { "type": "int32_t", "desc": "返回负数表示写入失败,否则返回实际写入数据的长度。" } + } + ], + "events": [], + "properties": [], + "header": "tkc/iostream.h", + "desc": "输入输出流的接口。", + "name": "tk_iostream_t", + "parent": "object_t", + "level": 3 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "void*", + "name": "buff_in", + "desc": "输入流缓冲区。" + }, + { + "type": "uint32_t", + "name": "size_in", + "desc": "输入流缓冲区大小。" + }, + { + "type": "void*", + "name": "buff_out", + "desc": "输入流缓冲区。" + }, + { + "type": "uoutt32_t", + "name": "size_out", + "desc": "输入流缓冲区大小。" + }, + { + "type": "bool_t", + "name": "own_the_buff", + "desc": "是否让istream对象拥有buff。" + } + ], + "annotation": {}, + "desc": "创建iostream对象。", + "name": "tk_iostream_mem_create", + "return": { + "type": "tk_iostream_t*", + "desc": "返回iostream对象。" + } + } + ], + "events": [], + "properties": [], + "header": "mem/iostream_mem.h", + "desc": "基于内存实现的输入输出流。", + "name": "tk_iostream_mem_t", + "parent": "tk_iostream_t", + "level": 4 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "const char*", + "name": "port", + "desc": "port name。" + } + ], + "annotation": {}, + "desc": "创建iostream对象。\n> 缺省配置: baudrate=115200 bytesize=8 stopbits=1 flowcontrol=0 parity=0", + "name": "tk_iostream_serial_create", + "return": { + "type": "tk_iostream_t*", + "desc": "返回iostream对象。" + } + }, + { + "params": [ + { + "type": "tk_iostream_t*", + "name": "iostream", + "desc": "串口对象。" + }, + { + "type": "int32_t", + "name": "baudrate", + "desc": "波特率。" + }, + { + "type": "bytesize_t", + "name": "bytesize", + "desc": "字节位数。" + }, + { + "type": "parity_t", + "name": "parity", + "desc": "奇偶校验。" + }, + { + "type": "stopbits_t", + "name": "stopbits", + "desc": "停止位。" + }, + { + "type": "flowcontrol_t", + "name": "flowcontrol", + "desc": "流控。" + } + ], + "annotation": {}, + "desc": "配置串口。", + "name": "tk_iostream_serial_config", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [], + "properties": [], + "header": "serial/iostream_serial.h", + "desc": "基于串口实现的输入输出流。", + "name": "tk_iostream_serial_t", + "parent": "tk_iostream_t", + "level": 4 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "tk_ostream_t*", + "name": "real_ostream", + "desc": "实际的ostream对象。" + } + ], + "annotation": {}, + "desc": "创建ostream对象。\n\n> 只能由iostream_noisy调用。", + "name": "tk_ostream_noisy_create", + "return": { + "type": "tk_ostream_t*", + "desc": "返回ostream对象。" + } + } + ], + "events": [], + "properties": [ + { + "name": "error_level", + "desc": "error level.", + "type": "uint32_t" + }, + { + "name": "error_count", + "desc": "注入的错误数。", + "type": "uint32_t" + }, + { + "name": "write_count", + "desc": "写入的次数。", + "type": "uint32_t" + } + ], + "header": "noisy/ostream_noisy.h", + "desc": "在输出流中注入错误,方便进行可靠性测试。", + "name": "tk_ostream_noisy_t", + "parent": "tk_ostream_t", + "level": 4 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "tk_iostream_t*", + "name": "real_iostream", + "desc": "底层的iostream。" + } + ], + "annotation": {}, + "desc": "创建iostream对象。\n\n本函数自动增加real_iostream的引用计数。", + "name": "tk_iostream_shdlc_create", + "return": { + "type": "tk_iostream_t*", + "desc": "返回iostream对象。" + } + } + ], + "events": [], + "properties": [], + "header": "shdlc/iostream_shdlc.h", + "desc": "基于简化版的HDLC协议实现可靠的iostream。\n\n一般用于串口通信。", + "name": "tk_iostream_shdlc_t", + "parent": "tk_iostream_t", + "level": 4 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "tk_iostream_shdlc_t*", + "name": "iostream", + "desc": "iostream对象。" + } + ], + "annotation": {}, + "desc": "创建istream对象。\n\n> 只能由iostream_shdlc调用。", + "name": "tk_istream_shdlc_create", + "return": { + "type": "tk_istream_t*", + "desc": "返回istream对象。" + } + } + ], + "events": [], + "properties": [ + { + "name": "timeout", + "desc": "读写超时时间(ms)", + "type": "uint32_t" + }, + { + "name": "retry_times", + "desc": "失败重传次数。", + "type": "uint32_t" + } + ], + "header": "shdlc/istream_shdlc.h", + "desc": "reliable istream base on simple HDLC", + "name": "tk_istream_shdlc_t", + "parent": "tk_istream_t", + "level": 4 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "tk_iostream_shdlc_t*", + "name": "iostream", + "desc": "iostream对象。" + } + ], + "annotation": {}, + "desc": "创建ostream对象。\n\n> 只能由iostream_shdlc调用。", + "name": "tk_ostream_shdlc_create", + "return": { + "type": "tk_ostream_t*", + "desc": "返回ostream对象。" + } + } + ], + "events": [], + "properties": [ + { + "name": "timeout", + "desc": "读写超时时间(ms)", + "type": "uint32_t" + }, + { + "name": "retry_times", + "desc": "失败重传次数。", + "type": "uint32_t" + }, + { + "name": "compress_threshold", + "desc": "激活压缩的阈值。", + "type": "uint32_t" + } + ], + "header": "shdlc/ostream_shdlc.h", + "desc": "reliable ostream base on simple HDLC", + "name": "tk_ostream_shdlc_t", + "parent": "tk_ostream_t", + "level": 4 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "tk_iostream_t*", + "name": "real_iostream", + "desc": "底层的iostream。" + } + ], + "annotation": {}, + "desc": "创建iostream对象。\n\n本函数自动增加real_iostream的引用计数。", + "name": "tk_iostream_noisy_create", + "return": { + "type": "tk_iostream_t*", + "desc": "返回iostream对象。" + } + } + ], + "events": [], + "properties": [], + "header": "noisy/iostream_noisy.h", + "desc": "在输出流中注入错误,方便进行可靠性测试。", + "name": "tk_iostream_noisy_t", + "parent": "tk_iostream_t", + "level": 4 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "tk_ostream_t*", + "name": "real_ostream", + "desc": "实际的ostream对象。" + } + ], + "annotation": {}, + "desc": "创建ostream对象。\n\n本函数自动增加real_ostream的引用计数。", + "name": "tk_ostream_retry_create", + "return": { + "type": "tk_ostream_t*", + "desc": "返回ostream对象。" + } + }, + { + "params": [ + { + "type": "tk_ostream_t*", + "name": "ostream", + "desc": "ostream对象。" + }, + { + "type": "uint32_t", + "name": "max_retry_times", + "desc": "最大尝试次数。" + } + ], + "annotation": {}, + "desc": "设置最大尝试次数。", + "name": "tk_ostream_retry_set_max_retry_times", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "tk_ostream_t*", + "name": "ostream", + "desc": "ostream对象。" + }, + { + "type": "uint32_t", + "name": "max_buffer_size", + "desc": "缓存大小。" + } + ], + "annotation": {}, + "desc": "设置最大缓存大小。", + "name": "tk_ostream_retry_set_max_buffer_size", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "tk_ostream_t*", + "name": "ostream", + "desc": "ostream对象。" + } + ], + "annotation": {}, + "desc": "清除缓存的数据。", + "name": "tk_ostream_retry_clear_buffer", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "tk_ostream_t*", + "name": "ostream", + "desc": "ostream对象。" + }, + { + "type": "data_discard_policy_t", + "name": "discard_policy", + "desc": "丢弃策略。" + } + ], + "annotation": {}, + "desc": "设置数据丢弃策略。", + "name": "tk_ostream_retry_set_discard_policy", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [], + "properties": [ + { + "name": "pending_bytes", + "desc": "待重写的数据大小。", + "type": "uint32_t", + "annotation": { + "readable": true + } + }, + { + "name": "pending_packets", + "desc": "待重写的数据包的个数。", + "type": "uint32_t", + "annotation": { + "readable": true + } + }, + { + "name": "discard_bytes", + "desc": "总共丢弃数据的字节数。", + "type": "uint32_t", + "annotation": { + "readable": true + } + }, + { + "name": "discard_packets", + "desc": "总共丢弃数据包的个数。", + "type": "uint32_t", + "annotation": { + "readable": true + } + }, + { + "name": "max_retry_times", + "desc": "尝试次数超过指定的值时丢弃该数据包。", + "type": "uint32_t", + "annotation": { + "readable": true + } + }, + { + "name": "timeout", + "desc": "写超时时间(ms)。", + "type": "uint32_t", + "annotation": { + "readable": true + } + }, + { + "name": "discard_policy", + "desc": "缓存不够时,丢弃数据包的策略。", + "type": "data_discard_policy_t", + "annotation": { + "readable": true + } + } + ], + "header": "misc/ostream_retry.h", + "desc": "如果写数据失败,将数据放入ring_buffer,后面再重试(flush)。\n\n如果重试次数超出最大值,则丢掉数据。", + "name": "tk_ostream_retry_t", + "parent": "tk_ostream_t", + "level": 4 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "uint8_t*", + "name": "buff", + "desc": "返回数据的缓冲区。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "缓冲区的大小。" + }, + { + "type": "uint32_t", + "name": "packet_size", + "desc": "缺省一次读取的数据的长度。" + }, + { + "type": "bool_t", + "name": "own_the_buff", + "desc": "是否让ostream对象拥有buff。" + } + ], + "annotation": {}, + "desc": "创建ostream对象。", + "name": "tk_ostream_mem_create", + "return": { + "type": "tk_ostream_t*", + "desc": "返回ostream对象。" + } + } + ], + "events": [], + "properties": [], + "header": "mem/ostream_mem.h", + "desc": "基于内存实现的输出流。", + "name": "tk_ostream_mem_t", + "parent": "tk_ostream_t", + "level": 4 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "uint8_t*", + "name": "buff", + "desc": "返回数据的缓冲区。" + }, + { + "type": "uint32_t", + "name": "size", + "desc": "缓冲区的大小。" + }, + { + "type": "uint32_t", + "name": "packet_size", + "desc": "缺省一次读取的数据的长度。" + }, + { + "type": "bool_t", + "name": "own_the_buff", + "desc": "是否让istream对象拥有buff。" + } + ], + "annotation": {}, + "desc": "创建istream对象。", + "name": "tk_istream_mem_create", + "return": { + "type": "tk_istream_t*", + "desc": "返回istream对象。" + } + } + ], + "events": [], + "properties": [], + "header": "mem/istream_mem.h", + "desc": "基于内存实现的输入流。", + "name": "tk_istream_mem_t", + "parent": "tk_istream_t", + "level": 4 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "int", + "name": "fd", + "desc": "fd。" + } + ], + "annotation": {}, + "desc": "创建istream对象。", + "name": "tk_istream_serial_create", + "return": { + "type": "tk_istream_t*", + "desc": "返回istream对象。" + } + } + ], + "events": [], + "properties": [], + "header": "serial/istream_serial.h", + "desc": "基于串口实现的输入流。", + "name": "tk_istream_serial_t", + "parent": "tk_istream_t", + "level": 4 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "int", + "name": "sock", + "desc": "socket." + } + ], + "annotation": {}, + "desc": "创建ostream对象。", + "name": "tk_ostream_udp_create", + "return": { + "type": "tk_ostream_t*", + "desc": "返回ostream对象。" + } }, { "params": [ @@ -17932,14 +21256,19 @@ "desc": "ostream对象。" }, { - "type": "uint8_t", - "name": "byte", - "desc": "数据。" + "type": "const char*", + "name": "host", + "desc": "主机或IP。" + }, + { + "type": "int", + "name": "port", + "desc": "端口。" } ], "annotation": {}, - "desc": "写入一个字节的数据。", - "name": "tk_ostream_write_byte", + "desc": "设置目标。", + "name": "tk_ostream_udp_set_target_with_host", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" @@ -17951,11 +21280,16 @@ "type": "tk_ostream_t*", "name": "stream", "desc": "ostream对象。" + }, + { + "type": "struct sockaddr_in", + "name": "addr", + "desc": "地址。" } ], "annotation": {}, - "desc": "刷新数据。", - "name": "tk_ostream_flush", + "desc": "设置目标。", + "name": "tk_ostream_udp_set_target_with_addr", "return": { "type": "ret_t", "desc": "返回RET_OK表示成功,否则表示失败。" @@ -17964,10 +21298,351 @@ ], "events": [], "properties": [], - "header": "tkc/ostream.h", - "desc": "输出流的接口。", - "name": "tk_ostream_t", - "parent": "object_t", - "level": 3 + "header": "inet/ostream_udp.h", + "desc": "基于UDP实现的输出流。", + "name": "tk_ostream_udp_t", + "parent": "tk_ostream_t", + "level": 4 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "int", + "name": "sock", + "desc": "socket." + } + ], + "annotation": {}, + "desc": "创建ostream对象。", + "name": "tk_ostream_tcp_create", + "return": { + "type": "tk_ostream_t*", + "desc": "返回ostream对象。" + } + } + ], + "events": [], + "properties": [], + "header": "inet/ostream_tcp.h", + "desc": "基于TCP实现的输出流。", + "name": "tk_ostream_tcp_t", + "parent": "tk_ostream_t", + "level": 4 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "int", + "name": "sock", + "desc": "socket。" + } + ], + "annotation": {}, + "desc": "创建istream对象。", + "name": "tk_istream_udp_create", + "return": { + "type": "tk_istream_t*", + "desc": "返回istream对象。" + } + }, + { + "params": [ + { + "type": "tk_istream_t*", + "name": "stream", + "desc": "istream对象。" + }, + { + "type": "const char*", + "name": "host", + "desc": "主机或IP。" + }, + { + "type": "int", + "name": "port", + "desc": "端口。" + } + ], + "annotation": {}, + "desc": "设置目标。", + "name": "tk_istream_udp_set_target_with_host", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + }, + { + "params": [ + { + "type": "tk_istream_t*", + "name": "stream", + "desc": "istream对象。" + }, + { + "type": "struct sockaddr_in", + "name": "addr", + "desc": "地址。" + } + ], + "annotation": {}, + "desc": "设置目标。", + "name": "tk_istream_udp_set_target_with_addr", + "return": { + "type": "ret_t", + "desc": "返回RET_OK表示成功,否则表示失败。" + } + } + ], + "events": [], + "properties": [], + "header": "inet/istream_udp.h", + "desc": "基于UDP实现的输入流。", + "name": "tk_istream_udp_t", + "parent": "tk_istream_t", + "level": 4 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "const char*", + "name": "host", + "desc": "服务器地址。" + }, + { + "type": "int", + "name": "port", + "desc": "端口。" + } + ], + "annotation": {}, + "desc": "创建iostream对象(客户端)。", + "name": "tk_iostream_udp_create_client", + "return": { + "type": "tk_iostream_t*", + "desc": "返回iostream对象。" + } + }, + { + "params": [ + { + "type": "int", + "name": "sock", + "desc": "socket" + } + ], + "annotation": {}, + "desc": "创建iostream对象(客户端)。", + "name": "tk_iostream_udp_create", + "return": { + "type": "tk_iostream_t*", + "desc": "返回iostream对象。" + } + } + ], + "events": [], + "properties": [], + "header": "inet/iostream_udp.h", + "desc": "基于UDP实现的输入输出流。", + "name": "tk_iostream_udp_t", + "parent": "tk_iostream_t", + "level": 4 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "int", + "name": "sock", + "desc": "socket。" + } + ], + "annotation": {}, + "desc": "创建iostream对象。", + "name": "tk_iostream_tcp_create", + "return": { + "type": "tk_iostream_t*", + "desc": "返回iostream对象。" + } + } + ], + "events": [], + "properties": [], + "header": "inet/iostream_tcp.h", + "desc": "基于TCP实现的输入输出流。", + "name": "tk_iostream_tcp_t", + "parent": "tk_iostream_t", + "level": 4 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "const char*", + "name": "filename", + "desc": "文件名。" + } + ], + "annotation": {}, + "desc": "创建ostream对象。", + "name": "tk_ostream_file_create", + "return": { + "type": "tk_ostream_t*", + "desc": "返回ostream对象。" + } + } + ], + "events": [], + "properties": [], + "header": "file/ostream_file.h", + "desc": "基于文件实现的输出流。", + "name": "tk_ostream_file_t", + "parent": "tk_ostream_t", + "level": 4 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "const char*", + "name": "filename", + "desc": "文件名。" + } + ], + "annotation": {}, + "desc": "创建istream对象。", + "name": "tk_istream_file_create", + "return": { + "type": "tk_istream_t*", + "desc": "返回istream对象。" + } + } + ], + "events": [], + "properties": [], + "header": "file/istream_file.h", + "desc": "基于文件实现的输入流。", + "name": "tk_istream_file_t", + "parent": "tk_istream_t", + "level": 4 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "tk_ostream_t*", + "name": "real_ostream", + "desc": "实际的ostream对象。" + } + ], + "annotation": {}, + "desc": "创建ostream对象。\n\n本函数自动增加real_ostream的引用计数。", + "name": "tk_ostream_buffered_create", + "return": { + "type": "tk_ostream_t*", + "desc": "返回ostream对象。" + } + }, + { + "params": [ + { + "type": "tk_ostream_t*", + "name": "ostream", + "desc": "ostream对象。" + } + ], + "annotation": {}, + "desc": "获取当前缓存数据的长度。", + "name": "tk_ostream_buffered_get_size", + "return": { + "type": "uint32_t", + "desc": "返回缓存数据的长度。" + } + } + ], + "events": [], + "properties": [], + "header": "buffered/ostream_buffered.h", + "desc": "先将数据写入一个缓存区,调用flush时才真正写入底层的ostream。", + "name": "tk_ostream_buffered_t", + "parent": "tk_ostream_t", + "level": 4 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "tk_istream_t*", + "name": "real_istream", + "desc": "实际的istream。" + }, + { + "type": "uint32_t", + "name": "buffer_size", + "desc": "缓冲区的大小。" + } + ], + "annotation": {}, + "desc": "创建istream对象。\n\n本函数自动增加real_ostream的引用计数。", + "name": "tk_istream_buffered_create", + "return": { + "type": "tk_istream_t*", + "desc": "返回istream对象。" + } + } + ], + "events": [], + "properties": [], + "header": "buffered/istream_buffered.h", + "desc": "缓冲输入流。\n\n如果调用者每次只读取少量数据,可以使用本类对底层istream进行装饰,以提高读取效率。", + "name": "tk_istream_buffered_t", + "parent": "tk_istream_t", + "level": 4 + }, + { + "type": "class", + "methods": [ + { + "params": [ + { + "type": "int", + "name": "sock", + "desc": "socket。" + } + ], + "annotation": {}, + "desc": "创建istream对象。", + "name": "tk_istream_tcp_create", + "return": { + "type": "tk_istream_t*", + "desc": "返回istream对象。" + } + } + ], + "events": [], + "properties": [], + "header": "inet/istream_tcp.h", + "desc": "基于TCP实现的输入流。", + "name": "tk_istream_tcp_t", + "parent": "tk_istream_t", + "level": 4 } ] \ No newline at end of file