EMMA Coverage Report (generated Mon Mar 20 21:34:30 PST 2006)
[all classes][com.moesol.bindings.platform_sdk.windows_api]

COVERAGE SUMMARY FOR SOURCE FILE [HKEY.java]

nameclass, %method, %block, %line, %
HKEY.java100% (1/1)57%  (4/7)56%  (48/86)65%  (13/20)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class HKEY100% (1/1)57%  (4/7)56%  (48/86)65%  (13/20)
Open (HKEY, String): HKEY 0%   (0/1)0%   (0/5)0%   (0/1)
Open (HKEY, String, int): HKEY 0%   (0/1)0%   (0/17)0%   (0/3)
QueryStringValue (String): String 0%   (0/1)0%   (0/16)0%   (0/3)
<static initializer> 100% (1/1)100% (36/36)100% (7/7)
Close (): void 100% (1/1)100% (3/3)100% (2/2)
HKEY (long): void 100% (1/1)100% (4/4)100% (2/2)
HKEY (long, boolean): void 100% (1/1)100% (5/5)100% (2/2)

1/*
2 * $Id: HKEY.java,v 1.7 2006/02/01 04:47:24 hastings Exp $
3 *
4 * (c) Copyright, Moebius Solutions, Inc., 2004
5 *
6 *                       All Rights Reserved
7 *
8 * This material may be reproduced by or for the U. S. Government
9 * pursuant to the copyright license under the clause at
10 * DFARS 252.227-7014 (OCT 2001).
11 */
12 
13package com.moesol.bindings.platform_sdk.windows_api;
14 
15/**
16 * @author Adam
17 *
18 * To change the template for this generated type comment go to
19 * Window>Preferences>Java>Code Generation>Code and Comments
20 */
21public class HKEY extends HANDLE {
22        
23        // Root Keys
24        public static final HKEY CLASSES_ROOT = new HKEY(0x80000000);
25        public static final HKEY CURRENT_USER = new HKEY(0x80000001);
26        public static final HKEY LOCAL_MACHINE = new HKEY(0x80000002);
27        public static final HKEY USERS = new HKEY(0x80000003);
28        public static final HKEY PERFORMANCE_DATA = new HKEY(0x80000004);
29        // #if(WINVER >= 0x0400)
30        public static final HKEY CURRENT_CONFIG = new HKEY(0x80000005);
31        public static final HKEY DYN_DATA = new HKEY(0x80000006);
32        
33        /**
34         * @param handle
35         * @param temporary
36         */
37        public HKEY(long handle, boolean temporary) {
38                super(handle, temporary);
39        }
40 
41        /**
42         * @param handle
43         */
44        public HKEY(long handle) {
45                super(handle);
46        }
47 
48        /**
49         * Calls {@link PlatformSDK#RegOpenKeyEx}. Similar to ATL's CRegKey.Open.
50         * @throws Win32Exception unless ERROR_SUCCESS is returned
51         */
52        public static HKEY Open(HKEY hKeyParent, String lpszKeyName, int samDesired) {
53                HKEY out_key[] = { null };
54                PlatformSDK.RegOpenKeyEx(hKeyParent, lpszKeyName, 0, samDesired, out_key);
55                return out_key[0];
56        }
57        
58        /**
59         * Calls Open with KEY_ALL_ACCESS.
60         * @throws Win32Exception unless ERROR_SUCCESS is returned
61         */
62        public static HKEY Open(HKEY hKeyParent, String lpszKeyName) {
63                return Open(hKeyParent, lpszKeyName, PlatformSDK.KEY_ALL_ACCESS);
64        }
65        
66        /**
67         * Calls {@link PlatformSDK#RegCloseKey(HKEY)}
68         * @throws Win32Exception unless ERROR_SUCCESS is returned
69         */
70        public void Close() {
71                PlatformSDK.RegCloseKey(this);
72        }
73 
74        /**
75         * Calls {@link PlatformSDK#RegQueryValue(HKEY, String, Object[])
76         * @param string
77         * @return
78         */
79        public String QueryStringValue(String string) {
80                Object[] out_value = { null };
81                PlatformSDK.RegQueryValue(this, string, out_value);
82                return (String)out_value[0];
83        }
84}

[all classes][com.moesol.bindings.platform_sdk.windows_api]
EMMA 2.0.5312 (C) Vladimir Roubtsov