Qore YAML Module  0.6
 All Namespaces Functions Variables Groups Pages
YAML Functions

Functions

hash Qore::YAML::getYAMLInfo ()
 Returns version information about libyaml being used by the yaml module. More...
 
hash Qore::YAML::get_yaml_info ()
 Returns version information about libyaml being used by the yaml module. More...
 
string Qore::YAML::makeYAML (any data, int flags=Qore::YAML::None, softint width=-1, softint indent=2)
 Creates a YAML string from Qore data. More...
 
string Qore::YAML::make_yaml (any data, int flags=Qore::YAML::None, softint width=-1, softint indent=2)
 Creates a YAML string from Qore data. More...
 
any Qore::YAML::parseYAML (string yaml)
 Parses a YAML string and returns the corresponding Qore value or data structure. More...
 
any Qore::YAML::parse_yaml (string yaml)
 Parses a YAML string and returns the corresponding Qore value or data structure. More...
 

Detailed Description

Function Documentation

hash Qore::YAML::get_yaml_info ( )

Returns version information about libyaml being used by the yaml module.

Returns
a hash with keys as in the following table:
  • version: the version string for the library, ex: "0.1.3"
  • major: the integer major version for the library, ex: 0
  • minor: the integer minor version for the library, ex: 1
  • patch: the integer patch version for the library, ex: 3
Code Flags:
CONSTANT
Example:
my hash $hash = get_yaml_info();
Since
yaml 0.5 as a replacement for deprecated camel-case getYAMLInfo()
hash Qore::YAML::getYAMLInfo ( )

Returns version information about libyaml being used by the yaml module.

Code Flags:
CONSTANT, DEPRECATED
Returns
a hash with keys as in the following table:
  • version: the version string for the library, ex: "0.1.3"
  • major: the integer major version for the library, ex: 0
  • minor: the integer minor version for the library, ex: 1
  • patch: the integer patch version for the library, ex: 3
Deprecated:
use get_yaml_info(); camel-case function names were deprecated in yaml 0.5
string Qore::YAML::make_yaml ( any  data,
int  flags = Qore::YAML::None,
softint  width = -1,
softint  indent = 2 
)

Creates a YAML string from Qore data.

For information on Qore to YAML serialization, see Qore to YAML Type Mappings

Code Flags:
RET_VALUE_ONLY
Parameters
dataQore data to convert; cannot contain any objects or a YAML-EMITTER-ERROR exception will be raised
flagsbinary OR'ed YAML Emitter Option Constants
widthdefault line width for output, -1 = no line length limit
indentthe number of spaces to use for indentation when outputting block format or multiple lines; note that libyaml seems to be ignoring this parameter for now, so it may not have any effect
Returns
the YAML string corresponding to the input
Example:
my string $str = make_yaml($data, YAML::Canonical);
Exceptions
YAML-EMITTER-ERRORobject found; YAML library error
See Also
parse_yaml()
Since
yaml 0.5 as a replacement for deprecated camel-case makeYAML()
string Qore::YAML::makeYAML ( any  data,
int  flags = Qore::YAML::None,
softint  width = -1,
softint  indent = 2 
)

Creates a YAML string from Qore data.

For information on Qore to YAML serialization, see Qore to YAML Type Mappings

Code Flags:
RET_VALUE_ONLY, DEPRECATED
Parameters
dataQore data to convert; cannot contain any objects or a YAML-EMITTER-ERROR exception will be raised
flagsbinary OR'ed YAML Emitter Option Constants
widthdefault line width for output, -1 = no line length limit
indentthe number of spaces to use for indentation when outputting block format or multiple lines; note that libyaml seems to be ignoring this parameter for now, so it may not have any effect
Returns
the YAML string corresponding to the input
Exceptions
YAML-EMITTER-ERRORobject found; YAML library error
Deprecated:
use make_yaml(); camel-case function names were deprecated in yaml 0.5
any Qore::YAML::parse_yaml ( string  yaml)

Parses a YAML string and returns the corresponding Qore value or data structure.

For information on YAML to Qore deserialization, see Qore to YAML Type Mappings

Code Flags:
RET_VALUE_ONLY
Parameters
yamlThe YAML string to deserialize
Returns
Qore data as deserialized from the YAML string
Example:
my any $data = parse_yaml($yaml_string);
Exceptions
YAML-PARSER-ERRORerror parsing YAML string
Since
yaml 0.5 as a replacement for deprecated camel-case parseYAML()
See Also
make_yaml()
any Qore::YAML::parseYAML ( string  yaml)

Parses a YAML string and returns the corresponding Qore value or data structure.

For information on YAML to Qore deserialization, see Qore to YAML Type Mappings

Code Flags:
RET_VALUE_ONLY, DEPRECATED
Parameters
yamlThe YAML string to deserialize
Returns
Qore data as deserialized from the YAML string
Exceptions
YAML-PARSER-ERRORerror parsing YAML string
Deprecated:
use parse_yaml(); camel-case function names were deprecated in yaml 0.5