Changeset 388

Show
Ignore:
Timestamp:
07/16/08 07:27:30 (5 months ago)
Author:
FeepingCreature
Message:
  • Added getFilename(URL) to downloader
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/tools/tools/downloader.d

    r384 r388  
    66  //\todo: complete this 
    77  return s.replace(" ", "%20"); 
     8} 
     9 
     10string getFilename(string url) { 
     11  auto pos1 = url.rfind("/"); 
     12  if (pos1 == -1) return "index.html"; 
     13  url = url[pos1+1 .. $]; 
     14  auto pos2 = url.find("?"); 
     15  if (pos2 != -1) url = url[0 .. pos2]; 
     16  if (url.length) return url; 
     17  else return "index.html"; 
    818} 
    919 
  • trunk/tools/tools/smart_import.d

    r330 r388  
    1111      char[] buf; 
    1212      while (sup.length) { 
    13         if (sup[0] == '|') { 
     13        if (sup[0] == ',') { 
    1414          res ~= buf; 
    1515          buf = ""; 
     
    1919      if (buf.length) res ~= buf; 
    2020    } else { 
    21       if (i[0] == ';' || i[0] == ']') { 
     21      if (i[0] == ',' || i[0] == ']') { 
    2222        if (buffer.length) { 
    2323          res ~= base~buffer; 
  • trunk/tools/tools/threadpool.d

    r387 r388  
    11module tools.threadpool; 
    22public import tools.base; 
    3 // mixin(expandImport!("std.thread; tools.[threads; log; functional]")); 
     3// mixin(expandImport!("std.thread, tools.[threads, log, functional]")); 
    44import std.thread, tools.threads; 
    55import tools.log, tools.functional;