comparison core/src/luan/modules/IoLuan.java @ 267:1507149fc447

rename Io.get() to Io.Uri() git-svn-id: https://luan-java.googlecode.com/svn/trunk@268 21e917c8-12df-6dd8-5cb6-c86387c605b9
author fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
date Wed, 29 Oct 2014 22:05:55 +0000
parents 454a486d9c19
children eb27e765affb
comparison
equal deleted inserted replaced
266:4dca283b9b74 267:1507149fc447
39 @Override public Object call(LuanState luan,Object[] args) { 39 @Override public Object call(LuanState luan,Object[] args) {
40 LuanTable module = Luan.newTable(); 40 LuanTable module = Luan.newTable();
41 try { 41 try {
42 add( module, "read_console_line", String.class ); 42 add( module, "read_console_line", String.class );
43 module.put( "protocols", newProtocols() ); 43 module.put( "protocols", newProtocols() );
44 add( module, "get", LuanState.class, String.class, Boolean.class ); 44 add( module, "Uri", LuanState.class, String.class, Boolean.class );
45 module.put( "stdin", stdin.table() ); 45 module.put( "stdin", stdin.table() );
46 add( module, "socket_server", Integer.TYPE ); 46 add( module, "socket_server", Integer.TYPE );
47 } catch(NoSuchMethodException e) { 47 } catch(NoSuchMethodException e) {
48 throw new RuntimeException(e); 48 throw new RuntimeException(e);
49 } 49 }
550 if( t == null ) 550 if( t == null )
551 return newProtocols(); 551 return newProtocols();
552 return t; 552 return t;
553 } 553 }
554 554
555 public static LuanTable get(LuanState luan,String name,Boolean loading) throws LuanException { 555 public static LuanTable Uri(LuanState luan,String name,Boolean loading) throws LuanException {
556 int i = name.indexOf(':'); 556 int i = name.indexOf(':');
557 if( i == -1 ) 557 if( i == -1 )
558 throw luan.exception( "invalid Io name '"+name+"', missing protocol" ); 558 throw luan.exception( "invalid Io name '"+name+"', missing protocol" );
559 String protocol = name.substring(0,i); 559 String protocol = name.substring(0,i);
560 String location = name.substring(i+1); 560 String location = name.substring(i+1);