ear/extract; extras; samples: Fixes
[sdk] / ear / extract / extract.ec
index 9bf65af..b28575c 100644 (file)
@@ -8,7 +8,7 @@ static char archivePath[MAX_LOCATION], archive[MAX_LOCATION];
 
 #define BUFFERSIZE 0x10000
 
-void ExtractFileFromArchive(ProgressBar progressBar, char * path, char * outputFile)
+void ExtractFileFromArchive(ProgressBar progressBar, const char * path, const char * outputFile)
 {
    char fileName[MAX_LOCATION];
    FileAttribs exists = FileExists(path);
@@ -81,7 +81,7 @@ void ExtractFileFromArchive(ProgressBar progressBar, char * path, char * outputF
             FileGetSize(path, &dataSize);
             GetLastDirectory(outputFile, fileName);
             progressBar.statusBar.SetText($"Extracting %s...", fileName);
-            
+
             app.UpdateDisplay();
 
             for(c = 0; c<dataSize; c += BUFFERSIZE)
@@ -134,7 +134,7 @@ class SelfExtract : Window
          whereLabel.Update(null); // Is this still needed?
          return true;
       }
-   }
+   };
    EditBox where { this, text = $"Extract to", anchor = Anchor { left = 10, top = 40, right = 100 }, size = Size { h = 22 }, hotKey = altT, disabled = true };
    Label whereLabel { this, position = Point { 10,20 }, labeledWindow = where };
    Button browse
@@ -148,7 +148,7 @@ class SelfExtract : Window
             where.contents = fileDialog.filePath;
          return true;
       }
-   }
+   };
    Button close { this, text = $"Exit", anchor = Anchor { right = 10, top = 70 }, size = Size { 80 }, hotKey = altX, NotifyClicked = ButtonCloseDialog };
    Button extract
    {
@@ -210,10 +210,11 @@ class SelfExtract : Window
       return true;
    }
 
-   void ViewArchive(char * path)
+   void ViewArchive(const char * path)
    {
       FileListing listing { path };
-      char string[MAX_LOCATION], * directory;
+      char string[MAX_LOCATION];
+      const char * directory;
       DataRow row;
 
       SplitArchivePath(path, string, &directory);
@@ -239,7 +240,7 @@ class SelfExtract : Window
             row.SetData(cField, c);//(void *)stats.created.local);
          }
       }
-      
+
       while(listing.Find())
       {
          if(strcmp(listing.path, "<:>ecere"))
@@ -305,7 +306,7 @@ class SelfExtractApp : GuiApplication
 
       SetLoggingMode(stdOut, null);
       SelfExtract { text = title };
-      
+
       GuiApplication::Main();
    }
 }