mirror of https://gitee.com/bigwinds/arangodb
fixed comments
This commit is contained in:
parent
3c21a87366
commit
cfadf6ca06
|
@ -67,7 +67,7 @@
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- private methods
|
||||
// --SECTION-- private functions
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -124,7 +124,7 @@
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- public methods
|
||||
// --SECTION-- public functions
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- public methods
|
||||
// --SECTION-- public functions
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- MODULE EXPORTS
|
||||
// --SECTION-- public functions
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -41,18 +41,38 @@
|
|||
/// @{
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief exports
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
(function () {
|
||||
var internal = require("internal");
|
||||
var fs = require("fs");
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief tests if a file exists
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
fs.exists = internal.exists;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief tests if path points to a directory
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
fs.isDirectory = internal.isDirectory;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief lists all files and directory under a given path
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
fs.listTree = internal.listTree;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief moves a file or directory
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
fs.move = internal.move;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief removes a file
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
fs.remove = internal.remove;
|
||||
}());
|
||||
|
||||
|
|
|
@ -44,13 +44,13 @@
|
|||
/// @{
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief internal module
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
(function () {
|
||||
var internal = require("internal");
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief hide global variables
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// system functions
|
||||
if (typeof SYS_EXECUTE !== "undefined") {
|
||||
internal.execute = SYS_EXECUTE;
|
||||
|
|
|
@ -47,6 +47,123 @@ module = null;
|
|||
/// @}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- global functions
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @addtogroup ArangoShell
|
||||
/// @{
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief global require function
|
||||
///
|
||||
/// @FUN{require(@FA{path})}
|
||||
///
|
||||
/// @FN{require} checks if the file specified by @FA{path} has already been
|
||||
/// loaded. If not, the content of the file is executed in a new
|
||||
/// context. Within the context you can use the global variable @LIT{exports}
|
||||
/// in order to export variables and functions. This variable is returned by
|
||||
/// @FN{require}.
|
||||
///
|
||||
/// Assume that your module file is @LIT{test1.js} and contains
|
||||
///
|
||||
/// @verbinclude modules-require-1
|
||||
///
|
||||
/// Then you can use @FN{require} to load the file and access the exports.
|
||||
///
|
||||
/// @verbinclude modules-require-2
|
||||
///
|
||||
/// @FN{require} follows the specification
|
||||
/// <a href="http://wiki.commonjs.org/wiki/Modules/1.1.1">Modules/1.1.1</a>.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
function require (path) {
|
||||
return module.require(path);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief global print function
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
function print () {
|
||||
var internal = require("internal");
|
||||
internal.print.apply(internal.print, arguments);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief global printf function
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
function printf () {
|
||||
var internal = require("internal");
|
||||
internal.printf.apply(internal.printf, arguments);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief turn off pretty printing
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
function print_plain () {
|
||||
var internal = require("internal");
|
||||
|
||||
var p = internal.PRETTY_PRINT;
|
||||
internal.PRETTY_PRINT = false;
|
||||
|
||||
var c = internal.COLOR_OUTPUT;
|
||||
internal.COLOR_OUTPUT = false;
|
||||
|
||||
try {
|
||||
internal.print.apply(internal.print, arguments);
|
||||
|
||||
internal.PRETTY_PRINT = p;
|
||||
internal.COLOR_OUTPUT = c;
|
||||
}
|
||||
catch (e) {
|
||||
internal.PRETTY_PRINT = p;
|
||||
internal.COLOR_OUTPUT = c;
|
||||
|
||||
throw e.message;
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief start pretty printing
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
function start_pretty_print () {
|
||||
require("internal").startPrettyPrint();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief stop pretty printing
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
function stop_pretty_print () {
|
||||
require("internal").stopPrettyPrint();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief start pretty printing with optional color
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
function start_color_print (color) {
|
||||
require("internal").startColorPrint();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief stop pretty printing
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
function stop_color_print () {
|
||||
require("internal").stopColorPrint();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- constructors and destructors
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -300,123 +417,6 @@ module = null;
|
|||
|
||||
}());
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- global functions
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @addtogroup ArangoShell
|
||||
/// @{
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief global require function
|
||||
///
|
||||
/// @FUN{require(@FA{path})}
|
||||
///
|
||||
/// @FN{require} checks if the file specified by @FA{path} has already been
|
||||
/// loaded. If not, the content of the file is executed in a new
|
||||
/// context. Within the context you can use the global variable @LIT{exports}
|
||||
/// in order to export variables and functions. This variable is returned by
|
||||
/// @FN{require}.
|
||||
///
|
||||
/// Assume that your module file is @LIT{test1.js} and contains
|
||||
///
|
||||
/// @verbinclude modules-require-1
|
||||
///
|
||||
/// Then you can use @FN{require} to load the file and access the exports.
|
||||
///
|
||||
/// @verbinclude modules-require-2
|
||||
///
|
||||
/// @FN{require} follows the specification
|
||||
/// <a href="http://wiki.commonjs.org/wiki/Modules/1.1.1">Modules/1.1.1</a>.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
function require (path) {
|
||||
return module.require(path);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief global print function
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
function print () {
|
||||
var internal = require("internal");
|
||||
internal.print.apply(internal.print, arguments);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief global printf function
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
function printf () {
|
||||
var internal = require("internal");
|
||||
internal.printf.apply(internal.printf, arguments);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief turn off pretty printing
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
function print_plain () {
|
||||
var internal = require("internal");
|
||||
|
||||
var p = internal.PRETTY_PRINT;
|
||||
internal.PRETTY_PRINT = false;
|
||||
|
||||
var c = internal.COLOR_OUTPUT;
|
||||
internal.COLOR_OUTPUT = false;
|
||||
|
||||
try {
|
||||
internal.print.apply(internal.print, arguments);
|
||||
|
||||
internal.PRETTY_PRINT = p;
|
||||
internal.COLOR_OUTPUT = c;
|
||||
}
|
||||
catch (e) {
|
||||
internal.PRETTY_PRINT = p;
|
||||
internal.COLOR_OUTPUT = c;
|
||||
|
||||
throw e.message;
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief start pretty printing
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
function start_pretty_print () {
|
||||
require("internal").startPrettyPrint();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief stop pretty printing
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
function stop_pretty_print () {
|
||||
require("internal").stopPrettyPrint();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief start pretty printing with optional color
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
function start_color_print (color) {
|
||||
require("internal").startColorPrint();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief stop pretty printing
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
function stop_color_print () {
|
||||
require("internal").stopColorPrint();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- END-OF-FILE
|
||||
// -----------------------------------------------------------------------------
|
||||
|
|
|
@ -32,6 +32,10 @@
|
|||
// --SECTION-- monkey-patches
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- public functions
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @addtogroup ArangoShell
|
||||
/// @{
|
||||
|
|
|
@ -39,14 +39,14 @@
|
|||
/// @{
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief exports
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
(function () {
|
||||
var internal = require("internal");
|
||||
var console = require("console");
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief hide global variables
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
internal.db = db;
|
||||
delete db;
|
||||
|
||||
|
@ -65,9 +65,30 @@
|
|||
internal.ShapedJson = ShapedJson;
|
||||
delete ShapedJson;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- private variables
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @addtogroup ArangoShell
|
||||
/// @{
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief database path
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
internal.DATABASEPATH = DATABASEPATH;
|
||||
delete DATABASEPATH;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief internal thread number
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
internal.THREAD_NUMBER = THREAD_NUMBER;
|
||||
delete THREAD_NUMBER;
|
||||
|
||||
|
@ -76,7 +97,7 @@
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- private methods
|
||||
// --SECTION-- private functions
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Reference in New Issue