Esempio n. 1
0
 /**
  * Gets a property from the INI file.
  *
  * @param key.
  * @return String.
  */
 public static String getProperty(String key) {
   long k = NativeHelper.toNativeString(key, false);
   long r = NativeHelper.call(0, "INI_GetProperty", k);
   String res = null;
   if (r != 0) {
     res = NativeHelper.getString(r, 4096, false);
   }
   NativeHelper.free(k);
   return res;
 }
Esempio n. 2
0
 /**
  * Gets the keys from the INI file.
  *
  * @return String.
  */
 public static String[] getPropertyKeys() {
   long d = NativeHelper.call(0, "INI_GetDictionary");
   int n = NativeHelper.getInt(d);
   long keyPtr = NativeHelper.getInt(d + (Native.IS_64 ? 16 : 12));
   String[] res = new String[n];
   for (int i = 0, offset = 0; i < n; i++, offset += NativeHelper.PTR_SIZE) {
     long ptr = NativeHelper.getPointer(keyPtr + offset);
     res[i] = NativeHelper.getString(ptr, 260, false);
   }
   return res;
 }