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"`.
31 lines
665 B
Markdown
31 lines
665 B
Markdown
^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.
|