|
Options |
Name |
Purpose |
|
|
|
AddArrayPrimitive (JsonArray, character)
|
Adds a primitive value to a JsonArray by detecting its type
Notes :
@param poArray The JsonArray to add the value to
@param pcValue The string representation of the value
*/
|
|
|
|
AddPrimitiveValue (JsonObject, character, character)
|
Adds a primitive value to a JsonObject by detecting its type
Notes : Detects null, boolean, number, and string (with unquoting)
@param poObject The JsonObject to add the value to
@param pcKey The property name
@param pcValue The string representation of the value
*/
|
|
|
|
CHARACTER CanonicalDecimal (decimal)
|
Converts a decimal to canonical string representation
Notes : Strips trailing zeros from the fractional part
@param pdeValue The decimal value to convert
@return The canonical decimal string
*/
|
|
|
|
LONGCHAR Convert (JsonObject)
|
Converts a JsonObject to TOON format
Notes :
@param poJson The JsonObject to convert
@return The TOON representation as LONGCHAR
*/
|
|
|
|
CHARACTER EscapeString (character)
|
Escapes special characters in a quoted TOON string
Notes : Only the five TOON escape sequences are used
@param pcValue The string to escape
@return The escaped string
*/
|
|
|
|
INTEGER FindKeyColon (character)
|
Finds the position of the key-terminating colon in a line
Notes : Skips colons inside quoted strings and array headers
@param pcLine The line to search
@return The position of the colon, or 0 if not found
*/
|
|
|
|
CHARACTER FormatArrayNumber (JsonArray, integer)
|
Formats a number from a JsonArray element in canonical form
Notes :
@param poArray The JsonArray containing the element
@param piIndex The 1-based index of the element
@return The canonical number string
*/
|
|
|
|
CHARACTER FormatArrayPrimitive (JsonArray, integer)
|
Formats a primitive value from a JsonArray element
Notes :
@param poArray The JsonArray containing the element
@param piIndex The 1-based index of the element
@return The formatted primitive value
*/
|
|
|
|
CHARACTER FormatNumber (JsonObject, character)
|
Formats a number from a JsonObject property in canonical form
Notes : Removes trailing zeros, ensures no exponent notation
@param poObj The JsonObject containing the property
@param pcName The property name
@return The canonical number string
*/
|
|
|
|
CHARACTER FormatPrimitive (JsonObject, character)
|
Formats a primitive value from a JsonObject property
Notes : Applies TOON quoting and number canonicalization rules
@param poObj The JsonObject containing the property
@param pcName The property name
@return The formatted primitive value
*/
|
|
|
|
CHARACTER FormatString (character)
|
Formats a string value with TOON quoting rules
Notes : Quotes are added only when necessary per the spec
@param pcValue The string value to format
@return The formatted (possibly quoted) string
*/
|
|
|
|
INTEGER GetDepth (character)
|
Calculates the indentation depth of a line
Notes :
@param pcLine The line to measure
@return The depth (number of indent levels)
*/
|
|
|
|
CHARACTER Indent (integer)
|
Returns the indentation string for the given depth
Notes : Uses 2 spaces per level as the TOON default
@param piDepth The indentation depth
@return The indentation string
*/
|
|
|
|
LOGICAL IsArrayHeader (character)
|
Checks if a key contains an array header pattern
Notes : Looks for key[N] or key[N]{fields} pattern
@param pcKey The key to check
@return TRUE if the key is an array header
*/
|
|
|
|
LOGICAL IsNumericToken (character)
|
Checks if a token represents a numeric value
Notes :
@param pcValue The token to check
@return TRUE if the token is a valid number
*/
|
|
|
|
LOGICAL IsPrimitiveArray (JsonArray)
|
Checks if all elements in an array are primitive types
Notes :
@param poArray The JsonArray to check
@return TRUE if all elements are primitives
*/
|
|
|
|
LOGICAL IsTabularArray (JsonArray)
|
Checks if an array qualifies for tabular encoding
Notes : All elements must be objects with identical key sets and
all values must be primitives
@param poArray The JsonArray to check
@return TRUE if the array can be encoded in tabular format
*/
|
|
|
|
LOGICAL LooksLikeNumber (character)
|
Checks if a string looks like a numeric token
Notes : Matches patterns like 123, -123, 1.5, 1e6, 05
@param pcValue The string to check
@return TRUE if the string could be confused with a number
*/
|
|
|
|
LOGICAL NeedsQuoting (character)
|
Determines if a string value requires quoting in TOON
Notes : Checks for reserved words, special characters, numeric patterns
@param pcValue The string value to check
@return TRUE if the value needs quoting
*/
|
|
|
|
ParseArrayFromHeader (longchar, integer, integer, character, character, integer, JsonObject)
|
Parses an array from its header line
Notes : Handles inline primitive, tabular, and mixed arrays
@param plcLines The full TOON content
@param piTotal The total number of lines
@param piDepth The current depth
@param pcHeader The array header (e.g. key[3] or key[3]{f1,f2})
@param pcInlineValue The value after the colon (for inline arrays)
@param piLine INPUT-OUTPUT The current line index
@param poObject The parent JsonObject
*/
|
|
|
|
ParseArrayFromHeaderForListItem (longchar, integer, integer, character, character, integer, JsonObject)
|
Parses an array header within a list-item object context
Notes :
@param plcLines The full TOON content
@param piTotal The total number of lines
@param piDepth The current depth
@param pcHeader The array header
@param pcInlineValue The inline value after the colon
@param piLine INPUT-OUTPUT The current line index
@param poObject The parent JsonObject
*/
|
|
|
|
DECIMAL ParseDecimal (character)
|
Parses a decimal from a TOON numeric token
Notes : TOON always uses period as decimal point, so we must
enforce American numeric format for parsing
@param pcValue The numeric token string
@return The parsed decimal value
*/
|
|
|
|
ParseInlineValues (character, integer, JsonArray)
|
Parses inline comma-separated values into a JsonArray
Notes :
@param pcValues The comma-separated values string
@param piCount The declared element count
@param poArray The JsonArray to populate
*/
|
|
|
|
ParseListItemObjectFields (longchar, integer, integer, integer, JsonObject)
|
Parses remaining fields of a list-item object
Notes : After the first field on the hyphen line, remaining fields
appear at depth+1
@param plcLines The full TOON content
@param piTotal The total number of lines
@param piDepth The expected indentation depth for remaining fields
@param piLine INPUT-OUTPUT The current line index
@param poObject The object to add fields to
*/
|
|
|
|
ParseListItems (longchar, integer, integer, integer, integer, JsonArray)
|
Parses list items (mixed array) from TOON lines
Notes :
@param plcLines The full TOON content
@param piTotal The total number of lines
@param piDepth The expected indentation depth for items
@param piCount The declared element count
@param piLine INPUT-OUTPUT The current line index
@param poArray The JsonArray to populate
*/
|
|
|
|
ParseObject (longchar, integer, integer, integer, JsonObject)
|
Parses object properties from TOON lines at a given depth
Notes :
@param plcLines The full TOON content split by LF
@param piTotal The total number of lines
@param piDepth The expected indentation depth
@param piLine INPUT-OUTPUT The current line index
@param poObject The JsonObject to populate
*/
|
|
|
|
ParseTabularRows (longchar, integer, integer, integer, character, integer, JsonArray)
|
Parses tabular rows into an array of objects
Notes :
@param plcLines The full TOON content
@param piTotal The total number of lines
@param piDepth The expected indentation depth for rows
@param piCount The declared row count
@param pcFields Comma-separated field names
@param piLine INPUT-OUTPUT The current line index
@param poArray The JsonArray to populate
*/
|
|
|
|
Progress.Json.ObjectModel.JsonObject ToJson (longchar)
|
Parses a TOON string and returns a JsonObject
Notes :
@param plcToon The TOON string to parse
@return The parsed JsonObject
*/
|
|
|
|
CHARACTER UnquoteString (character)
|
Removes surrounding quotes and unescapes a TOON quoted string
Notes :
@param pcValue The quoted string value
@return The unquoted and unescaped string
*/
|
|
|
|
WriteArray (JsonArray, character, integer, longchar)
|
Writes a JsonArray in TOON format
Notes : Determines the appropriate encoding: inline primitive,
tabular (uniform objects), or mixed list items
@param poArray The JsonArray to write
@param pcName The property name for the array
@param piDepth The current indentation depth
@param pcResult OUTPUT The accumulated TOON string
*/
|
|
|
|
WriteInlineArrayAsListItem (JsonArray, integer, longchar)
|
Writes an inline array as a list item
Notes :
@param poArray The JsonArray to write
@param piDepth The current list item depth
@param pcResult OUTPUT The accumulated TOON string
*/
|
|
|
|
WriteInlinePrimitiveArray (JsonArray, character, integer, longchar)
|
Writes a primitive array inline: key[N]: v1,v2,v3
Notes :
@param poArray The JsonArray to write
@param pcName The property name for the array
@param piDepth The current indentation depth
@param pcResult OUTPUT The accumulated TOON string
*/
|
|
|
|
WriteListItemObject (JsonObject, integer, longchar)
|
Writes a JsonObject as a list item (with - prefix for first field)
Notes :
@param poObj The JsonObject to write
@param piDepth The current list item depth
@param pcResult OUTPUT The accumulated TOON string
*/
|
|
|
|
WriteMixedArray (JsonArray, character, integer, longchar)
|
Writes a mixed array using list items
Notes :
@param poArray The JsonArray to write
@param pcName The property name for the array
@param piDepth The current indentation depth
@param pcResult OUTPUT The accumulated TOON string
*/
|
|
|
|
WriteObject (JsonObject, integer, longchar)
|
Writes a JsonObject's properties at the given indentation depth
Notes :
@param poJson The JsonObject to write
@param piDepth The current indentation depth
@param pcResult OUTPUT The accumulated TOON string
*/
|
|
|
|
WriteTabularArray (JsonArray, character, integer, longchar)
|
Writes a tabular array of uniform objects
Notes : Format: key[N]~{f1,f2,f3~}:
v1,v2,v3
v4,v5,v6
@param poArray The JsonArray of uniform objects
@param pcName The property name for the array
@param piDepth The current indentation depth
@param pcResult OUTPUT The accumulated TOON string
*/
|