Squashed 'src/rocksdb/' content from commit 78b8a7d

git-subtree-dir: src/rocksdb
git-subtree-split: 78b8a7d908d7e67cc6664398e39560b76c965773
This commit is contained in:
Vinnie Falco
2014-07-03 17:49:00 -07:00
commit 7bfb4a9ba5
401 changed files with 112784 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
package org.rocksdb.util;
public class Environment {
private static String OS = System.getProperty("os.name").toLowerCase();
public static boolean isWindows() {
return (OS.indexOf("win") >= 0);
}
public static boolean isMac() {
return (OS.indexOf("mac") >= 0);
}
public static boolean isUnix() {
return (OS.indexOf("nix") >= 0 ||
OS.indexOf("nux") >= 0 ||
OS.indexOf("aix") >= 0);
}
public static String getSharedLibraryName(String name) {
if (isUnix()) {
return String.format("lib%s.so", name);
} else if (isMac()) {
return String.format("lib%s.dylib", name);
}
throw new UnsupportedOperationException();
}
public static String getJniLibraryName(String name) {
if (isUnix()) {
return String.format("lib%s.so", name);
} else if (isMac()) {
return String.format("lib%s.jnilib", name);
}
throw new UnsupportedOperationException();
}
}