Changeset 770
- Timestamp:
- 02/21/10 16:56:39 (2 years ago)
- Files:
-
- branches/gtkD2/wrap/utils/ConvParms.d (moved) (moved from branches/gtkD2/wrap/utils/convparms.d) (5 diffs)
- branches/gtkD2/wrap/utils/GtkWrapper.d (modified) (5 diffs)
- branches/gtkD2/wrap/utils/HtmlStrip.d (modified) (2 diffs)
- branches/gtkD2/wrap/utils/Package.d (modified) (4 diffs)
- branches/gtkD2/wrap/utils/Utils.d (added)
- branches/gtkD2/wrap/utils/WrapError.d (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/gtkD2/wrap/utils/ConvParms.d
r769 r770 17 17 */ 18 18 19 module utils. convparms;19 module utils.ConvParms; 20 20 21 21 //debug = omitCode; … … 23 23 //debug = overrides; 24 24 25 private import std.stdio; 26 25 27 public struct ConvParms 26 28 { 27 28 private import utils.GtkDClass;29 private import std.stdio;30 31 29 public string inFile; 32 30 public string outPack; … … 42 40 public string[] prefixes; 43 41 public bool strictPrefix; /// include only function that match the prefix 44 public string[] imp rts;42 public string[] imports; 45 43 public string[string] structWrap; 46 44 public string[] noStructs; … … 71 69 impl = null; 72 70 strictPrefix = false; 73 imp rts = null;71 imports = null; 74 72 structWrap = null; 75 73 noPrefixes = null; … … 141 139 142 140 text ~= "\n * imports:"; 143 foreach ( string imp ; imp rts )141 foreach ( string imp ; imports ) 144 142 { 145 143 text ~= "\n * \t- "~imp; branches/gtkD2/wrap/utils/GtkWrapper.d
r769 r770 22 22 import std.file; 23 23 import std.path; 24 25 import utils.convparms; 24 import std.stdio; 25 import std.string; 26 27 import utils.ConvParms; 26 28 import utils.DefReader; 29 import utils.Package; 30 import utils.Utils; 27 31 import utils.WrapError; 28 import utils.Package;29 32 30 33 void main() 31 34 { 32 //create an in memory repesentation of the classes33 //resolve wraped types/imports35 GtkWrapper wrapper = new GtkWrapper("./"); 36 wrapper.proccess("APILookup.txt"); 34 37 35 38 //use the in memory representation to generate the d code. … … 63 66 switch ( defReader.key ) 64 67 { 65 case "licen ce":68 case "license": 66 69 licence = defReader.readBlock(); 67 70 break; … … 94 97 { 95 98 try 96 mk dir(outDir);99 mkpath(outDir); 97 100 catch (FileException) 98 101 throw new WrapError(defReader, "Failed to create directory: "~ outDir); … … 132 135 { 133 136 try 137 { 134 138 pack = new Package(defReader.value, srcDir, bindDir, outputRoot); 135 catch (Exceptoin e) 139 defReader.popFront(); 140 } 141 catch (Exception e) 136 142 throw new WrapError(defReader, e.msg); 137 143 } … … 186 192 convParms.interf = defReader.value; 187 193 break; 194 case "extend": 195 writefln("%s(%s): extend is depreciated use extends", 196 defReader.filename, defReader.lineNumber); 188 197 case "extends": 189 198 convParms.extend = defReader.value; branches/gtkD2/wrap/utils/HtmlStrip.d
r757 r770 25 25 import std.range; 26 26 import std.string : indexOf, munch, tolower; 27 28 import utils.Utils; 27 29 28 30 struct HtmlStrip … … 115 117 } 116 118 117 string consumeUntil(ref string str, char sentinel, OpenRight openRight = OpenRight.no)118 {119 int i = str.indexOf(sentinel);120 121 if ( openRight == OpenRight.no )122 i++;123 124 string result = str[0..i];125 str = str[i..$];126 127 return result;128 }129 130 119 version (standAlone) 131 120 { branches/gtkD2/wrap/utils/Package.d
r769 r770 20 20 21 21 import std.file; 22 import std.path; 23 24 import utils.Utils; 22 25 23 26 class Package … … 56 59 this.srcDir = srcDir; 57 60 this.bindDir = bindDir; 58 this.outputRoo r= outputRoot;61 this.outputRoot = outputRoot; 59 62 60 63 try 61 64 { 62 65 if ( !exists(join(outputRoot, srcDir, bindDir)) ) 63 mk dir(join(outputRoot, srcDir, bindDir));66 mkpath(join(outputRoot, srcDir, bindDir)); 64 67 } 65 68 catch (Exception) … … 71 74 { 72 75 if ( !exists(join(outputRoot, srcDir, pack)) ) 73 mk dir(join(outputRoot, srcDir, pack));76 mkpath(join(outputRoot, srcDir, pack)); 74 77 } 75 78 catch (Exception) … … 78 81 } 79 82 80 packages[value] ~= this;83 packages[value] = this; 81 84 } 82 85 } branches/gtkD2/wrap/utils/WrapError.d
r769 r770 30 30 this(DefReader defReader, string msg) 31 31 { 32 super(msg); 33 32 34 this.file = defReader.filename; 33 35 this.line = defReader.lineNumber; 34 this.msg = msg;35 36 } 36 37
