JSONMBS shared properties

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

Back to JSONMBS class.

JSONMBS.ByteStringEncoding as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared property JavaScript Object Notation MBS Util Plugin 23.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Which byte string encoding to use.
Example
Dim mem As MemoryBlock = "Hello World"

Dim dic As New Dictionary
dic.Value("test") = mem

Dim j As New JSONMBS(dic)
j.ByteStringEncoding = j.kByteStringEncodingBase64
MessageBox j.toString
// {"test":"SGVsbG8gV29ybGQ="}

Mainly used for encoding MemoryBlocks included in Dictionaries.
Default is Base64.
(Read and Write property)

JSONMBS.CaseSensitive as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared property JavaScript Object Notation MBS Util Plugin 23.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Whether to find keys with wrong case.
Example
JSONMBS.CaseSensitive = False

Dim f As New JSONMBS

f.value("Hello") = "World"

// finds match
Dim b1 As Boolean = f.HasKey("hello")
Dim v1 As Variant = f.Value("hello")

JSONMBS.CaseSensitive = True

Dim b2 As Boolean = f.HasKey("Hello")
Dim v2 As Variant = f.Value("Hello")

// now try with wrong case...
Dim b3 As Boolean = f.HasKey("hello")
Dim v3 As Variant = f.Value("hello") // -> exception

Break

By default JSON is case sensitive. You can have a key "a" and another key "A" with different values in an object.
If you set CaseSensitive to true, the plugin will look case insensitive to find a match.
(Read and Write property)

JSONMBS.LineLengthLimit as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared property JavaScript Object Notation MBS Util Plugin 23.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The line length limit.
Example
Dim jj As New JSONMBS
For i As Integer = 1 To 20
jj.Append i
next

Dim j As New JSONMBS
j.Compact = False
j.Value("Hello") = jj
Dim s1 As String = j.toString
j.LineLengthLimit = 60
Dim s2 As String = j.toString

// second text has a line break after 14
MessageBox s1+EndOfLine+s2

By default is 120.
(Read and Write property)

JSONMBS.NewLineCharacters as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared property JavaScript Object Notation MBS Util Plugin 23.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The new line character to use.
Example
Dim j As New JSONMBS
j.Compact = false
j.Value("Hello") = "World"
Dim s1 As String = j.toString
j.NewLineCharacters = EndOfLine.Windows
Dim s2 As String = j.toString

MessageBox s1.len.toString+EndOfLine+s2.len.toString // 24 vs 26

Default is EndOfLine.Unix which is Chr(10).
Can be set to others like EndOfLine.Windows if needed.
(Read and Write property)

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


💬 Ask a question or report a problem