Platforms to show: All Mac Windows Linux Cross-Platform
Back to JSONMBS class.
JSONMBS.ApplyMergePatch(target as JSONMBS, patch as JSONMBS) as JSONMBS New in 24.0
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | JavaScript Object Notation | MBS Util Plugin | 24.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The mergepatch function implement the IETF standard JSON Merge Patch
JSONMBS.ApplyPatch(target as JSONMBS, patch as JSONMBS) as JSONMBS New in 24.0
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | JavaScript Object Notation | MBS Util Plugin | 24.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The jsonpatch functions implement the IETF standard JavaScript Object Notation (JSON) Patch.
The JSON Patch IETF standard requires that the JSON Patch method is atomic, so that if any JSON Patch operation results in an error, the target document is unchanged. The patch function implements this requirement by generating the inverse commands and building an undo stack, which is executed if any part of the patch fails.
JSONMBS.Convert(value as variant) as JSONMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | JavaScript Object Notation | MBS Util Plugin | 19.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Converts values in variant to matching JSON structures.
Currency is converted to double. Color is converted to integer. Dates are converted to string.
We detect arrays of String, Object, Variant, Single, Double, Int32, Int64, Boolean and Currency and convert them to JSON arrays. Dictionaries are converted to JSON objects with texts for keys.
Anything else can raise an exception about an unsupported type.
Please note that Xojo variants don't make a difference between signed and unsigned integers, so we always convert using signed integers.
With version 19.3, the array/dictionary can also contain JSONMBS objects.
See also:
JSONMBS.Flatten(value as JSONMBS) as JSONMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | JavaScript Object Notation | MBS Util Plugin | 23.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The keys in the flattened object are normalized json paths. The values are primitive (string, number, boolean, or null), empty object ({}) or empty array ([]).
JSONMBS.JSONObjectCount as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | JavaScript Object Notation | MBS Util Plugin | 15.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
JSONMBS.MergePatchFromDiff(source as JSONMBS, target as JSONMBS) as JSONMBS New in 24.0
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | JavaScript Object Notation | MBS Util Plugin | 24.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The mergepatch function implement the IETF standard JSON Merge Patch
Returns a JSON Merge Patch.
JSONMBS.NewArrayNode as JSONMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | JavaScript Object Notation | MBS Util Plugin | 13.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Some examples using this method:
JSONMBS.NewBooleanNode(value as Boolean) as JSONMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | JavaScript Object Notation | MBS Util Plugin | 23.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
This is a convenience method to quickly create an array.
JSONMBS.NewBoolNode(value as boolean) as JSONMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | JavaScript Object Notation | MBS Util Plugin | 13.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Some examples using this method:
JSONMBS.NewByteStringNode(Bytes as MemoryBlock) as JSONMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | JavaScript Object Notation | MBS Util Plugin | 23.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Creates a new JSONMBS object with type = kTypeByteString.
See also:
JSONMBS.NewByteStringNode(Bytes as ptr, Length as UInt64) as JSONMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | JavaScript Object Notation | MBS Util Plugin | 23.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Creates a new JSONMBS object with type = kTypeByteString.
See also:
JSONMBS.NewByteStringNode(Bytes as String) as JSONMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | JavaScript Object Notation | MBS Util Plugin | 23.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Creates a new JSONMBS object with type = kTypeByteString.
See also:
JSONMBS.NewCurrencyNode(value as Currency) as JSONMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | JavaScript Object Notation | MBS Util Plugin | 23.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Internally we store number as string with a tag marking it as big decimal, so we output it as number. If you ask for double value, we convert it of course.
JSONMBS.NewDoubleArray(values() as Double) as JSONMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | JavaScript Object Notation | MBS Util Plugin | 13.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
This is a convenience method to quickly create an array.
Version 17.0 and newer return empty JSON array node in case of empty string array.
Older versions returned nil.
JSONMBS.NewFalseNode as JSONMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | JavaScript Object Notation | MBS Util Plugin | 13.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
This is a node which represents a boolean false value.
Some examples using this method:
JSONMBS.NewInt32Array(values() as Int32) as JSONMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | JavaScript Object Notation | MBS Util Plugin | 23.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
This is a convenience method to quickly create an array.
JSONMBS.NewInt64Array(values() as Int64) as JSONMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | JavaScript Object Notation | MBS Util Plugin | 23.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
This is a convenience method to quickly create an array.
JSONMBS.NewInt64Node(value as Int64) as JSONMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | JavaScript Object Notation | MBS Util Plugin | 17.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Some examples using this method:
JSONMBS.NewIntegerArray(values() as Integer) as JSONMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | JavaScript Object Notation | MBS Util Plugin | 13.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
This is a convenience method to quickly create an array.
Version 17.0 and newer return empty JSON array node in case of empty string array.
Older versions returned nil.
JSONMBS.NewNullNode as JSONMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | JavaScript Object Notation | MBS Util Plugin | 13.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
This is a node which represents a nil value.
Some examples using this method:
JSONMBS.NewNumberNode(value as Double) as JSONMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | JavaScript Object Notation | MBS Util Plugin | 13.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
See also:
Some examples using this method:
JSONMBS.NewNumberNode(value as string) as JSONMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | JavaScript Object Notation | MBS Util Plugin | 17.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
This allows you to control formatting of large integer and floating point values.
See also:
JSONMBS.NewObjectNode as JSONMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | JavaScript Object Notation | MBS Util Plugin | 13.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Some examples using this method:
JSONMBS.NewStringArray(values() as string) as JSONMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | JavaScript Object Notation | MBS Util Plugin | 13.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
This is a convenience method to quickly create an array.
Version 17.0 and newer return empty JSON array node in case of empty string array.
Older versions returned nil.
JSONMBS.NewStringNode(value as string) as JSONMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | JavaScript Object Notation | MBS Util Plugin | 13.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Some examples using this method:
JSONMBS.NewTrueNode as JSONMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | JavaScript Object Notation | MBS Util Plugin | 13.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
This is a node which represents a boolean true value.
Some examples using this method:
JSONMBS.NewUInt32Array(values() as UInt32) as JSONMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | JavaScript Object Notation | MBS Util Plugin | 23.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
This is a convenience method to quickly create an array.
JSONMBS.NewUInt64Array(values() as UInt64) as JSONMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | JavaScript Object Notation | MBS Util Plugin | 23.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
This is a convenience method to quickly create an array.
JSONMBS.NewUInt64Node(value as UInt64) as JSONMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | JavaScript Object Notation | MBS Util Plugin | 18.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
JSONMBS.PatchFromDiff(source as JSONMBS, target as JSONMBS) as JSONMBS New in 24.0
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | JavaScript Object Notation | MBS Util Plugin | 24.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Returns a JSON Patch.
The jsonpatch functions implement the IETF standard JavaScript Object Notation (JSON) Patch.
The JSON Patch IETF standard requires that the JSON Patch method is atomic, so that if any JSON Patch operation results in an error, the target document is unchanged. The patch function implements this requirement by generating the inverse commands and building an undo stack, which is executed if any part of the patch fails.
See also:
JSONMBS.PatchFromDiff(source as JSONMBS, target as JSONMBS, KeyToCopy as String) as JSONMBS New in 24.1
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | JavaScript Object Notation | MBS Util Plugin | 24.1 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Same as normal PatchFromDiff, but copies the given primary key field from JSON entries to the diff.
See also:
JSONMBS.Unflatten(value as JSONMBS) as JSONMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | JavaScript Object Notation | MBS Util Plugin | 23.5 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The keys in the flattened object are normalized json paths. The values are primitive (string, number, boolean, or null), empty object ({}) or empty array ([]).
The items on this page are in the following plugins: MBS Util Plugin.