util.yaml - ICE 0.1 API documentation

ICE 0.1 API documentation

# util.yaml

ICE-specific YAML utilities.

YAMLNode loadYAML(VFSFile file);

  Load a YAML file with support for ICE data types.

  Parameters:

  VFSFile file | File to load from.

  Throws:
  YAMLException if the YAML could not be parsed or other YAML related errors. VFSException if the file could not be read from.
YAMLNode loadYAML(string source);

  Load YAML from a string.

  Parameters:

  string source | YAML source in string form.

  Throws:
  YAMLException on a parsing error.
void saveYAML(VFSFile file, ref YAMLNode yaml);

  Save to a YAML file with support for ICE data types.

  Parameters:

  VFSFile file | File to save to.
  YAMLNode yaml | YAML document to save.

Constructor iceConstructor();

  Return a YAML constructor customized for ICE.

Resolver iceResolver();

  Return a YAML resolver customized for ICE.

Representer iceRepresenter();

  Return a YAML representer customized for ICE.

class InvalidYAMLValueException: dyaml.exception.YAMLException;

  Thrown when a YAML value is out of range or invalid.

T fromYAML(T, string cond = "")(ref YAMLNode yaml, string context = "");

  Utility function that loads a value froma YAML node, checking its validity.

  If cond is specified, it is used to validate the value (e.g. whether it is positive).
  Currently supported types: float, double, real, Vector2f.
  For floating point types, NaN values are automatically considered invalid.

  Parameters:

  yaml | YAML node to load from.
  context | Added to error message if the value if specified.

  Returns:
  Value loaded from YAML.
  Throws:
  YAMLException if the value is invalid or has unexpected type.

Copyright © Ferdinand Majerech 2011. | Page generated by AutoDDoc and Ddoc.