|
Options |
Name |
Purpose |
|
|
|
AddScalarToArray (JsonArray, character)
|
Parses a raw YAML scalar token and adds it to a JsonArray
Notes : See AddScalarToObject for type resolution rules
@param poArr The JsonArray to add the parsed value to
@param pcRawValue The raw scalar token from the YAML line
*/
|
|
|
|
AddScalarToObject (JsonObject, character, character)
|
Parses a raw YAML scalar token and adds it to a JsonObject
Notes : Handles YAML null, boolean, number, double-quoted strings,
single-quoted strings, and plain strings
@param poObj The JsonObject to add the parsed value to
@param pcKey The key name
@param pcRawValue The raw scalar token from the YAML line
*/
|
|
|
|
CHARACTER CanonicalDecimal (decimal)
|
Converts a decimal to its canonical string representation
Notes : Strips trailing zeros; uses US locale so the decimal point
is always a period (as required by YAML)
@param pdeValue The decimal value to convert
@return The canonical decimal string
*/
|
|
|
|
LONGCHAR Convert (JsonObject)
|
Converts a JsonObject to YAML format
Notes : JSON to YAML is always lossless. The resulting YAML uses
block style with 2-space indentation.
@param poJson The JsonObject to convert
@return The YAML representation as LONGCHAR
*/
|
|
|
|
CHARACTER EscapeYamlString (character)
|
Escapes special characters in a string for YAML double-quoted style
Notes : Handles backslash, double-quote, newline, carriage return and tab
@param pcValue The string to escape
@return The escaped string body (without surrounding double-quotes)
*/
|
|
|
|
INTEGER FindMappingColon (character)
|
Finds the colon position that acts as the mapping key-value separator
Notes : Ignores colons inside quoted strings. Returns the position of the
first bare ":" not followed by a colon (i.e., not "::") and that
is either at the end of the content or followed by a space/newline.
@param pcContent The trimmed line content to search
@return The 1-based 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 element index
@return The canonical number string
*/
|
|
|
|
CHARACTER FormatArrayPrimitive (JsonArray, integer)
|
Formats a primitive value from a JsonArray element as a YAML scalar
Notes :
@param poArray The JsonArray containing the element
@param piIndex The 1-based index of the element
@return The formatted YAML scalar string
*/
|
|
|
|
CHARACTER FormatNumber (JsonObject, character)
|
Formats a number from a JsonObject property in canonical form
Notes : Removes trailing zeros from the fractional part
@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 as a YAML scalar
Notes :
@param poObj The JsonObject containing the property
@param pcName The property name
@return The formatted YAML scalar string
*/
|
|
|
|
CHARACTER FormatString (character)
|
Formats a string value applying YAML quoting rules
Notes : Uses double-quoted style when quoting is required
@param pcValue The string value to format
@return The formatted (possibly double-quoted) string
*/
|
|
|
|
INTEGER GetLineIndent (character)
|
Returns the number of leading spaces in a YAML line
Notes :
@param pcLine The line to measure
@return The number of leading space characters
*/
|
|
|
|
CHARACTER Indent (integer)
|
Returns an indentation string for the given depth
Notes :
@param piDepth The indentation depth
@return A string of (piDepth * iIndentSize) spaces
*/
|
|
|
|
LOGICAL IsSequenceLine (character)
|
Returns TRUE if a trimmed YAML line starts a sequence item
Notes : A sequence line begins with "- " or is exactly "-"
@param pcContent The trimmed line content
@return TRUE if the line is a sequence item
*/
|
|
|
|
LOGICAL LooksLikeYamlNumber (character)
|
Checks whether a string matches a YAML numeric scalar pattern
Notes : Matches integers, decimals, and scientific notation
@param pcValue The string to check
@return TRUE if the string would be parsed as a number by a YAML parser
*/
|
|
|
|
MergeJsonObject (JsonObject, JsonObject)
|
Merges all properties from a source JsonObject into a target JsonObject
Notes : Copies all properties by type. Handles STRING, NUMBER, BOOLEAN,
NULL, OBJECT, and ARRAY types.
@param poTarget The JsonObject to merge properties into
@param poSource The JsonObject to copy properties from
*/
|
|
|
|
DECIMAL ParseDecimalValue (character)
|
Parses a decimal value from a YAML numeric token
Notes : Enforces US locale for parsing because YAML always uses
period as the decimal separator
@param pcValue The numeric token string
@return The parsed decimal value
*/
|
|
|
|
Progress.Json.ObjectModel.JsonObject ParseObject (integer, integer, integer)
|
Parses a YAML block mapping into a JsonObject
Notes : Processes lines starting at piStart whose indentation
equals piIndent. Returns when a line with lesser indentation
is found. Uses the cParseLines / iParseLineCount instance
variables populated by ToJson.
@param piIndent Expected indentation of mapping entries
@param piStart First line index to process (1-based)
@param piNext OUTPUT Next line index to process after this mapping
@return The parsed JsonObject
*/
|
|
|
|
Progress.Json.ObjectModel.JsonArray ParseSequence (integer, integer, integer)
|
Parses a YAML block sequence into a JsonArray
Notes : Processes lines starting at piStart where the "- " prefix
is at piIndent spaces. Uses the cParseLines / iParseLineCount
instance variables populated by ToJson.
@param piIndent Indentation of the "- " sequence markers
@param piStart First line index to process (1-based)
@param piNext OUTPUT Next line index to process after this sequence
@return The parsed JsonArray
*/
|
|
|
|
LOGICAL ResolveScalar (character, character)
|
Resolves a raw YAML scalar token to its typed string value
Notes : Returns TRUE if the value is a special type (null/boolean).
In that case pcResolved contains "null", "true", or "false".
Returns FALSE for plain strings and numbers; pcResolved then
holds the unquoted, unescaped string value.
Inline YAML comments are stripped from plain scalars.
@param pcRawValue The raw YAML scalar token
@param pcResolved OUTPUT The resolved string value or type sentinel
@return TRUE if value is null or boolean; FALSE for string/number
*/
|
|
|
|
SkipBlankAndComment (integer, integer)
|
Advances an index past blank lines and comment-only lines
Notes : Uses the cParseLines / iParseLineCount instance variables populated by ToJson.
@param piStart Starting index
@param piNext OUTPUT Index of the first non-blank, non-comment line
*/
|
|
|
|
CHARACTER StripInlineComment (character)
|
Strips an inline YAML comment from a plain scalar value
Notes : A comment begins at " #" (space followed by hash). This
method is not called for quoted strings.
@param pcValue The raw plain scalar (already trimmed)
@return The value with any trailing comment removed and re-trimmed
*/
|
|
|
|
Progress.Json.ObjectModel.JsonObject ToJson (longchar)
|
Parses a YAML-formatted string and returns a JsonObject
Notes : Handles the common YAML subset: block mappings, block
sequences, scalars (string, number, boolean, null).
Comments (#) are stripped. Only the first document in a
multi-document stream is processed. Anchors and aliases
are not supported.
@param plcYaml The YAML string to parse
@return The parsed JsonObject
*/
|
|
|
|
CHARACTER UnescapeYamlString (character)
|
Unescapes a double-quoted YAML string body
Notes : Handles \n, \r, \t, \", \\
@param pcValue The string body (without the surrounding double-quotes)
@return The unescaped string value
*/
|
|
|
|
WriteArray (JsonArray, integer, longchar)
|
Writes a JsonArray as a YAML block sequence
Notes : Each element is written with a "- " prefix at the given depth.
@param poArray The JsonArray to write
@param piDepth The indentation depth (same as the parent key)
@param pcResult OUTPUT The accumulated YAML 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 YAML string
*/
|
|
|
|
WriteObjectAsSequenceItem (JsonObject, integer, longchar)
|
Writes a JsonObject as a YAML sequence item
Notes : The first property is placed on the "- " line; all
subsequent properties are indented one level deeper to
align with the content after "- ".
@param poObj The JsonObject to write as a sequence item
@param piDepth The sequence depth (where the "- " is placed)
@param pcResult OUTPUT The accumulated YAML string
*/
|
|
|
|
LOGICAL YamlNeedsQuoting (character)
|
Determines whether a plain YAML scalar requires double-quoting
Notes : Checks for reserved words, special leading characters,
inline structural characters, and numeric patterns
@param pcValue The string value to check
@return TRUE if the value must be double-quoted
*/
|