Open hacperme opened 2 years ago
测试例子:
#include <stdio.h> #include "lite-utils.h" int main() { char * file_name; char * ver; char * file_type; char *line_buf = " \t\n {\"resource_name\":\"tts_mandarin_yw.pos\", \n\"version\":\"1.0.0\", \"resource_type\":\"FILE\"}"; file_type = LITE_json_value_of("resource_type", line_buf); ver = LITE_json_value_of("version", line_buf); file_name = LITE_json_value_of("resource_name", line_buf); printf("line_buf:%s\n", line_buf); printf("file_type:%s\n", file_type); printf("ver:%s\n", ver); printf("file_name:%s\n", file_name); return 0; }
结果:
line_buf: {"resource_name":"tts_mandarin_yw.pos", "version":"1.0.0", "resource_type":"FILE"} file_type:(null) ver:(null) file_name:(null)
测试例子:
结果: