# HG changeset patch # User Frank Benoit # Date 1234982122 -3600 # Node ID 0ea0c9f9008fc3a1d1f3aa2263b9e34359e3b051 # Parent 66bceed20048fcd26ac32b6fab868f3de4c40ea6 Remove tango deprecation warnings. diff -r 66bceed20048 -r 0ea0c9f9008f collectionimp.d --- a/collectionimp.d Tue Feb 10 17:12:01 2009 +0100 +++ b/collectionimp.d Wed Feb 18 19:35:22 2009 +0100 @@ -1,7 +1,7 @@ module packageimport; import tango.io.FilePath; -import tango.io.File; +import tango.io.device.File; import tango.io.Buffer; import tango.io.stream.FileStream; import tango.io.stream.TextFileStream; @@ -47,7 +47,7 @@ // foreach module foreach( mod; mods ){ auto filename = Format("{}/{}", dir, mod ); - auto cont = cast(char[])File( filename ).read; + auto cont = cast(char[])File.get( filename ); char[][] lines = cont.splitLines(); char[][] outlines = lines.dup; bool found = true; diff -r 66bceed20048 -r 0ea0c9f9008f dwtx/core/internal/runtime/PrintStackUtil.d --- a/dwtx/core/internal/runtime/PrintStackUtil.d Tue Feb 10 17:12:01 2009 +0100 +++ b/dwtx/core/internal/runtime/PrintStackUtil.d Wed Feb 18 19:35:22 2009 +0100 @@ -13,12 +13,12 @@ module dwtx.core.internal.runtime.PrintStackUtil; import dwtx.core.runtime.IStatus; -import tango.io.Print; +import tango.io.stream.Format; import dwt.dwthelper.utils; public class PrintStackUtil { - static public void printChildren(IStatus status, Print!(char) output) { + static public void printChildren(IStatus status, FormatOutput!(char) output) { IStatus[] children = status.getChildren(); if (children is null || children.length is 0) return; @@ -31,7 +31,7 @@ } } -// static public void printChildren(IStatus status, Print!(char) output) { +// static public void printChildren(IStatus status, FormatOutput!(char) output) { // IStatus[] children = status.getChildren(); // if (children is null || children.length is 0) // return; diff -r 66bceed20048 -r 0ea0c9f9008f dwtx/jface/dialogs/DialogSettings.d --- a/dwtx/jface/dialogs/DialogSettings.d Tue Feb 10 17:12:01 2009 +0100 +++ b/dwtx/jface/dialogs/DialogSettings.d Wed Feb 18 19:35:22 2009 +0100 @@ -25,10 +25,9 @@ static import tango.text.convert.Integer; static import tango.text.convert.Float; static import tango.text.Text; -static import tango.io.File; -static import tango.io.Print; +static import tango.io.stream.Format; static import tango.io.model.IConduit; -static import tango.io.stream.FileStream; +import tango.io.device.File; static import tango.text.convert.Format; import tango.core.Exception; alias tango.text.Text.Text!(char) StringBuffer; @@ -242,7 +241,7 @@ //TODO: remove() was added after tango 0.99.5 //n.remove(); } - load(document, document.root.firstChild ); + load(document, document.tree.child ); } catch (IOException e) { // ignore } catch (TextException e) { @@ -255,9 +254,9 @@ */ //TODO: solve overload load(char[]) public void load(String fileName) { - auto f = new tango.io.stream.FileStream.FileInput( fileName ); - load( f.input ); - f.close; + scope file = new File( fileName ); + load( file.input ); + file.close; } /* (non-Javadoc) @@ -265,23 +264,23 @@ */ private void load(Document document, Element root) { - name = root.getAttribute(TAG_NAME).value(); + name = root.attributes.name(null,TAG_NAME).value(); foreach( n; root.query[TAG_ITEM] ){ if( root is n.parent() ){ - String key = n.getAttribute(TAG_KEY).value().dup; - String value = n.getAttribute(TAG_VALUE).value().dup; + String key = n.attributes.name(null,TAG_KEY).value().dup; + String value = n.attributes.name(null,TAG_VALUE).value().dup; items.put(stringcast(key), stringcast(value)); } } foreach( n; root.query[TAG_LIST].dup ){ if( root is n.parent() ){ auto child = n; - String key = child.getAttribute(TAG_KEY).value().dup; + String key = child.attributes.name(null,TAG_KEY).value().dup; char[][] valueList; foreach( node; root.query[TAG_ITEM].dup ){ if (child is node.parent()) { - valueList ~= node.getAttribute(TAG_VALUE).value().dup; + valueList ~= node.attributes.name(null,TAG_VALUE).value().dup; } } arrayItems.put(stringcast(key), new ArrayWrapperString2(valueList) ); @@ -357,7 +356,9 @@ * Method declared on IDialogSettings. */ public void save(String fileName) { - auto stream = new tango.io.stream.FileStream.FileOutput(fileName); + auto stream = new tango.io.device.File.File( + fileName, + tango.io.device.File.File.WriteCreate); XMLWriter writer = new XMLWriter(stream.output); save(writer); writer.close(); @@ -407,7 +408,7 @@ * A simple XML writer. Using this instead of the javax.xml.transform classes allows * compilation against JCL Foundation (bug 80059). */ - private static class XMLWriter : tango.io.Print.Print!(char) { + private static class XMLWriter : tango.io.stream.Format.FormatOutput!(char) { /** current number of tabs to use for ident */ protected int tab; diff -r 66bceed20048 -r 0ea0c9f9008f dwtx/jface/preference/PreferenceStore.d --- a/dwtx/jface/preference/PreferenceStore.d Tue Feb 10 17:12:01 2009 +0100 +++ b/dwtx/jface/preference/PreferenceStore.d Wed Feb 18 19:35:22 2009 +0100 @@ -35,8 +35,8 @@ import dwt.dwthelper.utils; // import dwtx.dwtxhelper.Collection; -import tango.io.Print; -import tango.io.stream.FileStream; +import tango.io.stream.Format; +import tango.io.device.File; import tango.io.model.IConduit; import tango.text.Util; @@ -251,7 +251,7 @@ return defaultValue; } - public void list(Print!(char) print){ + public void list(FormatOutput!(char) print){ foreach( k, v; map ){ print( k )( '=' )( v ).newline; } @@ -631,7 +631,7 @@ * @param out * the print stream */ - public void list(Print!(char) out_) { + public void list(FormatOutput!(char) out_) { properties.list(out_); } @@ -657,7 +657,7 @@ if (filename is null) { throw new IOException("File name not specified");//$NON-NLS-1$ } - FileInput in_ = new FileInput(filename); + File in_ = new File(filename, File.ReadExisting); load(in_.input); in_.close(); } @@ -726,9 +726,9 @@ if (filename is null) { throw new IOException("File name not specified");//$NON-NLS-1$ } - FileOutput out_ = null; + File out_ = null; try { - out_ = new FileOutput(filename); + out_ = new File(filename,File.WriteCreate); save(out_, null); } finally { if (out_ !is null) { diff -r 66bceed20048 -r 0ea0c9f9008f dwtx/ui/internal/forms/widgets/FormTextModel.d --- a/dwtx/ui/internal/forms/widgets/FormTextModel.d Tue Feb 10 17:12:01 2009 +0100 +++ b/dwtx/ui/internal/forms/widgets/FormTextModel.d Wed Feb 18 19:35:22 2009 +0100 @@ -29,7 +29,7 @@ import dwtx.dwtxhelper.Collection; static import tango.text.xml.Document; -static import tango.io.Buffer; +static import tango.io.device.Array; public class FormTextModel { // private static const DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory @@ -96,7 +96,7 @@ } public void parseInputStream(InputStream is_, bool expandURLs) { - auto buf = new tango.io.Buffer.Buffer( 1024 ); + auto buf = new tango.io.device.Array.Array( 1024 ); { int l; byte[1024] a = void; diff -r 66bceed20048 -r 0ea0c9f9008f fixmodule.d --- a/fixmodule.d Tue Feb 10 17:12:01 2009 +0100 +++ b/fixmodule.d Wed Feb 18 19:35:22 2009 +0100 @@ -1,7 +1,7 @@ module packageimport; import tango.io.FilePath; -import tango.io.File; +import tango.io.device.File; import tango.io.Buffer; import tango.io.stream.FileStream; import tango.io.stream.TextFileStream; @@ -28,7 +28,7 @@ // foreach module foreach( mod; mods ){ auto filename = Format("{}/{}", dir, mod ); - auto cont = cast(char[])File( filename ).read; + auto cont = cast(char[])File.get( filename ); char[][] lines = cont.splitLines(); int modLine = -1; foreach( uint idx, char[] line; lines ){ diff -r 66bceed20048 -r 0ea0c9f9008f packageimport.d --- a/packageimport.d Tue Feb 10 17:12:01 2009 +0100 +++ b/packageimport.d Wed Feb 18 19:35:22 2009 +0100 @@ -1,7 +1,7 @@ module packageimport; import tango.io.FilePath; -import tango.io.File; +import tango.io.device.File; import tango.io.Buffer; import tango.io.stream.FileStream; import tango.io.stream.TextFileStream; @@ -29,7 +29,7 @@ foreach( mod; mods ){ auto filename = Format("{}/{}", dir, mod ); Trace.formatln( "{}", filename ); - auto cont = cast(char[])File( filename ).read; + auto cont = cast(char[])File.get( filename ); auto output = new TextFileOutput( filename ); bool firstline = true; void println( char[] l ){