Module commonapi.utils

The utils module

Info:

  • Copyright: 2017-2018
  • Author: Oskar Eisemuth

Functions

logPrep (prefix) Creates a log routine with prefix
isWindowsOS () Is running on windows.
getTempFilename () Get a valid tempfile.
getFileData (filename, env) Returns the data function result of a game file.
scanDirs (dirs) Scan directories.
createOrderedTable () Create a ordered table
deepcopy (o) Copy a table


Functions

logPrep (prefix)
Creates a log routine with prefix

Parameters:

  • prefix prefix for log

Returns:

    log function
isWindowsOS ()
Is running on windows.

Returns:

    boolean
getTempFilename ()
Get a valid tempfile. Returns a valid tempfile name (on windows including temp directory)

Returns:

    string
getFileData (filename, env)
Returns the data function result of a game file.

Parameters:

  • filename A complete filepath to a lua file
  • env Environment table (optional)

Returns:

    table
scanDirs (dirs)
Scan directories.

Parameters:

  • dirs A complete list of filepaths

Returns:

    {string,...} result of directory scan
createOrderedTable ()
Create a ordered table

Returns:

    {table} a table with ordered key value iteration
deepcopy (o)
Copy a table

Parameters:

  • o

Returns:

    {table} a table deep copy
generated by LDoc 1.4.6 Last updated 2019-03-10 15:12:25