/
niceSOFT
/
swig
Обзор
Документация
Войти
/
niceSOFT
/
swig
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Examples/test-suite/java/li_std_vector_enum_runme.java
27 строк
742 B
William S Fulton
Fix #3475492 - iterating through std::vector wrappers of enumerations.
13 мар 2012, 11:10
13 мар 2012, 11:10
5069394
Код
Авторство
О чём код?
import li_std_vector_enum.*; public class li_std_vector_enum_runme { static { try { System.loadLibrary("li_std_vector_enum"); } catch (UnsatisfiedLinkError e) { System.err.println("Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" + e); System.exit(1); } } public static void main(String argv[]) throws Throwable { EnumVector ev = new EnumVector(); check(ev.getNums().get(0).swigValue(), 10); check(ev.getNums().get(1).swigValue(), 20); check(ev.getNums().get(2).swigValue(), 30); } private static void check(int a, int b) { if (a != b) throw new RuntimeException("values don't match"); } }