parsePackageRecipe

Parses an in-memory package recipe.

The file format (JSON/SDLang) will be determined from the file extension.

  1. PackageRecipe parsePackageRecipe(string contents, string filename, string parent, string default_package_name, StrictMode mode)
    deprecated
    parsePackageRecipe
    (
    string contents
    ,
    string filename
    ,
    string parent
    ,
    string default_package_name = null
    ,
    StrictMode mode = StrictMode.Ignore
    )
  2. PackageRecipe parsePackageRecipe(string contents, string filename, PackageName parent, string default_package_name, StrictMode mode)

Parameters

contents string

The contents of the recipe file

filename string

Name associated with the package recipe - this is only used to determine the file format from the file extension

parent string

Optional name of the parent package (if this is a sub package)

default_package_name string

Optional default package name (if no package name is found in the recipe this value will be used)

mode StrictMode

Whether to issue errors, warning, or ignore unknown keys in dub.json

Return Value

Returns the package recipe contents

Throws

Throws an exception if an I/O or syntax error occurs

Meta