Skip to content
Peter edited this page Mar 19, 2024 · 5 revisions
_G.pos

Overview

Functions

Signature Return Description
setPath() nil Set the package path to _G.newPackagePath
instanceClass(class, ...) T Instance a given class
realizePath(path) string Realize path relative to current program
relizePath(path) string DEPRECATED Use realizePath(path)
version() string Get the current PeterOS version
versionId() string Get the current PeterOS version ID (vX.X or vX.X-dev)
require(path) any Require packages from /os/ and /os/lib/

Event Handling

Variables

Variable Description
[log: pos.Logger] OS log

Sub-Modules

gui

Classes

Config

Logger

LoggerLevel

Parser

Queue

Detail

Functions

setPath

_G.pos.setPath(): nil

Set the package path to _G.newPackagePath


instanceClass

_G.pos.instanceClass(class: table, ...): T

Instance a given class

Parameters

  • class: table - Class table of type T
  • ... - constructor arguments

Returns

  • instance: T

realizePath

_G.pos.realizePath(path: string): string

Realize path relative to current program

Parameters

  • path: string - Relative path

Returns

  • path: string - Absolute path

relizePath

_G.pos.relizePath(path: string): string

DEPRECATED use pos.realizePath(path) instead

Realize path relative to current program

Parameters

  • path: string - Relative path

Returns

  • path: string - Absolute path

version

_G.pos.version(): string

Gets the current PeterOS version

Returns

  • version: string - PeterOS version

versionId

_G.pos.versionId(): string

Get the current POS version ID (vX.X or vX.X-dev)

Returns

  • versionId: string - PeterOS version ID in the format vX.X or vX.X-dev

require

_G.pos.require(path: string): any

Require function.

Works to require pos packages from /os/ and /os/lib/

Parameters

  • path: string - Package name and path (. separated)

Returns

  • package: any