本文整理汇总了Java中com.intellij.openapi.util.SystemInfo.is32Bit方法的典型用法代码示例。如果您正苦于以下问题:Java SystemInfo.is32Bit方法的具体用法?Java SystemInfo.is32Bit怎么用?Java SystemInfo.is32Bit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.util.SystemInfo
的用法示例。
在下文中一共展示了SystemInfo.is32Bit方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAttributes
import com.intellij.openapi.util.SystemInfo; //导入方法依赖的package包/类
@Override
protected FileAttributes getAttributes(@NotNull String path) throws Exception {
Memory buffer = new Memory(256);
int res = SystemInfo.isLinux ? myLibC.__lxstat64(STAT_VER, path, buffer) : myLibC.lstat(path, buffer);
if (res != 0) return null;
int mode = getModeFlags(buffer) & LibC.S_MASK;
boolean isSymlink = (mode & LibC.S_IFMT) == LibC.S_IFLNK;
if (isSymlink) {
if (!loadFileStatus(path, buffer)) {
return FileAttributes.BROKEN_SYMLINK;
}
mode = getModeFlags(buffer) & LibC.S_MASK;
}
boolean isDirectory = (mode & LibC.S_IFMT) == LibC.S_IFDIR;
boolean isSpecial = !isDirectory && (mode & LibC.S_IFMT) != LibC.S_IFREG;
long size = buffer.getLong(myOffsets[OFF_SIZE]);
long mTime1 = SystemInfo.is32Bit ? buffer.getInt(myOffsets[OFF_TIME]) : buffer.getLong(myOffsets[OFF_TIME]);
long mTime2 = myCoarseTs ? 0 : SystemInfo.is32Bit ? buffer.getInt(myOffsets[OFF_TIME] + 4) : buffer.getLong(myOffsets[OFF_TIME] + 8);
long mTime = mTime1 * 1000 + mTime2 / 1000000;
boolean writable = ownFile(buffer) ? (mode & LibC.WRITE_MASK) != 0 : myLibC.access(path, LibC.W_OK) == 0;
return new FileAttributes(isDirectory, isSpecial, isSymlink, false, size, mTime, writable);
}
示例2: getExecutableName
import com.intellij.openapi.util.SystemInfo; //导入方法依赖的package包/类
@Nullable
private static String getExecutableName(final boolean withSubDir) {
if (SystemInfo.isWindows) return (withSubDir ? "win" + File.separator : "") + (SystemInfo.isAMD64 ? "fsnotifier64.exe" : "fsnotifier.exe");
if (SystemInfo.isMac) return (withSubDir ? "mac" + File.separator : "") + "fsnotifier";
if (SystemInfo.isLinux) return (withSubDir ? "linux" + File.separator : "") +
("arm".equals(SystemInfo.OS_ARCH) ? (SystemInfo.is32Bit ? "fsnotifier-arm" : null)
: (SystemInfo.isAMD64 ? "fsnotifier64" : "fsnotifier"));
return null;
}
示例3: processMappingFailed
import com.intellij.openapi.util.SystemInfo; //导入方法依赖的package包/类
private static void processMappingFailed(final IdeaLoggingEvent event) throws InterruptedException, InvocationTargetException {
if (!ourMappingFailedNotificationPosted && SystemInfo.isWindows && SystemInfo.is32Bit) {
ourMappingFailedNotificationPosted = true;
@SuppressWarnings("ThrowableResultOfMethodCallIgnored") String exceptionMessage = event.getThrowable().getMessage();
String text = exceptionMessage +
"<br>Possible cause: unable to allocate continuous memory chunk of necessary size.<br>" +
"Reducing JVM maximum heap size (-Xmx) may help.";
Notifications.Bus.notify(new Notification("Memory", "Memory Mapping Failed", text, NotificationType.WARNING), null);
}
}
示例4: JnaUnixMediatorImpl
import com.intellij.openapi.util.SystemInfo; //导入方法依赖的package包/类
private JnaUnixMediatorImpl() throws Exception {
if (SystemInfo.isLinux) {
if ("arm".equals(SystemInfo.OS_ARCH)) {
if (SystemInfo.is32Bit) {
myOffsets = LINUX_ARM;
} else {
throw new IllegalStateException("AArch64 architecture is not supported");
}
}
else if ("ppc".equals(SystemInfo.OS_ARCH)) {
myOffsets = SystemInfo.is32Bit ? LNX_PPC32 : LNX_PPC64;
}
else {
myOffsets = SystemInfo.is32Bit ? LINUX_32 : LINUX_64;
}
}
else if (SystemInfo.isMac | SystemInfo.isFreeBSD) {
myOffsets = SystemInfo.is32Bit ? BSD_32 : BSD_64;
}
else if (SystemInfo.isSolaris) {
myOffsets = SystemInfo.is32Bit ? SUN_OS_32 : SUN_OS_64;
}
else {
throw new IllegalStateException("Unsupported OS/arch: " + SystemInfo.OS_NAME + "/" + SystemInfo.OS_ARCH);
}
myLibC = (LibC)Native.loadLibrary("c", LibC.class);
myUid = myLibC.getuid();
myGid = myLibC.getgid();
}
示例5: getLinkText
import com.intellij.openapi.util.SystemInfo; //导入方法依赖的package包/类
private static String getLinkText() {
// TODO ARM support?
if (SystemInfo.isMac) {
return "Mac OS X x64";
}
else if (SystemInfo.isLinux) {
return SystemInfo.is32Bit ? "Linux x86" : "Linux x64";
}
else if (SystemInfo.isWindows) {
return SystemInfo.is32Bit ? "Windows x86" : "Windows x64";
}
else {
return SystemInfo.OS_NAME;
}
}
示例6: is32bit
import com.intellij.openapi.util.SystemInfo; //导入方法依赖的package包/类
public boolean is32bit() {
return SystemInfo.is32Bit;
}