예제 #1
0
 public int luaCB_text(Lua l, LuaPlugin plugin) {
   try {
     plugin.generateLuaClass(l, new TextOutFile(plugin, object));
   } catch (IOException e) {
     l.pushNil();
     l.pushString("IOException: " + e.getMessage());
     return 2;
   } catch (IllegalArgumentException e) {
     l.pushNil();
     l.pushString("Illegal argument: " + e.getMessage());
     return 2;
   }
   return 1;
 }
예제 #2
0
 public int luaCB_four_to_five(Lua l, LuaPlugin plugin) {
   try {
     plugin.generateLuaClass(l, new BinaryOutFile(plugin, new FourToFiveEncoder(object)));
   } catch (IOException e) {
     l.pushNil();
     l.pushString("IOException: " + e.getMessage());
     return 2;
   } catch (IllegalArgumentException e) {
     l.pushNil();
     l.pushString("Illegal argument: " + e.getMessage());
     return 2;
   }
   return 1;
 }
예제 #3
0
 public int luaCB_deflate(Lua l, LuaPlugin plugin) {
   try {
     plugin.generateLuaClass(l, new BinaryOutFile(plugin, new DeflaterOutputStream(object)));
   } catch (IOException e) {
     l.pushNil();
     l.pushString("IOException: " + e.getMessage());
     return 2;
   } catch (IllegalArgumentException e) {
     l.pushNil();
     l.pushString("Illegal argument: " + e.getMessage());
     return 2;
   }
   return 1;
 }
예제 #4
0
 public static int luaCB_open(Lua l, LuaPlugin plugin) {
   l.pushNil();
   String name = l.checkString(1);
   try {
     plugin.generateLuaClass(l, new BinaryOutFile(plugin, new FileOutputStream(name)));
   } catch (IOException e) {
     l.pushNil();
     l.pushString("IOException: " + e.getMessage());
     return 2;
   } catch (IllegalArgumentException e) {
     l.pushNil();
     l.pushString("Illegal argument: " + e.getMessage());
     return 2;
   }
   return 1;
 }