| 1 | throw new Error("Description for built in functions. Must not be included!");
|
|---|
| 2 | /***************************************************************************/
|
|---|
| 3 | /*** ***/
|
|---|
| 4 | /*** JsDoc: http://code.google.com/p/jsdoc-toolkit/w/list ***/
|
|---|
| 5 | /*** ***/
|
|---|
| 6 | /*** jsdoc -d=html/dimctrl scripts/doc/ ***/
|
|---|
| 7 | /*** ***/
|
|---|
| 8 | /***************************************************************************/
|
|---|
| 9 | /**
|
|---|
| 10 | * @fileOverview
|
|---|
| 11 | * Documentation of the native functions built into dimctrl's
|
|---|
| 12 | * global namespace.
|
|---|
| 13 | */
|
|---|
| 14 |
|
|---|
| 15 | /**
|
|---|
| 16 | * An associative array containing the user supplied arguments identical to arg.
|
|---|
| 17 | * Positional arguments (arguments without value) are stored as 'n'="value"
|
|---|
| 18 | * and can be accessed via $[n] with n being an integer.
|
|---|
| 19 | *
|
|---|
| 20 | * @static
|
|---|
| 21 | * @type Array
|
|---|
| 22 | *
|
|---|
| 23 | * @example
|
|---|
| 24 | * var value = $['name'];
|
|---|
| 25 | */
|
|---|
| 26 | _global_.$ = [];
|
|---|
| 27 |
|
|---|
| 28 | /**
|
|---|
| 29 | * An associative array containing the user supplied arguments identical to $.
|
|---|
| 30 | * Positional arguments (arguments without value) are listed as 'n'="value"
|
|---|
| 31 | * and can be accessed via arg[n] with n being an iteger.
|
|---|
| 32 | *
|
|---|
| 33 | * @static
|
|---|
| 34 | * @type Array
|
|---|
| 35 | *
|
|---|
| 36 | * @example
|
|---|
| 37 | * // List all arguments
|
|---|
| 38 | * for (var key in arg)
|
|---|
| 39 | * console.out("arg["+key+"]="+arg[key]);
|
|---|
| 40 | *
|
|---|
| 41 | * // List only positional arguments
|
|---|
| 42 | * for (var i=0; i<arg.length; i++)
|
|---|
| 43 | * console.out("arg["+i+"]="+arg[i]);
|
|---|
| 44 | */
|
|---|
| 45 | _global_.arg = [];
|
|---|
| 46 |
|
|---|
| 47 | /**
|
|---|
| 48 | * A magic variable which is always set to the filename of the
|
|---|
| 49 | * JavaScript file currently executed, if any.
|
|---|
| 50 | *
|
|---|
| 51 | * @static
|
|---|
| 52 | * @type String
|
|---|
| 53 | *
|
|---|
| 54 | * @example
|
|---|
| 55 | * console.out(__FILE__);
|
|---|
| 56 | */
|
|---|
| 57 | _global_.__FILE__ = filename;
|
|---|
| 58 |
|
|---|
| 59 | /**
|
|---|
| 60 | * A magic variable which is always set to the modification time of the
|
|---|
| 61 | * JavaScript file currently executed, if any.
|
|---|
| 62 | *
|
|---|
| 63 | * @static
|
|---|
| 64 | * @type Date
|
|---|
| 65 | *
|
|---|
| 66 | * @example
|
|---|
| 67 | * console.out(__DATE__);
|
|---|
| 68 | */
|
|---|
| 69 | _global_.__DATE__ = filedate;
|
|---|
| 70 |
|
|---|
| 71 | /**
|
|---|
| 72 | * A magic variable which is always set to the start time when the
|
|---|
| 73 | * current JavaScript session was started.
|
|---|
| 74 | *
|
|---|
| 75 | * @static
|
|---|
| 76 | * @constant
|
|---|
| 77 | * @type Date
|
|---|
| 78 | *
|
|---|
| 79 | * @example
|
|---|
| 80 | * console.out(__START__);
|
|---|
| 81 | */
|
|---|
| 82 | _global_.__START__ = starttime;
|
|---|
| 83 |
|
|---|
| 84 |
|
|---|
| 85 | /**
|
|---|
| 86 | * Includes another java script.
|
|---|
| 87 | *
|
|---|
| 88 | * Note that it is literally included,
|
|---|
| 89 | * i.e. its code is executed as if it were at included at this
|
|---|
| 90 | * place of the current file.
|
|---|
| 91 | *
|
|---|
| 92 | * @param {String} [name="test"]
|
|---|
| 93 | * Name of the file to be included. The base directory is
|
|---|
| 94 | * the directory in which dimctrl was started.
|
|---|
| 95 | *
|
|---|
| 96 | * @param {String} [. . . ]
|
|---|
| 97 | * More files to be included
|
|---|
| 98 | *
|
|---|
| 99 | * @type Array
|
|---|
| 100 | *
|
|---|
| 101 | * @static
|
|---|
| 102 | *
|
|---|
| 103 | */
|
|---|
| 104 | _global_.include = function() { /* [native code] */ }
|
|---|
| 105 |
|
|---|
| 106 | /**
|
|---|
| 107 | * Forecefully exit the current script. This function can be called
|
|---|
| 108 | * from anywhere and will terminate the current script.
|
|---|
| 109 | *
|
|---|
| 110 | * The effect is the same than throwing a null expecption ("throw null;")
|
|---|
| 111 | * in the main thread. In every other thread or callback, the whole script
|
|---|
| 112 | * will terminate which is different from the behaviour of a null exception
|
|---|
| 113 | * which only terminates the corresponding thread.
|
|---|
| 114 | *
|
|---|
| 115 | * @static
|
|---|
| 116 | *
|
|---|
| 117 | */
|
|---|
| 118 | _global_.exit = function() { /* [native code] */ }
|
|---|
| 119 |
|
|---|
| 120 | /**
|
|---|
| 121 | * Reads a file as a whole.
|
|---|
| 122 | *
|
|---|
| 123 | * Files can be split into an array when reading the file. It is
|
|---|
| 124 | * important to note that no size check is done. So trying to read
|
|---|
| 125 | * a file larger than the available memory will most probably crash
|
|---|
| 126 | * the program. Strictly speaking only reading ascii fils make sense.
|
|---|
| 127 | * Also gzip'ed files are supported.
|
|---|
| 128 | *
|
|---|
| 129 | * Note that this is only meant for debugging purpose and should
|
|---|
| 130 | * not be usd in a production environment. Scripts should not
|
|---|
| 131 | * access any files by defaults. If external values have to be
|
|---|
| 132 | * provided arguments should be given to the script.
|
|---|
| 133 | *
|
|---|
| 134 | * @static
|
|---|
| 135 | *
|
|---|
| 136 | * @param {String} name
|
|---|
| 137 | * Name of the file to read. The base directory is the current
|
|---|
| 138 | * working directory
|
|---|
| 139 | *
|
|---|
| 140 | * @param {String} [delim=undefined]
|
|---|
| 141 | * A delimiter used to split the file into an array. If provided
|
|---|
| 142 | * it must be a String of length 1.
|
|---|
| 143 | *
|
|---|
| 144 | * @returns {String,Array[String]}
|
|---|
| 145 | * If no delimiter is given, a StringObject with the file (read
|
|---|
| 146 | * until \0) is returned. If a delimiter is given, an array
|
|---|
| 147 | * of Strings is returned, one for each chunk. Both objects
|
|---|
| 148 | * contain the property 'name' with the file name and the array
|
|---|
| 149 | * contains the property 'delim' with the used delimiter.
|
|---|
| 150 | *
|
|---|
| 151 | * @throws
|
|---|
| 152 | * <li> If number or type of arguments is wrong
|
|---|
| 153 | * <li> If there was an error reading the file, the system error is thrown
|
|---|
| 154 | *
|
|---|
| 155 | * @example
|
|---|
| 156 | * var string = File("fact++.rc");
|
|---|
| 157 | * var array = File("fact++.rc", "\n");
|
|---|
| 158 | */
|
|---|
| 159 | _global_.File = function() { /* [native code] */ }
|
|---|