com.hcl.domino.jna.internal.structs.StringListStruct Maven / Gradle / Ivy
/*
* ==========================================================================
* Copyright (C) 2019-2022 HCL America, Inc. ( http://www.hcl.com/ )
* All rights reserved.
* ==========================================================================
* Licensed under the Apache License, Version 2.0 (the "License"). You may
* not use this file except in compliance with the License. You may obtain a
* copy of the License at .
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
* ==========================================================================
*/
package com.hcl.domino.jna.internal.structs;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import com.hcl.domino.jna.internal.NotesStringUtils;
import com.sun.jna.Pointer;
import com.sun.jna.Structure;
/**
* native declaration : line 2
* This file was autogenerated by JNAerator,
* a tool written by Olivier Chafik that uses a few opensource projects..
* For help, please visit NativeLibs4Java , Rococoa, or JNA.
*/
public class StringListStruct extends BaseStructure {
/** number of strings in the list - 0 indicates empty list ('first' is undefined) */
public int count;
/**
* pointer to first string in list - undefined if count==0
* C type : char*
*/
public Pointer first;
public StringListStruct() {
super();
}
/**
* Converts all string list values to a Java {@link List}
*
* @return list
*/
public List getValues() {
if (count==0) {
return Collections.emptyList();
}
List strValues = new ArrayList<>(count);
int offset = 0;
Pointer stringStartPtr = first;
for (int i=0; i) () -> new StringListStruct());
}
@Override
protected List getFieldOrder() {
return Arrays.asList("count", "first"); //$NON-NLS-1$ //$NON-NLS-2$
}
/**
* @param count number of strings in the list - 0 indicates empty list ('first' is undefined)
* @param first pointer to first string in list - undefined if count==0
* C type : char*
*/
public StringListStruct(int count, Pointer first) {
super();
this.count = count;
this.first = first;
}
public static StringListStruct newInstance(final int count, final Pointer first) {
return AccessController.doPrivileged((PrivilegedAction) () -> new StringListStruct(count, first));
}
public StringListStruct(Pointer peer) {
super(peer);
}
public static StringListStruct newInstance(final Pointer peer) {
return AccessController.doPrivileged((PrivilegedAction) () -> new StringListStruct(peer));
}
public static class ByReference extends StringListStruct implements Structure.ByReference {
};
public static class ByValue extends StringListStruct implements Structure.ByValue {
};
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy