Files
wren/doc/site/modules/os/platform.markdown
T
Bob Nystrom 7768d1c9cd feat: add Platform.isWindows static method to check for Windows OS
Add a new `isWindows` static method to the `Platform` class that returns `true` when the host operating system name equals "Windows". This provides a less stringly-typed API compared to checking `Platform.name` directly. The implementation is a simple delegation to the existing `name` foreign method, comparing it against the "Windows" string. Includes a test that verifies `Platform.isWindows` is equivalent to `Platform.name == "Windows"`.
2016-05-21 19:53:21 +00:00

665 B

^title Platform Class

The Platform class exposes basic information about the operating system Wren is running on top of.

Static Methods

name

The name of the platform. This roughly describes the operating system, and is usually one of:

  • "iOS"
  • "Linux"
  • "OS X"
  • "POSIX"
  • "Unix"
  • "Windows"

If Wren was compiled for an unknown operating system, returns "Unknown".

isPosix

Returns true if the host operating system is known to support the POSIX standard. This is true for Linux and other Unices, as well as the various Apple operating systems.

isWindows

Returns true if the host operating system is some flavor of Windows.