JSDOC/Packer.vala
[gnome.introspection-doc-generator] / JSDOC / Packer.vala
index 2f33b19..54e4eca 100644 (file)
@@ -177,10 +177,10 @@ namespace JSDOC
                                // should we prefix? =- or should this be done elsewhere?
                                
                        var add = f.replace(".", "/") + ".js";
-                       if (_this.files.contains(add)) {
+                       if (this.files.contains(add)) {
                            continue;
                        }
-                       _this.files.add( add );
+                       this.files.add( add );
                        
                    }
                }
@@ -192,12 +192,14 @@ namespace JSDOC
                    //this.transOrigFile= bpath + '/../lang.en.js'; // needs better naming...
                    //File.write(this.transfile, "");
                    if (this.target.length > 0) {
-                       this.targetStream.write("");
+                       this.targetStream.write("".data);
                    }
                    
-                   if (this.debugTarget > 0) {
-                           this.targetDebugStream.write("");
+                   if (this.targetDebugStream != null) {
+                           this.targetDebugStream.write("".data);
                    }
+                   
+                   
                    foreach(var file in this.files) {
                        
                        print("reading %s\n",file );
@@ -214,7 +216,7 @@ namespace JSDOC
                        if (this.targetDebugStream !=null) {
                                
                                FileUtils.get_contents(file,out file_contents);
-                           this.targetDebugStream.write(file_contents);
+                           this.targetDebugStream.write(file_contents.data);
                            loaded_string = false;
                        }
                        // it's a good idea to check with 0 compression to see if the code can parse!!
@@ -224,7 +226,7 @@ namespace JSDOC
                        
                   
                        
-                       var minfile = this.tmpDir + '/' + file.replace("/", '.');
+                       var minfile = this.tmpDir + "/" + file.replace("/", ".");
                        
                        
                        // let's see if we have a min file already?
@@ -313,20 +315,21 @@ namespace JSDOC
                    */
                    print("MERGING SOURCE");
                    
-                   for(var i=0; i < this.files.length; i++)  {
+                   for(var i=0; i < this.files.size; i++)  {
                        var file = this.files[i];
-                       var minfile = this.tmpDir + '/' + file.replace('/', '.');
+                       var minfile = this.tmpDir + "/" + file.replace("/", ".");
                        
                        
-                       if (!File.exists(minfile)) {
+                       if ( FileUtils.test(minfile, FileTest.EXISTS)) {
                            continue;
                        }
-                       var str = File.read(minfile);
-                       print("using MIN FILE  "+ minfile);
-                       if (str.length) {
+                       string str;
+                       FileUtils.get_contents(minfile, out str);
+                       print("using MIN FILE  %s\n", minfile);
+                       if (str.length > 0) {
                            if (this.targetStream != null) {
-                                       this.targetStream.write("//" + file + "\n"); 
-                                       this.targetStream.write(str + "\n"); 
+                                       this.targetStream.write(("//" + file + "\n").data); 
+                                       this.targetStream.write((str + "\n").data); 
 
                            } else {
                                this.out += "//" + file + "\n";
@@ -340,7 +343,9 @@ namespace JSDOC
                        
                    }
                    print("Output file: " + this.target);
-                   if (this.debugTarget) print("Output debug file: " + this.debugTarget);
+                   if (this.targetDebug.length > 0) {
+                                print("Output debug file: " + this.targetDebug);
+                        }
                    
                     
                
@@ -365,9 +370,7 @@ namespace JSDOC
                        tr.sepIdents = true;
                        tr.collapseWhite = false;
                        tr.filename = fn;
-
-                       this.timerPrint("START" + fn);
-               
                        // we can load translation map here...
                
                        var toks = tr.tokenize(new TextStream(str)); // dont merge xxx + . + yyyy etc.