diff options
Diffstat (limited to 'NET/worlds/core/RegKey.java')
| -rw-r--r-- | NET/worlds/core/RegKey.java | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/NET/worlds/core/RegKey.java b/NET/worlds/core/RegKey.java new file mode 100644 index 0000000..86ebf91 --- /dev/null +++ b/NET/worlds/core/RegKey.java @@ -0,0 +1,50 @@ +package NET.worlds.core; + +public class RegKey { + public static final int CLASSES_ROOT = 0; + public static final int CURRENT_USER = 1; + public static final int LOCAL_MACHINE = 2; + public static final int USERS = 3; + public static final int KEYOPEN_READ = 0; + public static final int KEYOPEN_WRITE = 1; + public static final int KEYOPEN_CREATE = 2; + private int hKey; + + static { + nativeInit(); + } + + public static RegKey getRootKey(int type) throws RegKeyNotFoundException { + return new RegKey(getReservedKey(type)); + } + + public RegKey(RegKey base, String subKey, int mode) throws RegKeyNotFoundException { + if (mode == 2) { + this.hKey = createKey(base.hKey, subKey); + } else { + this.hKey = openKey(base.hKey, subKey, mode); + } + } + + public native String getStringValue(String var1); + + public native boolean setStringValue(String var1, String var2, boolean var3); + + public native int getIntValue(String var1); + + public native boolean setIntValue(String var1, int var2); + + public native void close(); + + private static native int getReservedKey(int var0) throws RegKeyNotFoundException; + + private static native int openKey(int var0, String var1, int var2) throws RegKeyNotFoundException; + + private static native int createKey(int var0, String var1); + + public static native void nativeInit(); + + private RegKey(int hKey) { + this.hKey = hKey; + } +} |