Revision: 3071 http://vexi.svn.sourceforge.net/vexi/?rev=3071&view=rev Author: mkpg2 Date: 2008-08-11 19:09:47 +0000 (Mon, 11 Aug 2008)
Log Message: ----------- Test for piping. Modified Paths: -------------- trunk/core/org.vexi.core/src/org/vexi/core/Resources.java trunk/core/org.vexi.core/src/org/vexi/core/Vexi.jpp Modified: trunk/core/org.vexi.core/src/org/vexi/core/Resources.java =================================================================== --- trunk/core/org.vexi.core/src/org/vexi/core/Resources.java 2008-08-11 19:08:57 UTC (rev 3070) +++ trunk/core/org.vexi.core/src/org/vexi/core/Resources.java 2008-08-11 19:09:47 UTC (rev 3071) @@ -448,37 +448,6 @@ is.close(); } - - static final int[] ARGTYPES_parseUTF8 = new int[]{JSU.FOUNTAIN}; - static public JS parseUTF8(JS[] args) throws JSExn { - JSU.checkArgs(args, ARGTYPES_parseUTF8); - try { - InputStream is = JSU.getInputStream(args[0]); - if(is==null) return SC_; - try{ - return JSU.S(new String(IOUtil.toByteArray(is))); - }finally{ - is.close(); - } - }catch(IOException e){ - throw JSU.handleFountainExn(e); - } - } - - static final int[] ARGTYPES_writeUTF8 = new int[]{JSU.FOUNTAIN,JSU.ANY}; - public static void writeUTF8(JS[] args) throws JSExn { - JSU.checkArgs(args, ARGTYPES_writeUTF8); - try{ - OutputStream out = JSU.getOutputStream(args[0]); - try{ - out.write(JSU.toString(args[1]).getBytes()); - }finally{ - out.close(); - } - }catch(IOException e){ - throw JSU.handleFountainExn(e); - } - } static final int[] ARGTYPES_parseXML = new int[]{JSU.FOUNTAIN, JSU.OBJ}; public static void parseXML(JS[] args) throws JSExn{ @@ -487,9 +456,8 @@ return; } - static final int[] ARGTYPES_writeXML = new int[]{JSU.FOUNTAIN}; public static JS writeXML(JS[] args) throws JSExn { - JSU.checkArgs(args, ARGTYPES_writeXML); + JSU.checkArgs(args, Fountain.ARGTYPES_afountain); try{ final BufferedWriter out = new BufferedWriter( new OutputStreamWriter(JSU.getOutputStream(args[0]))); Modified: trunk/core/org.vexi.core/src/org/vexi/core/Vexi.jpp =================================================================== --- trunk/core/org.vexi.core/src/org/vexi/core/Vexi.jpp 2008-08-11 19:08:57 UTC (rev 3070) +++ trunk/core/org.vexi.core/src/org/vexi/core/Vexi.jpp 2008-08-11 19:09:47 UTC (rev 3071) @@ -121,6 +121,7 @@ case "stream.cache": return METHOD; case "stream.multiple": return METHOD; case "stream.nameOf": return METHOD; + case "stream.pipe": return METHOD; case "stream.fromString": return METHOD; case "stream.homedir": return Resources.fountainForURL("file:" + System.getProperty("user.home")); case "stream.tempdir": return Resources.fountainForURL("file:" + System.getProperty("java.io.tempdir")); @@ -292,6 +293,7 @@ case "regexp": return new JSRegexp(args[0], null); case "stream.cache": return Resources.cache(args[0]); case "stream.fromString": return new Fountain.ByteArray(JSU.toString(args[0]).getBytes()); + case "stream.pipe": Fountain.pipe(args); return null; case "stream.nameOf": return JSU.S(Fountain.nameOf(args)); case "stream.parse.html": throw new JSExn("not implemented yet"); //return null; // FIXME backgrounding @@ -301,7 +303,7 @@ try{ return args[0] == null ? null : Fountain.newZip((Fountain)args[0]); } catch(IOException e){ throw new JSExn(e.getMessage()); } //case "stream.uncab": return a == null ? null : new Stream.Cab(a); - case "stream.parse.utf8": return Resources.parseUTF8(args); + case "stream.parse.utf8": return Fountain.parseUTF8(args); case "stream.write.xml": return Resources.writeXML(args); case "thread.sleep": JSU.sleep(JSU.toInt(args[0])); return null; case "ui.browser": Platform.newBrowserWindow(JSU.toString(args[0])); return null; @@ -327,7 +329,7 @@ //#switch(JSU.toString(method)) case "regexp": return new JSRegexp(args[0], args[1]); case "stream.parse.xml": Resources.parseXML(args); return null; - case "stream.write.utf8": Resources.writeUTF8(args); return null; + case "stream.write.utf8": Fountain.writeUTF8(args); return null; //#end case 3: //#switch(JSU.toString(method)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Vexi-svn mailing list Vexi-svn@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/vexi-svn