public class Platform extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Platform.CPU_TYPE |
static class |
Platform.OS_TYPE |
Modifier and Type | Field and Description |
---|---|
protected int |
addressSize |
static int |
BIG_ENDIAN |
static int |
BYTE_ORDER |
static Platform.CPU_TYPE |
CPU |
static String |
LIBC |
protected Pattern |
libPattern |
static String |
LIBPREFIX |
static String |
LIBSUFFIX |
static int |
LITTLE_ENDIAN |
protected int |
longSize |
static String |
NAME |
static Platform.OS_TYPE |
OS |
Modifier | Constructor and Description |
---|---|
protected |
Platform(Platform.OS_TYPE os) |
Modifier and Type | Method and Description |
---|---|
long |
addressMask()
Gets the 32/64bit mask of a C address/pointer on the native platform.
|
int |
addressSize()
Gets the size of a C address/pointer on the native platform.
|
static IRubyObject |
bsd_p(ThreadContext context,
IRubyObject recv) |
static void |
createPlatformModule(Ruby runtime,
RubyModule ffi) |
Platform.CPU_TYPE |
getCPU()
Gets the current processor architecture the JVM is running on.
|
int |
getJavaMajorVersion()
Gets the version of the Java Virtual Machine (JVM) jffi is running on.
|
String |
getName()
Gets the name of this Platform.
|
Platform.OS_TYPE |
getOS()
Gets the current Operating System.
|
static Platform |
getPlatform()
Gets the current Platform
|
static String |
getProperty(String property,
String defValue)
An extension over
System.getProperty method. |
boolean |
isBSD() |
boolean |
isSupported() |
boolean |
isUnix() |
static IRubyObject |
linux_p(ThreadContext context,
IRubyObject recv) |
int |
longSize()
Gets the size of a C 'long' on the native platform.
|
static IRubyObject |
mac_p(ThreadContext context,
IRubyObject recv) |
String |
mapLibraryName(String libName) |
static IRubyObject |
solaris_p(ThreadContext context,
IRubyObject recv) |
static IRubyObject |
unix_p(ThreadContext context,
IRubyObject recv) |
static IRubyObject |
windows_p(ThreadContext context,
IRubyObject recv) |
public static final Platform.CPU_TYPE CPU
public static final Platform.OS_TYPE OS
public static final String NAME
public static final String LIBPREFIX
public static final String LIBSUFFIX
public static final String LIBC
public static final int BIG_ENDIAN
public static final int LITTLE_ENDIAN
public static final int BYTE_ORDER
protected final int addressSize
protected final int longSize
protected final Pattern libPattern
protected Platform(Platform.OS_TYPE os)
public static final Platform getPlatform()
public final Platform.OS_TYPE getOS()
public final Platform.CPU_TYPE getCPU()
public final int getJavaMajorVersion()
public final boolean isBSD()
public final boolean isUnix()
public final boolean isSupported()
public static void createPlatformModule(Ruby runtime, RubyModule ffi)
public static IRubyObject windows_p(ThreadContext context, IRubyObject recv)
public static IRubyObject mac_p(ThreadContext context, IRubyObject recv)
public static IRubyObject unix_p(ThreadContext context, IRubyObject recv)
public static IRubyObject bsd_p(ThreadContext context, IRubyObject recv)
public static IRubyObject linux_p(ThreadContext context, IRubyObject recv)
public static IRubyObject solaris_p(ThreadContext context, IRubyObject recv)
public static String getProperty(String property, String defValue)
System.getProperty
method.
Handles security restrictions, and returns the default
value if the access to the property is restricted.property
- The system property name.defValue
- The default value.public final int longSize()
public final int addressSize()
public final long addressMask()
public String getName()
Copyright © 2001-2015 JRuby. All Rights Reserved.