iOS Development Those Things (iii) Jsonkit analytic principle

Source: Internet
Author: User

Json_parse_it: Start parsing, string pointer loops from beginning to end

Jk_parse_next_token: Gets the type and length of the next character
Most separators have a fixed length of 1
Jk_parse_string: Loop moves the pointer until the end symbol, gets the string length
Jk_parse_number: Get the length of a number

Jk_object_for_token: Gets the node (type, length)
Judging type
Jk_cachedobjects: Gets the String object
Jk_cachedobjects: Gets the Number object
Jk_parse_dictionary: Get Dictionary Object
Jk_parse_array: Getting Array objects
Kcfbooleantrue
Kcfbooleanfalse
Kcfnull

Jk_parse_dictionary: Parsing Dictionaries
Cycle
Jk_parse_next_token,jk_object_for_token,: Get key
Jk_parse_next_token, Judge: Sign or error
Jk_parse_next_token,jk_object_for_token,: Get Value

Jk_parse_array parsing an array
Cycle
Jk_parse_next_token,jk_object_for_token,: Get Object

All in all: Json_parse_it is the entrance, Jk_object_for_token as the state machine role, processing each object, Jk_parse_next_token get the next switch of the state machine, then how to deal with the next object,

Text/Pen (Jane's writer)

Original link: Http://www.jianshu.com/p/dc7f581ee8fa

iOS Development Those Things (iii) Jsonkit analytic principle

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.