Skip to content

Char/VT_UI16 support missing from Variant.java/.cpp and VariantUtilities #44

Open
@EJP286CRSKW

Description

@EJP286CRSKW

VT_UI16 maps naturally to Java char or java.lang.Character.

It is possible to create a Variant of type VT_UI2, by passing the value 18.

However that's it. You can't do anything else with this Variant except use it without a value. The following members are missing from Variant.java/.cpp:

public static final short VariantChar = 18;

public Variant(char c)
public char getChar()
public char getVariantChar()
public void putChar(char c)
public void putCharRef(char c)
private native void putVariantChar(char c)
private native void putVariantCharRef(char c)

and whatever is needed in the JNI to support them.

The Java code required is trivial, the same as for any other type, mutatis mutandis. Sadly I don't have the means to modify the JNI as my C++ compiler is too old, otherwise I would provide tested code in both Java and C++.

VariantUtilities also needs to deal with VT_UI16 and java.lang.Character, in variantToObject() and objectToVariant(), in the obvious ways.

This omission is curious given that SafeArray supports arrays of char in both 1D and 2D.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions