]> cygwin.com Git - cygwin-apps/setup.git/blobdiff - script.h
2003-06-23 Max Bowsher <maxb@ukf.net>
[cygwin-apps/setup.git] / script.h
index 46f64fc73fef531fd4b597eeb3b9f25b6a54dc22..e121b6e8e46fb985de0c42b030cc80b806ac66a0 100644 (file)
--- a/script.h
+++ b/script.h
  * Written by Jan Nieuwenhuizen <janneke@gnu.org>
  *
  */
-#ifndef SCRIPT_H
-#define SCRIPT_H
+#ifndef SETUP_SCRIPT_H
+#define SETUP_SCRIPT_H
 
-/* Run the script fname, found in dir.  If fname has suffix .sh, and
-   we have a Bourne shell, execute it using sh.  Otherwise, if fname
-   has suffix .bat, execute using cmd */
+#include "String++.h"
    
-void run_script (char const *dir, char const *fname);
-
 /* Initialisation stuff for run_script: sh, cmd, CYGWINROOT and PATH */
 void init_run_script ();
 
 /* Run the scripts fname.sh and fname.bat, found in dir. */
-void try_run_script (char const *dir, char const *fname);
+void try_run_script (String const &dir, String const &fname);
+
+class Script {
+public:
+  static bool isAScript (String const &file);
+  Script (String const &fileName);
+  String baseName() const;
+  String fullName() const;
+/* Run the script.  If it it's suffix is .sh, and
+   we have a Bourne shell, execute it using sh.  Otherwise, if the 
+   suffix is .bat, execute using cmd */
+  void run() const;
+private:
+  String scriptName;
+  static char const ETCPostinstall[];
+  char const * extension() const;
+};
 
-#endif /* SCRIPT_H */
+#endif /* SETUP_SCRIPT_H */
This page took 0.023344 seconds and 5 git commands to generate.