Top Method Summary
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 */


Method Detail
Top

AddScalarToArray (JsonArray, character)

Purpose: Parses a raw YAML scalar token and adds it to a JsonArray
Notes : See AddScalarToObject for type resolution rules

Parameters:
poArr Progress.Json.ObjectModel.JsonArray
The JsonArray to add the parsed value to
pcRawValue CHARACTER
The raw scalar token from the YAML line
Top

AddScalarToObject (JsonObject, character, character)

Purpose: 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

Parameters:
poObj Progress.Json.ObjectModel.JsonObject
The JsonObject to add the parsed value to
pcKey CHARACTER
The key name
pcRawValue CHARACTER
The raw scalar token from the YAML line
Top

CHARACTER CanonicalDecimal (decimal)

Purpose: 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)

Parameters:
pdeValue DECIMAL
The decimal value to convert
Returns CHARACTER
The canonical decimal string
Top

LONGCHAR Convert (JsonObject)

Purpose: Converts a JsonObject to YAML format
Notes : JSON to YAML is always lossless. The resulting YAML uses
block style with 2-space indentation.

Parameters:
poJson Progress.Json.ObjectModel.JsonObject
The JsonObject to convert
Returns LONGCHAR
The YAML representation as LONGCHAR
Top

CHARACTER EscapeYamlString (character)

Purpose: Escapes special characters in a string for YAML double-quoted style
Notes : Handles backslash, double-quote, newline, carriage return and tab

Parameters:
pcValue CHARACTER
The string to escape
Returns CHARACTER
The escaped string body (without surrounding double-quotes)
Top

INTEGER FindMappingColon (character)

Purpose: 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.

Parameters:
pcContent CHARACTER
The trimmed line content to search
Returns INTEGER
The 1-based position of the colon, or 0 if not found
Top

CHARACTER FormatArrayNumber (JsonArray, integer)

Purpose: Formats a number from a JsonArray element in canonical form
Notes :

Parameters:
poArray Progress.Json.ObjectModel.JsonArray
The JsonArray containing the element
piIndex INTEGER
The 1-based element index
Returns CHARACTER
The canonical number string
Top

CHARACTER FormatArrayPrimitive (JsonArray, integer)

Purpose: Formats a primitive value from a JsonArray element as a YAML scalar
Notes :

Parameters:
poArray Progress.Json.ObjectModel.JsonArray
The JsonArray containing the element
piIndex INTEGER
The 1-based index of the element
Returns CHARACTER
The formatted YAML scalar string
Top

CHARACTER FormatNumber (JsonObject, character)

Purpose: Formats a number from a JsonObject property in canonical form
Notes : Removes trailing zeros from the fractional part

Parameters:
poObj Progress.Json.ObjectModel.JsonObject
The JsonObject containing the property
pcName CHARACTER
The property name
Returns CHARACTER
The canonical number string
Top

CHARACTER FormatPrimitive (JsonObject, character)

Purpose: Formats a primitive value from a JsonObject property as a YAML scalar
Notes :

Parameters:
poObj Progress.Json.ObjectModel.JsonObject
The JsonObject containing the property
pcName CHARACTER
The property name
Returns CHARACTER
The formatted YAML scalar string
Top

CHARACTER FormatString (character)

Purpose: Formats a string value applying YAML quoting rules
Notes : Uses double-quoted style when quoting is required

Parameters:
pcValue CHARACTER
The string value to format
Returns CHARACTER
The formatted (possibly double-quoted) string
Top

INTEGER GetLineIndent (character)

Purpose: Returns the number of leading spaces in a YAML line
Notes :

Parameters:
pcLine CHARACTER
The line to measure
Returns INTEGER
The number of leading space characters
Top

CHARACTER Indent (integer)

Purpose: Returns an indentation string for the given depth
Notes :

Parameters:
piDepth INTEGER
The indentation depth
Returns CHARACTER
A string of (piDepth * iIndentSize) spaces
Top

LOGICAL IsSequenceLine (character)

Purpose: Returns TRUE if a trimmed YAML line starts a sequence item
Notes : A sequence line begins with "- " or is exactly "-"

Parameters:
pcContent CHARACTER
The trimmed line content
Returns LOGICAL
TRUE if the line is a sequence item
Top

LOGICAL LooksLikeYamlNumber (character)

Purpose: Checks whether a string matches a YAML numeric scalar pattern
Notes : Matches integers, decimals, and scientific notation

Parameters:
pcValue CHARACTER
The string to check
Returns LOGICAL
TRUE if the string would be parsed as a number by a YAML parser
Top

MergeJsonObject (JsonObject, JsonObject)

Purpose: 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.

Parameters:
poTarget Progress.Json.ObjectModel.JsonObject
The JsonObject to merge properties into
poSource Progress.Json.ObjectModel.JsonObject
The JsonObject to copy properties from
Top

DECIMAL ParseDecimalValue (character)

Purpose: Parses a decimal value from a YAML numeric token
Notes : Enforces US locale for parsing because YAML always uses
period as the decimal separator

Parameters:
pcValue CHARACTER
The numeric token string
Returns DECIMAL
The parsed decimal value
Top

Progress.Json.ObjectModel.JsonObject ParseObject (integer, integer, integer)

Purpose: 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.

Parameters:
piIndent INTEGER
Expected indentation of mapping entries
piStart INTEGER
First line index to process (1-based)
piNext INTEGER
OUTPUT Next line index to process after this mapping
Returns Progress.Json.ObjectModel.JsonObject
The parsed JsonObject
Top

Progress.Json.ObjectModel.JsonArray ParseSequence (integer, integer, integer)

Purpose: 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.

Parameters:
piIndent INTEGER
Indentation of the "- " sequence markers
piStart INTEGER
First line index to process (1-based)
piNext INTEGER
OUTPUT Next line index to process after this sequence
Returns Progress.Json.ObjectModel.JsonArray
The parsed JsonArray
Top

LOGICAL ResolveScalar (character, character)

Purpose: 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.

Parameters:
pcRawValue CHARACTER
The raw YAML scalar token
pcResolved CHARACTER
OUTPUT The resolved string value or type sentinel
Returns LOGICAL
TRUE if value is null or boolean; FALSE for string/number
Top

SkipBlankAndComment (integer, integer)

Purpose: Advances an index past blank lines and comment-only lines
Notes : Uses the cParseLines / iParseLineCount instance variables populated by ToJson.

Parameters:
piStart INTEGER
Starting index
piNext INTEGER
OUTPUT Index of the first non-blank, non-comment line
Top

CHARACTER StripInlineComment (character)

Purpose: 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.

Parameters:
pcValue CHARACTER
The raw plain scalar (already trimmed)
Returns CHARACTER
The value with any trailing comment removed and re-trimmed
Top

Progress.Json.ObjectModel.JsonObject ToJson (longchar)

Purpose: 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.

Parameters:
plcYaml LONGCHAR
The YAML string to parse
Returns Progress.Json.ObjectModel.JsonObject
The parsed JsonObject
Top

CHARACTER UnescapeYamlString (character)

Purpose: Unescapes a double-quoted YAML string body
Notes : Handles \n, \r, \t, \", \\

Parameters:
pcValue CHARACTER
The string body (without the surrounding double-quotes)
Returns CHARACTER
The unescaped string value
Top

WriteArray (JsonArray, integer, longchar)

Purpose: Writes a JsonArray as a YAML block sequence
Notes : Each element is written with a "- " prefix at the given depth.

Parameters:
poArray Progress.Json.ObjectModel.JsonArray
The JsonArray to write
piDepth INTEGER
The indentation depth (same as the parent key)
pcResult LONGCHAR
OUTPUT The accumulated YAML string
Top

WriteObject (JsonObject, integer, longchar)

Purpose: Writes a JsonObject's properties at the given indentation depth
Notes :

Parameters:
poJson Progress.Json.ObjectModel.JsonObject
The JsonObject to write
piDepth INTEGER
The current indentation depth
pcResult LONGCHAR
OUTPUT The accumulated YAML string
Top

WriteObjectAsSequenceItem (JsonObject, integer, longchar)

Purpose: 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 "- ".

Parameters:
poObj Progress.Json.ObjectModel.JsonObject
The JsonObject to write as a sequence item
piDepth INTEGER
The sequence depth (where the "- " is placed)
pcResult LONGCHAR
OUTPUT The accumulated YAML string
Top

LOGICAL YamlNeedsQuoting (character)

Purpose: Determines whether a plain YAML scalar requires double-quoting
Notes : Checks for reserved words, special leading characters,
inline structural characters, and numeric patterns

Parameters:
pcValue CHARACTER
The string value to check
Returns LOGICAL
TRUE if the value must be double-quoted


©2006-2026 Consultingwerk Ltd.         info@consultingwerk.de         http://www.consultingwerk.de       13.04.2026 10:21:48