Results 1 to 9 of 9

Thread: JSON Parser

Threaded View

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jul 2011
    Posts
    24

    JSON Parser

    JSON coder/decoder.
    You must to patch Visual Basic 6 with Service Pack 6 before compiling with this TLB!

    The ToJSON function can parse data with all kinds of errors, but parsing the JSON comments is not implemented.
    The JSON comments are not part of the standard and slow down the parsing.

    Formatted output:
    Code:
    [
      {},
      [
       {},
       []
      ],
      1,
      [
       4,
       5.1,
       {
        "a":1,
        "b":2
       }
      ],
      "3\u000B"
    ]
    C-like empty items parsing (last empty is ignored):
    Code:
    []            []
    [,]           [null]
    [,,]          [null,null]
    [null]        [null]
    [null,null]   [null,null]
    [,1]          [null,1]
    [,,2]         [null,null,2]
    [1,]          [1]
    [2,,]         [2,null]
    Skip whitespace function released as:
    VB Code:
    1. Private Const WhiteSpace = " " & vbTab & vbCrLf
    2. Private Function SkipWhiteSpace() As Integer
    3.   i = i + (CharsCountPtrStr(i, WhiteSpace) * 2)
    4.   SkipWhiteSpace = MemInt(i)
    5. End Function

    Declared through Type Library functions:
    Code:
    CharsCountPtrStr = shlwapi.StrSpnW
    MemInt = msvbvm60.GetMem2
    FindCharsPtrStr = shlwapi.StrPBrkW
    AllocString = oleaut32.SysAllocStringLen
    Also in the project you can find:
    Type library with sources (‎Usable VB and Windows API declarations are added during the programming from December 1, 2011)
    Function to detect is file exists
    Functions for reading and writing the whole binary and text files
    Functions for reading and writing the file times
    Function to detect is current thread active (IsAppActive)
    Function to get window class

    Rate and comment please!
    Attached Files Attached Files
    Last edited by Filyus; Jul 7th, 2012 at 05:49 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width