public abstract class Platform
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private static class |
Platform.ArchHolder |
static class |
Platform.CPU
The common names of cpu architectures.
|
private static class |
Platform.Darwin
A
Platform subclass representing the MacOS system. |
private static class |
Platform.Default |
static class |
Platform.OS
The common names of operating systems.
|
private static class |
Platform.SingletonHolder
Holds a single, lazily loaded instance of Platform
|
private static class |
Platform.Windows
A
Platform subclass representing the Windows system. |
Modifier and Type | Field and Description |
---|---|
private int |
javaVersionMajor |
private static java.util.Locale |
LOCALE |
private Platform.OS |
os |
Modifier | Constructor and Description |
---|---|
private |
Platform(Platform.OS os)
Constructs a new Platform instance.
|
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.
|
private static Platform.OS |
determineOS()
Determines the operating system jffi is running on
|
private static Platform |
determinePlatform(Platform.OS os)
Determines the Platform that best describes the OS
|
Platform.CPU |
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.
|
java.lang.String |
getLibraryNamePattern()
Gets the regex string used to match platform-specific libraries
|
java.lang.String |
getName()
Gets the name of this Platform.
|
Platform.OS |
getOS()
Gets the current Operating System.
|
static Platform |
getPlatform()
Gets the current Platform
|
boolean |
isSupported()
Checks if the current platform is supported by JFFI.
|
abstract int |
longSize()
Gets the size of a C 'long' on the native platform.
|
java.lang.String |
mapLibraryName(java.lang.String libName)
Maps from a generic library name (e.g.
|
private static Platform |
newDarwinPlatform() |
private static Platform |
newDefaultPlatform(Platform.OS os) |
private static Platform |
newWindowsPlatform() |
private static boolean |
startsWithIgnoreCase(java.lang.String s1,
java.lang.String s2) |
private static final java.util.Locale LOCALE
private final Platform.OS os
private final int javaVersionMajor
private Platform(Platform.OS os)
os
- The current operating system.private static final Platform.OS determineOS()
private static final Platform determinePlatform(Platform.OS os)
os
- The operating system.private static Platform newDarwinPlatform()
private static Platform newWindowsPlatform()
private static Platform newDefaultPlatform(Platform.OS os)
public static final Platform getPlatform()
public final Platform.OS getOS()
public final Platform.CPU getCPU()
public final int getJavaMajorVersion()
public abstract int longSize()
public final int addressSize()
public final long addressMask()
public java.lang.String getName()
public java.lang.String mapLibraryName(java.lang.String libName)
libName
- The library name to mappublic java.lang.String getLibraryNamePattern()
public boolean isSupported()
private static boolean startsWithIgnoreCase(java.lang.String s1, java.lang.String s2)