JSONMBS class

Online Documentation   -   Statistics   -   FAQ   -   Plugin Parts (All, Dependencies)   -   Class hierarchy

New in Version 22.2 22.3 22.4 22.5 23.0 23.1 23.2 23.3 23.4 23.5 24.0 24.1

The list of the   topics,   classes,   interfaces,   controls,   modules,   global methods by category,   global methods by name,   screenshots,   licenses   and   examples.

Platforms to show: All Mac Windows Linux Cross-Platform

JSONMBS class

Type Topic Plugin Version macOS Windows Linux iOS Targets
class JavaScript Object Notation MBS Util Plugin 13.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The class for JSON object parsing and creating.
Example
dim o as JSONMBS = JSONMBS.NewObjectNode

o.AddItemToObject "Hello", JSONMBS.NewNumberNode(1)
o.AddItemToObject "World", JSONMBS.NewNumberNode(2)

MsgBox o.toString

Our JSON class

We can convert integer, boolean, string, double, arrays, dictionaries to JSON internally.
And convert back to variant containing integer, boolean, string, double, arrays and dictionaries.

We back ported things like GetChildNode, GetNextNode and GetPreviousNode, but those are not very efficient and you may want to move to using iterators, query values/entries/keys arrays or access items by index.

The old class is still available in a separated OldJSON Plugin for our customers for compatibility with class renamed to OldJSONMBS.

Byte String Encoding

Constant Value Description
kByteStringEncodingBase64 2 Base64 encoding
Example
kByteStringEncodingBase64URL 3 Base64 URL encoding
Example
kByteStringEncodingHex 1 Hex encoding.
Example
kByteStringEncodingNone 0 Fallback to default behavior.

Query Result Options

Constant Value Description
kPathResultOptionsNoDuplicates 1 Remove duplicates.
kPathResultOptionsPath 4 Return paths.
kPathResultOptionsSort 2 Sort results.
kPathResultOptionsValue 0 Return value.

Tags

Constant Value Description
kTagBase16 &h1a Base16 (Hex)
kTagBase64 &h1b base64
kTagBase64url &h1c base64 URL
kTagBigDec 7 Big decimal
kTagBigFloat 8 Big Float
kTagBigInt 6 Big Integer
kTagClamped &h0e clamped
kTagCode &h14 code
kTagDateTime 2 DateTime
kTagEpochMilli 4 epoch-milli
kTagEpochNano 5 epoch-nano
kTagEpochSecond 3 epoch-second
kTagExt &h11 ext
kTagFloat128 9 Float 128 bit
kTagId &h12 id
kTagMultiDimColumnMajor &h10 multi-dim-column-major
kTagMultiDimRowMajor &h0f multi-dim-row-major
kTagNone 0 n/a
kTagRegex &h13 regex
kTagUndefined 1 undefined
kTagURI &h0d URI

Types

Constant Value Description
kTypeArray 8 For an array node.
kTypeBoolean 1 For a boolean node.
kTypeByteString 7 For a byte string node.
Currently only used for MemoryBlocks passed via Variant.
kTypeDouble 5 For a double node.
kTypeInt64 2 For a Int64 node.
kTypeNull 0 For a null node.
kTypeObject 9 For a object node.
kTypeSingle 4 For a single node.
kTypeString 6 For a string node. Also applies to big numbers.
kTypeUInt64 3 For an uint64 node.

This class has no sub classes.

Some properties using for this class:

Some examples using this class:

Blog Entries

Xojo Developer Magazine

Videos

Release notes


The items on this page are in the following plugins: MBS Util Plugin.


JSONIteratorMBS   -   JSValueMBS


💬 Ask a question or report a problem