JSDOC/Identifier.js
[app.jsdoc] / File.js
diff --git a/File.js b/File.js
index ab300bd..f7ae90c 100755 (executable)
--- a/File.js
+++ b/File.js
@@ -21,7 +21,8 @@ String  = imports.String.String;
 var File = {
     
     /**
-     * @scope File
+     * @static
+     * @type {String} File seperator. (should be dynamic....)
      */
      
     
@@ -67,6 +68,29 @@ var File = {
         
         return s;
     },
+    /**
+     * Get the base name of a path.
+     * @param {String} path
+     * @returns {String} basename
+    */
+    basename : function(path)
+    {
+        return path.split(File.SEPARATOR).pop();
+    },
+    
+    /**
+     * Get the directory name of a path. (could use Glib really)
+     * @param {String} path
+     * @returns {String} dirname
+    */
+    dirname : function(path)
+    {
+       var r = path.split(File.SEPARATOR)
+       r.pop();
+       return r.join(File.SEPARATOR);
+    },
+    
+    
     /**
      * Join a path with the Correct File seperator (unix only at present...)
      * Takes a variable number of arguments, and joins them together.
@@ -171,8 +195,8 @@ var File = {
     
     /**
      * write a string to file
-     * @arg path {String} File to write to
-     * @arg string {String} Contents of file.
+     * @param {String} pathFile to write to
+     * @param {String} string  Contents of file.
      * 
      */
     write : function (path, string) {
@@ -183,8 +207,8 @@ var File = {
     },
     /**
      * append a string to a file
-     * @arg path {String} File to write to
-     * @arg string {String} string to append to file.
+     * @param {String} path  File to write to
+     * @param {String}  string string to append to file.
      * 
      */
     append : function (path, string) {
@@ -197,7 +221,7 @@ var File = {
     },
     /**
      * Delete a file.
-     * @arg path {String} File to remove    
+     * @param  {String} path  File to remove    
      */
     remove : function (path)
     {
@@ -207,9 +231,9 @@ var File = {
     /**
      * copy files recursively from fromDir, silently ignore them if they already exist in toDir
      *        unless you select overwrite..
-     * @arg {String} src source path
-     * @arg {String} dest destination path
-     * @arg {Gio.FileCopyFlags} options (optional)  - use Gio.FileCopyFlags.OVERWRITE to 
+     * @param {String} src source path
+     * @param {String} dest destination path
+     * @param {Gio.FileCopyFlags} options (optional)  - use Gio.FileCopyFlags.OVERWRITE to 
      *      otherwise they will not be copied
      * 
      */
@@ -245,7 +269,7 @@ var File = {
     
     /**
      * make a directory..
-     * @arg {String} dstPath directory to make
+     * @param {String} dstPath directory to make
      */
     mkdir : function (destPath) {
         var dest = Gio.file_new_for_path(String(destPath));
@@ -254,9 +278,9 @@ var File = {
     },
     /**
      * copy a File
-     * @arg {String} src source path
-     * @arg {String} dest destination path
-     * @arg {Gio.FileCopyFlags} options (optional)  - use Gio.FileCopyFlags.OVERWRITE to .. overwrite..
+     * @param {String} src source path
+     * @param {String} dest destination path
+     * @param {Gio.FileCopyFlags} options (optional)  - use Gio.FileCopyFlags.OVERWRITE to .. overwrite..
      * 
      */
     copyFile : function (srcPath, destPath, opts) {