forked from kohsuke/com4j
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathSafeArray.java
More file actions
45 lines (41 loc) · 1.01 KB
/
SafeArray.java
File metadata and controls
45 lines (41 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package com4j;
/**
* TODO: General purpose wrapper for COM SAFEARRAY.
*
* <p>
* This class is provided for rare circumstances where the Java code
* needs to control SAFEARRAY more precisely.
*
* <p>
* Users are encouraged to use plain Java arrays
* as much as possible. For example, the following Java method:
* <pre>
* void foo( short[] args );
* </pre>
* would be bridged to the following COM method:
* <pre>
* HRESULT foo( [in] SAFEARRAY(short)* args );
* </pre>
*
* <p>
* This works for the most of the cases, and is much easier to use.
*
* @author Kohsuke Kawaguchi (kk@kohsuke.org)
*/
public final class SafeArray {
/**
* Pointer to the allocated SAFEARRAY.
*/
private int ptr;
public SafeArray( Variant.Type type, Bound[] bounds ) {
}
/**
* Bound of an array index.
*/
public static final class Bound {
public int lbound;
public int ubound;
}
public native Object get( int... indices );
public native void set( int... indices );
}