throw new Error("Description for built in functions. Must not be included!"); /** * @fileOverview * Documentation of the extension of the String class * built into dimctrl. */ /** * Format a string (similar to printf in C). * * This function replaces modifiers (very similar to printf) with * a formated version of the argument. Since JavaScript does implicit * format conversion already, this is actually a very powerful tool, * because the type of th arguments to be formated is of no importance. * Implicit conversion means that also arrays and objects can be given * as arguments. A shortcut is available as $-extension of the native * String class.
* * Note that this function is completely written in JavaScript. It * can be found in InterpreterV8.cc.
*
* The following modifiers are available (optional parts are put in
* brackets:
*
*
* *
* *
* *
* *
* *
* *
* * The output string will have at least a length of N. If 0 is given, * it is filled with 0's instead of white spaces. If prefixed by a minus * the contents will be left aligned. * * @param {String} format * The format string defining how the given argument elements are * formated * * @param {Array} elements * An array with the elements to be formated * * @returns {String} * The formated string is returned. * * @see * String.$ * * @example * var result; * result = String.form("%5d %3d", [ 5, "2" ]); * result = String.form("%5x", [ 12 ]); * result = String.form("%#16d", [ "b" ]); * result = String.form("%s", [ [ 1, 2, 3, ] ]); * result = String.form("%s", [ { a:1, b:2, c:3, } ]); * var abbrev = "%03d".$(42); * */ String.form = function() { /* [native code] */ } /** * An abbreviation for String.form. * * Converts all arguments provided by the user into an array * which is passed to String.form. The contents of the String itself * is passed as format string. This allows a very compact syntax to * format any kind of object, array or number. * For details see String.form. * * @param arg An argument to be formated. * @param [. . .] An undefined number of additional optional arguments. * * @returns {String} see String.form * @throws see String.form * @see String.form * * @example * var result = "%5d = %12s".$(5, "five"); * * @author Thomas Bretz */ String.prototype.$ = function() { /* [native code] */ };