-
Notifications
You must be signed in to change notification settings - Fork 0
XLE‐6꞉ Quoted Strings
Purpose: JSON Compatibility; TOML Compatibility
Description: Keys and any string values can be surrounded in quotes (including values within arrays). Functionally, the first and last set of quotes around a key or value are ignored. Note that they are only ignored if they are the beginning and end of a key or value, not in the middle of one
Created On: May 15th, 2023
Status: Active
Examples:
Original | With Quotes |
---|---|
servers: {
alpha: [10.0.0.2, My Home Server]
bravo: [10.0.0.7, My Work Server]
charlie: [10.0.0.9, My Friend's Server]
aux: {
os : Ubuntu
//Note the double quotes added here
version : 22.04 "LTS"
start time: 14:03:59:10
}
} |
"servers": {
"alpha": ["10.0.0.2", "My Home Server"]
"bravo": ["10.0.0.7", "My Work Server"]
"charlie": ["10.0.0.9", "My Friend's Server"]
"aux": {
// You are not forced to always use quotes.
// Although, this is not recommended for consistency reasons.
"os" : Ubuntu
version : "22.04 "LTS""
"start time" : "14:03:59:10"
}
} |
Example Result (same for both):
get<string>("servers") => "
alpha: [10.0.0.2, My Home Server]
bravo: [10.0.0.7, My Work Server]
charlie:[10.0.0.9, My Friend's Server]
aux: {
os : Ubuntu
version : 22.04 "LTS"
start time: 14:03:59:10
}
"
get<string>("servers.alpha") => "[10.0.0.2, My Home Server]"
get<string[]>("servers.alpha") => { "10.0.0.2", "My Home Server" }
get<string>("servers.aux.os") => "22.04 "LTS""
get<TimeSpan>("servers.aux.start time") => { 14 Days, 3 Hours, 59 Minutes, and 10 Seconds }
Licensed under CC-BY-SA-4.0. See the license file for details.
Do not edit this wiki directly. Refer to the Contribution Guidelines for more details.
XLE-0: Schema Files
XLE-1: Omit Key-Value Separator
XLE-2: Equals as Key-Value Separator
XLE-3: All Value Types in Arrays
XLE-4: Escaped Characters
XLE-5: Commas After Values
XLE-6: Quoted Strings
XLE-7: Root-Level Object or Array
XLE-8: Headers for Objects
XLE-9: Alternate Comment Characters