Changeset 287

Show
Ignore:
Timestamp:
12/06/07 19:40:08 (1 year ago)
Author:
h3r3tic
Message:

updated to latest tango; added an assertion to Linker.register

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/ddl/DDLError.d

    r279 r287  
    4444    } 
    4545     
    46     public char[] toUtf8(){ 
     46    public char[] toString(){ 
    4747        return message; 
    4848    } 
  • trunk/ddl/FileBuffer.d

    r279 r287  
    4141    static FileBuffer opCall(FilePath path){ 
    4242        FileBuffer _this; 
    43         _this.path = new FilePath(path.toUtf8);        
     43        _this.path = new FilePath(path.toString);      
    4444        _this.data = cast(ubyte[])(new File(_this.path)).read; 
    4545        return _this; 
     
    5555    static FileBuffer opCall(FilePath path,ubyte[] data){ 
    5656        FileBuffer _this; 
    57         _this.path = new FilePath(path.toUtf8);        
     57        _this.path = new FilePath(path.toString);      
    5858        _this.data = data; 
    5959        return _this; 
  • trunk/ddl/Linker.d

    r285 r287  
    6868    */ 
    6969    public this(DynamicModule reason){ 
    70         super("LinkModuleException: cannot resolve '" ~ reason.getName ~ "'\n" ~ reason.toUtf8()); 
     70        super("LinkModuleException: cannot resolve '" ~ reason.getName ~ "'\n" ~ reason.toString()); 
    7171        this.mod = reason; 
    7272    } 
     
    354354    */ 
    355355    public void register(DynamicLibrary lib){ 
     356        assert (lib !is null); 
    356357        debug foreach(DynamicModule mod; lib.getModules){ 
    357358            debugLog("[Linker.register]: {0}",mod.getName); 
  • trunk/ddl/LoaderRegistry.d

    r279 r287  
    153153                        delete lib; // force collection on 'result' 
    154154                        lib = null; 
    155                         throw new LibraryVersionException(buffer.getPath.toUtf8(),attrStdVersion,*libraryStdVersion); 
     155                        throw new LibraryVersionException(buffer.getPath.toString(),attrStdVersion,*libraryStdVersion); 
    156156                    } 
    157157                } 
  • trunk/ddl/PathLibrary.d

    r286 r287  
    7474      debugLog("{0} ({1})\n",prompt,list.length); 
    7575       foreach(path; list){ 
    76           debugLog("  {0}\n",path.toUtf8()); 
     76          debugLog("  {0}\n",path.toString()); 
    7777       } 
    7878   } 
     
    8080   protected DynamicLibrary[] getRootLibraries(){ 
    8181       if(!isPreLoaded){ 
    82            root.toList(delegate void(char[] prefix, char[] str, bool isDirectory){ 
     82           root.toList(delegate bool(FilePath path_, bool isDirectory){ 
    8383               if(isDirectory) return 1; 
    84                auto path = prefix~str
     84               auto path = path_.toString
    8585               auto lib = loaderRegistry.load(path); 
    8686               if(lib){ 
     
    102102                
    103103            // find directories to iterate, and files to load 
    104             void loadDelegate(char[] prefix, char[] str, bool isDirectory){ 
    105                auto path = prefix~str
     104            bool loadDelegate(FilePath path_, bool isDirectory){ 
     105               auto path = path_.toString
    106106                if(isDirectory){ 
    107                     (new FilePath(prefix)).toList(&loadDelegate); 
     107                    (new FilePath(path_.folder)).toList(&loadDelegate); 
    108108                } 
    109109                else{ 
    110                     if(path in this.pathXref) return; // skip already loaded libs 
     110                    if(path in this.pathXref) return 1; // skip already loaded libs 
    111111                    auto lib = loaderRegistry.load(path); 
    112112                    if(lib){ 
     
    119119             
    120120            // find directories to iterate through 
    121             root.toList(delegate void(char[] prefix, char[] str, bool isDirectory){ 
    122                 if(!isDirectory) return; 
    123                 auto path = prefix~str; 
    124                 (new FilePath(prefix)).toList(&loadDelegate); 
     121            root.toList(delegate bool(FilePath path_, bool isDirectory){ 
     122                if(!isDirectory) return 1; 
     123                (new FilePath(path_.folder)).toList(&loadDelegate); 
    125124                return 1; 
    126125            }); 
     
    229228      addNamespaceTranslator(&convertNamespaceToPath); 
    230229       
    231       attributes["PATH.path"] = root.toUtf8
     230      attributes["PATH.path"] = root.toString
    232231   } 
    233232          
     
    277276                         
    278277            foreach (xlat; namespaceTranslators) { 
    279                 char[] path = FilePath.join(this.root.toUtf8(), xlat(namespace.dup)); 
     278                char[] path = FilePath.join(this.root.toString(), xlat(namespace.dup)); 
    280279                if(isFullyLoaded){ 
    281280                    //don't bother with path matching because we're already loaded 
     
    303302                      //find first loadable library file that matches <root-path><path>/* and contains 'name' 
    304303                      DynamicModule mod; 
    305                       (new FilePath(path)).toList(delegate void(char[] prefix, char[] str, bool isDirectory){ 
    306                          DynamicLibrary lib = loaderRegistry.load(prefix~str); 
     304                      (new FilePath(path)).toList(delegate bool(FilePath path_, bool isDirectory){ 
     305                         DynamicLibrary lib = loaderRegistry.load(path_.toString); 
    307306                         if(lib){ 
    308307                            cachedLibraries ~= lib; 
     
    334333   // expects resource in file-path format 
    335334   public override ubyte[] getResource(char[] name){ 
    336       FileConduit fc = new FileConduit(this.root.toUtf8 ~ name); 
     335      FileConduit fc = new FileConduit(this.root.toString ~ name); 
    337336      ubyte[] data = new ubyte[fc.length]; 
    338337      fc.read(data); 
  • trunk/ddl/ar/ArchiveLibrary.d

    r285 r287  
    5656    public this(LoaderRegistry registry, FileBuffer file, bool loadall = true){ 
    5757        this.registry = registry; 
    58         attributes["archive.filename"] = file.getPath.toUtf8(); 
     58        attributes["archive.filename"] = file.getPath.toString(); 
    5959        debug debugLog("* Loading the archive"); 
    6060        load(file, loadall); 
     
    248248         
    249249        foreach(mod; modules){ 
    250             result ~= mod.toUtf8(); 
     250            result ~= mod.toString(); 
    251251        } 
    252252        return result; 
  • trunk/ddl/ar/ArchiveReader.d

    r279 r287  
    8787            get(memberData, fSize); 
    8888        } catch(Exception e) { 
    89             throw new DDLException("Could not read member data - received message " ~ e.toUtf8() ~ " - Archive library is invalid."); 
     89            throw new DDLException("Could not read member data - received message " ~ e.toString() ~ " - Archive library is invalid."); 
    9090        } 
    9191 
  • trunk/ddl/elf/ELFLibrary.d

    r279 r287  
    6161     
    6262    public this(FileBuffer file){ 
    63         attributes["elf.filename"] = file.getPath.toUtf8(); 
     63        attributes["elf.filename"] = file.getPath.toString(); 
    6464        load(file); 
    6565    } 
     
    139139         
    140140        foreach(mod; modules){ 
    141             result ~= mod.toUtf8(); 
     141            result ~= mod.toString(); 
    142142        } 
    143143        return result; 
  • trunk/ddl/elf/ELFObjLoader.d

    r279 r287  
    8383        // establish the correct attributes in the library 
    8484        lib.setAttributes(mod.getAttributes); 
    85         lib.setAttribute("elf.filename",file.getPath.toUtf8());      
     85        lib.setAttribute("elf.filename",file.getPath.toString());      
    8686        return lib; 
    8787    } 
  • trunk/ddl/omf/OMFLibrary.d

    r285 r287  
    4949     
    5050    public this(FileBuffer file){ 
    51         attributes["omf.filename"] = file.getPath.toUtf8(); 
     51        attributes["omf.filename"] = file.getPath.toString(); 
    5252        load(file); 
    5353    } 
     
    175175        char[] result = ""; 
    176176        foreach(DynamicModule mod; modules){ 
    177             result ~= mod.toUtf8(); 
     177            result ~= mod.toString(); 
    178178        } 
    179179        return result; 
  • trunk/ddl/omf/OMFLoader.d

    r279 r287  
    8484        // establish the correct attributes in the library 
    8585        lib.setAttributes(mod.getAttributes); 
    86         lib.setAttribute("omf.filename",file.getPath.toUtf8()); 
     86        lib.setAttribute("omf.filename",file.getPath.toString()); 
    8787         
    8888        debug debugLog("completed loading OMF Module"); 
  • trunk/etc/demangle.d

    r282 r287  
    367367                p[i] = b; 
    368368            } 
    369             result ~= Float.toUtf8(r); 
     369            result ~= Float.toString(r); 
    370370            ni += 10 * 2; 
    371371            } 
  • trunk/utils/bless.d

    r280 r287  
    204204    //NOTE: rather than just be satisfied with what loader likes this file 
    205205    // we load the entire file via its loader to ensure that it will work later. 
    206     DynamicLibrary lib = registry.load(file.getPath.toUtf8()); 
     206    DynamicLibrary lib = registry.load(file.getPath.toString()); 
    207207         
    208208    if(!lib){ 
    209         Stdout.format("Cannot load '{0}'",file.getPath.toUtf8()).newline; 
     209        Stdout.format("Cannot load '{0}'",file.getPath.toString()).newline; 
    210210        return 1; 
    211211    } 
     
    213213    // output 
    214214    if(verbose){ 
    215         Stdout.format("filename: '{0}'",file.getPath.toUtf8()).newline; 
     215        Stdout.format("filename: '{0}'",file.getPath.toString()).newline; 
    216216        Stdout.format("type: '{0}'",lib.getType).newline; 
    217217    }    
     
    219219    if(extract){ 
    220220        if(lib.getType != DDLLoader.typeName){ 
    221             Stdout.format("cannot extract from a non-ddl file ('{0}').",file.getPath.toUtf8()).newline; 
     221            Stdout.format("cannot extract from a non-ddl file ('{0}').",file.getPath.toString()).newline; 
    222222            return 1; 
    223223        } 
    224224    }    
    225225    else if(lib.getType == DDLLoader.typeName){ 
    226         Stdout.format("'{0}' already appears to be a ddl file.",file.getPath.toUtf8()).newline; 
     226        Stdout.format("'{0}' already appears to be a ddl file.",file.getPath.toString()).newline; 
    227227        return 1; 
    228228    } 
  • trunk/utils/bless_bn.d

    r286 r287  
    22// This file is automatically maintained by the BUILD utility, 
    33// Please refrain from manually editing it. 
    4 long auto_build_number = 746
     4long auto_build_number = 759
  • trunk/utils/ddlinfo.d

    r280 r287  
    120120     
    121121    if(!lib){ 
    122         Stdout.format("file '{0}' is not supported.",file.getPath.toUtf8()).newline; 
     122        Stdout.format("file '{0}' is not supported.",file.getPath.toString()).newline; 
    123123        return 1; 
    124124    } 
    125125 
    126     Stdout.format("filename: '{0}'",file.getPath.toUtf8()).newline; 
     126    Stdout.format("filename: '{0}'",file.getPath.toString()).newline; 
    127127    Stdout.format("type: '{0}'",lib.getType).newline; 
    128128     
    129129    if(xRay){ 
    130         Stdout.format("{0}",lib.toUtf8()).newline; 
     130        Stdout.format("{0}",lib.toString()).newline; 
    131131    } 
    132132    else{ 
  • trunk/utils/ddlinfo_bn.d

    r286 r287  
    22// This file is automatically maintained by the BUILD utility, 
    33// Please refrain from manually editing it. 
    4 long auto_build_number = 826
     4long auto_build_number = 839
  • trunk/utils/insitu.d

    r280 r287  
    112112         
    113113    if(outputFilename == ""){ 
    114         outputFilename = inputFile.getPath.toUtf8;         
     114        outputFilename = inputFile.getPath.toString;       
    115115    }    
    116116     
  • trunk/utils/insitu_bn.d

    r286 r287  
    22// This file is automatically maintained by the BUILD utility, 
    33// Please refrain from manually editing it. 
    4 long auto_build_number = 743
     4long auto_build_number = 756