Changeset 287
- Timestamp:
- 12/06/07 19:40:08 (1 year ago)
- Files:
-
- trunk/ddl/DDLError.d (modified) (1 diff)
- trunk/ddl/FileBuffer.d (modified) (2 diffs)
- trunk/ddl/Linker.d (modified) (2 diffs)
- trunk/ddl/LoaderRegistry.d (modified) (1 diff)
- trunk/ddl/PathLibrary.d (modified) (8 diffs)
- trunk/ddl/ar/ArchiveLibrary.d (modified) (2 diffs)
- trunk/ddl/ar/ArchiveReader.d (modified) (1 diff)
- trunk/ddl/elf/ELFLibrary.d (modified) (2 diffs)
- trunk/ddl/elf/ELFObjLoader.d (modified) (1 diff)
- trunk/ddl/omf/OMFLibrary.d (modified) (2 diffs)
- trunk/ddl/omf/OMFLoader.d (modified) (1 diff)
- trunk/etc/demangle.d (modified) (1 diff)
- trunk/utils/bless.d (modified) (3 diffs)
- trunk/utils/bless_bn.d (modified) (1 diff)
- trunk/utils/ddlinfo.d (modified) (1 diff)
- trunk/utils/ddlinfo_bn.d (modified) (1 diff)
- trunk/utils/insitu.d (modified) (1 diff)
- trunk/utils/insitu_bn.d (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/ddl/DDLError.d
r279 r287 44 44 } 45 45 46 public char[] to Utf8(){46 public char[] toString(){ 47 47 return message; 48 48 } trunk/ddl/FileBuffer.d
r279 r287 41 41 static FileBuffer opCall(FilePath path){ 42 42 FileBuffer _this; 43 _this.path = new FilePath(path.to Utf8);43 _this.path = new FilePath(path.toString); 44 44 _this.data = cast(ubyte[])(new File(_this.path)).read; 45 45 return _this; … … 55 55 static FileBuffer opCall(FilePath path,ubyte[] data){ 56 56 FileBuffer _this; 57 _this.path = new FilePath(path.to Utf8);57 _this.path = new FilePath(path.toString); 58 58 _this.data = data; 59 59 return _this; trunk/ddl/Linker.d
r285 r287 68 68 */ 69 69 public this(DynamicModule reason){ 70 super("LinkModuleException: cannot resolve '" ~ reason.getName ~ "'\n" ~ reason.to Utf8());70 super("LinkModuleException: cannot resolve '" ~ reason.getName ~ "'\n" ~ reason.toString()); 71 71 this.mod = reason; 72 72 } … … 354 354 */ 355 355 public void register(DynamicLibrary lib){ 356 assert (lib !is null); 356 357 debug foreach(DynamicModule mod; lib.getModules){ 357 358 debugLog("[Linker.register]: {0}",mod.getName); trunk/ddl/LoaderRegistry.d
r279 r287 153 153 delete lib; // force collection on 'result' 154 154 lib = null; 155 throw new LibraryVersionException(buffer.getPath.to Utf8(),attrStdVersion,*libraryStdVersion);155 throw new LibraryVersionException(buffer.getPath.toString(),attrStdVersion,*libraryStdVersion); 156 156 } 157 157 } trunk/ddl/PathLibrary.d
r286 r287 74 74 debugLog("{0} ({1})\n",prompt,list.length); 75 75 foreach(path; list){ 76 debugLog(" {0}\n",path.to Utf8());76 debugLog(" {0}\n",path.toString()); 77 77 } 78 78 } … … 80 80 protected DynamicLibrary[] getRootLibraries(){ 81 81 if(!isPreLoaded){ 82 root.toList(delegate void(char[] prefix, char[] str, bool isDirectory){82 root.toList(delegate bool(FilePath path_, bool isDirectory){ 83 83 if(isDirectory) return 1; 84 auto path = p refix~str;84 auto path = path_.toString; 85 85 auto lib = loaderRegistry.load(path); 86 86 if(lib){ … … 102 102 103 103 // 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; 106 106 if(isDirectory){ 107 (new FilePath(p refix)).toList(&loadDelegate);107 (new FilePath(path_.folder)).toList(&loadDelegate); 108 108 } 109 109 else{ 110 if(path in this.pathXref) return ; // skip already loaded libs110 if(path in this.pathXref) return 1; // skip already loaded libs 111 111 auto lib = loaderRegistry.load(path); 112 112 if(lib){ … … 119 119 120 120 // 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); 125 124 return 1; 126 125 }); … … 229 228 addNamespaceTranslator(&convertNamespaceToPath); 230 229 231 attributes["PATH.path"] = root.to Utf8;230 attributes["PATH.path"] = root.toString; 232 231 } 233 232 … … 277 276 278 277 foreach (xlat; namespaceTranslators) { 279 char[] path = FilePath.join(this.root.to Utf8(), xlat(namespace.dup));278 char[] path = FilePath.join(this.root.toString(), xlat(namespace.dup)); 280 279 if(isFullyLoaded){ 281 280 //don't bother with path matching because we're already loaded … … 303 302 //find first loadable library file that matches <root-path><path>/* and contains 'name' 304 303 DynamicModule mod; 305 (new FilePath(path)).toList(delegate void(char[] prefix, char[] str, bool isDirectory){306 DynamicLibrary lib = loaderRegistry.load(p refix~str);304 (new FilePath(path)).toList(delegate bool(FilePath path_, bool isDirectory){ 305 DynamicLibrary lib = loaderRegistry.load(path_.toString); 307 306 if(lib){ 308 307 cachedLibraries ~= lib; … … 334 333 // expects resource in file-path format 335 334 public override ubyte[] getResource(char[] name){ 336 FileConduit fc = new FileConduit(this.root.to Utf8~ name);335 FileConduit fc = new FileConduit(this.root.toString ~ name); 337 336 ubyte[] data = new ubyte[fc.length]; 338 337 fc.read(data); trunk/ddl/ar/ArchiveLibrary.d
r285 r287 56 56 public this(LoaderRegistry registry, FileBuffer file, bool loadall = true){ 57 57 this.registry = registry; 58 attributes["archive.filename"] = file.getPath.to Utf8();58 attributes["archive.filename"] = file.getPath.toString(); 59 59 debug debugLog("* Loading the archive"); 60 60 load(file, loadall); … … 248 248 249 249 foreach(mod; modules){ 250 result ~= mod.to Utf8();250 result ~= mod.toString(); 251 251 } 252 252 return result; trunk/ddl/ar/ArchiveReader.d
r279 r287 87 87 get(memberData, fSize); 88 88 } catch(Exception e) { 89 throw new DDLException("Could not read member data - received message " ~ e.to Utf8() ~ " - Archive library is invalid.");89 throw new DDLException("Could not read member data - received message " ~ e.toString() ~ " - Archive library is invalid."); 90 90 } 91 91 trunk/ddl/elf/ELFLibrary.d
r279 r287 61 61 62 62 public this(FileBuffer file){ 63 attributes["elf.filename"] = file.getPath.to Utf8();63 attributes["elf.filename"] = file.getPath.toString(); 64 64 load(file); 65 65 } … … 139 139 140 140 foreach(mod; modules){ 141 result ~= mod.to Utf8();141 result ~= mod.toString(); 142 142 } 143 143 return result; trunk/ddl/elf/ELFObjLoader.d
r279 r287 83 83 // establish the correct attributes in the library 84 84 lib.setAttributes(mod.getAttributes); 85 lib.setAttribute("elf.filename",file.getPath.to Utf8());85 lib.setAttribute("elf.filename",file.getPath.toString()); 86 86 return lib; 87 87 } trunk/ddl/omf/OMFLibrary.d
r285 r287 49 49 50 50 public this(FileBuffer file){ 51 attributes["omf.filename"] = file.getPath.to Utf8();51 attributes["omf.filename"] = file.getPath.toString(); 52 52 load(file); 53 53 } … … 175 175 char[] result = ""; 176 176 foreach(DynamicModule mod; modules){ 177 result ~= mod.to Utf8();177 result ~= mod.toString(); 178 178 } 179 179 return result; trunk/ddl/omf/OMFLoader.d
r279 r287 84 84 // establish the correct attributes in the library 85 85 lib.setAttributes(mod.getAttributes); 86 lib.setAttribute("omf.filename",file.getPath.to Utf8());86 lib.setAttribute("omf.filename",file.getPath.toString()); 87 87 88 88 debug debugLog("completed loading OMF Module"); trunk/etc/demangle.d
r282 r287 367 367 p[i] = b; 368 368 } 369 result ~= Float.to Utf8(r);369 result ~= Float.toString(r); 370 370 ni += 10 * 2; 371 371 } trunk/utils/bless.d
r280 r287 204 204 //NOTE: rather than just be satisfied with what loader likes this file 205 205 // we load the entire file via its loader to ensure that it will work later. 206 DynamicLibrary lib = registry.load(file.getPath.to Utf8());206 DynamicLibrary lib = registry.load(file.getPath.toString()); 207 207 208 208 if(!lib){ 209 Stdout.format("Cannot load '{0}'",file.getPath.to Utf8()).newline;209 Stdout.format("Cannot load '{0}'",file.getPath.toString()).newline; 210 210 return 1; 211 211 } … … 213 213 // output 214 214 if(verbose){ 215 Stdout.format("filename: '{0}'",file.getPath.to Utf8()).newline;215 Stdout.format("filename: '{0}'",file.getPath.toString()).newline; 216 216 Stdout.format("type: '{0}'",lib.getType).newline; 217 217 } … … 219 219 if(extract){ 220 220 if(lib.getType != DDLLoader.typeName){ 221 Stdout.format("cannot extract from a non-ddl file ('{0}').",file.getPath.to Utf8()).newline;221 Stdout.format("cannot extract from a non-ddl file ('{0}').",file.getPath.toString()).newline; 222 222 return 1; 223 223 } 224 224 } 225 225 else if(lib.getType == DDLLoader.typeName){ 226 Stdout.format("'{0}' already appears to be a ddl file.",file.getPath.to Utf8()).newline;226 Stdout.format("'{0}' already appears to be a ddl file.",file.getPath.toString()).newline; 227 227 return 1; 228 228 } trunk/utils/bless_bn.d
r286 r287 2 2 // This file is automatically maintained by the BUILD utility, 3 3 // Please refrain from manually editing it. 4 long auto_build_number = 7 46;4 long auto_build_number = 759; trunk/utils/ddlinfo.d
r280 r287 120 120 121 121 if(!lib){ 122 Stdout.format("file '{0}' is not supported.",file.getPath.to Utf8()).newline;122 Stdout.format("file '{0}' is not supported.",file.getPath.toString()).newline; 123 123 return 1; 124 124 } 125 125 126 Stdout.format("filename: '{0}'",file.getPath.to Utf8()).newline;126 Stdout.format("filename: '{0}'",file.getPath.toString()).newline; 127 127 Stdout.format("type: '{0}'",lib.getType).newline; 128 128 129 129 if(xRay){ 130 Stdout.format("{0}",lib.to Utf8()).newline;130 Stdout.format("{0}",lib.toString()).newline; 131 131 } 132 132 else{ trunk/utils/ddlinfo_bn.d
r286 r287 2 2 // This file is automatically maintained by the BUILD utility, 3 3 // Please refrain from manually editing it. 4 long auto_build_number = 8 26;4 long auto_build_number = 839; trunk/utils/insitu.d
r280 r287 112 112 113 113 if(outputFilename == ""){ 114 outputFilename = inputFile.getPath.to Utf8;114 outputFilename = inputFile.getPath.toString; 115 115 } 116 116 trunk/utils/insitu_bn.d
r286 r287 2 2 // This file is automatically maintained by the BUILD utility, 3 3 // Please refrain from manually editing it. 4 long auto_build_number = 7 43;4 long auto_build_number = 756;
