mirror of https://gitee.com/bigwinds/arangodb
292 lines
12 KiB
C
292 lines
12 KiB
C
static string JS_json =
|
|
"////////////////////////////////////////////////////////////////////////////////\n"
|
|
"/// @brief JavaScript JSON utility functions\n"
|
|
"///\n"
|
|
"/// @file\n"
|
|
"///\n"
|
|
"/// DISCLAIMER\n"
|
|
"///\n"
|
|
"/// Copyright by triAGENS GmbH - All rights reserved.\n"
|
|
"///\n"
|
|
"/// The Programs (which include both the software and documentation)\n"
|
|
"/// contain proprietary information of triAGENS GmbH; they are\n"
|
|
"/// provided under a license agreement containing restrictions on use and\n"
|
|
"/// disclosure and are also protected by copyright, patent and other\n"
|
|
"/// intellectual and industrial property laws. Reverse engineering,\n"
|
|
"/// disassembly or decompilation of the Programs, except to the extent\n"
|
|
"/// required to obtain interoperability with other independently created\n"
|
|
"/// software or as specified by law, is prohibited.\n"
|
|
"///\n"
|
|
"/// The Programs are not intended for use in any nuclear, aviation, mass\n"
|
|
"/// transit, medical, or other inherently dangerous applications. It shall\n"
|
|
"/// be the licensee's responsibility to take all appropriate fail-safe,\n"
|
|
"/// backup, redundancy, and other measures to ensure the safe use of such\n"
|
|
"/// applications if the Programs are used for such purposes, and triAGENS\n"
|
|
"/// GmbH disclaims liability for any damages caused by such use of\n"
|
|
"/// the Programs.\n"
|
|
"///\n"
|
|
"/// This software is the confidential and proprietary information of\n"
|
|
"/// triAGENS GmbH. You shall not disclose such confidential and\n"
|
|
"/// proprietary information and shall use it only in accordance with the\n"
|
|
"/// terms of the license agreement you entered into with triAGENS GmbH.\n"
|
|
"///\n"
|
|
"/// Copyright holder is triAGENS GmbH, Cologne, Germany\n"
|
|
"///\n"
|
|
"/// @author Dr. Frank Celler\n"
|
|
"/// @author Copyright 2011, triAGENS GmbH, Cologne, Germany\n"
|
|
"////////////////////////////////////////////////////////////////////////////////\n"
|
|
"\n"
|
|
"// -----------------------------------------------------------------------------\n"
|
|
"// --SECTION-- AvocadoCollection\n"
|
|
"// -----------------------------------------------------------------------------\n"
|
|
"\n"
|
|
"////////////////////////////////////////////////////////////////////////////////\n"
|
|
"/// @addtogroup V8Json\n"
|
|
"/// @{\n"
|
|
"////////////////////////////////////////////////////////////////////////////////\n"
|
|
"\n"
|
|
"////////////////////////////////////////////////////////////////////////////////\n"
|
|
"/// @brief string representation of a collection\n"
|
|
"////////////////////////////////////////////////////////////////////////////////\n"
|
|
"\n"
|
|
"AvocadoCollection.prototype.toString = function() {\n"
|
|
" var status;\n"
|
|
"\n"
|
|
" if (this instanceof AvocadoCollection) {\n"
|
|
" status = this.status();\n"
|
|
"\n"
|
|
" if (status == 1) {\n"
|
|
" return \"[new born collection at \" + JSON.stringify(this._name) + \"]\";\n"
|
|
" }\n"
|
|
" else if (status == 2) {\n"
|
|
" return \"[unloaded collection at \" + JSON.stringify(this._name) + \"]\";\n"
|
|
" }\n"
|
|
" else if (status == 3) {\n"
|
|
" return \"[collection at \" + JSON.stringify(this._name) + \"]\";\n"
|
|
" }\n"
|
|
" else {\n"
|
|
" return \"[corrupted collection at \" + JSON.stringify(this._name) + \"]\";\n"
|
|
" }\n"
|
|
" }\n"
|
|
" else {\n"
|
|
" return \"[object]\";\n"
|
|
" }\n"
|
|
"}\n"
|
|
"\n"
|
|
"////////////////////////////////////////////////////////////////////////////////\n"
|
|
"/// @brief JSON representation of a collection\n"
|
|
"////////////////////////////////////////////////////////////////////////////////\n"
|
|
"\n"
|
|
"AvocadoCollection.prototype.toJSON = function() {\n"
|
|
" if (this instanceof AvocadoCollection) {\n"
|
|
" status = this.status();\n"
|
|
"\n"
|
|
" if (status == 1) {\n"
|
|
" return \"[new born collection \" + JSON.stringify(this._name) + \"]\";\n"
|
|
" }\n"
|
|
" else if (status == 2) {\n"
|
|
" return \"[unloaded collection \" + JSON.stringify(this._name) + \"]\";\n"
|
|
" }\n"
|
|
" else if (status == 3) {\n"
|
|
" return \"[collection \" + JSON.stringify(this._name) + \"]\";\n"
|
|
" }\n"
|
|
" else {\n"
|
|
" return \"[corrupted collection \" + JSON.stringify(this._name) + \"]\";\n"
|
|
" }\n"
|
|
" }\n"
|
|
" else {\n"
|
|
" return \"[object]\";\n"
|
|
" }\n"
|
|
"}\n"
|
|
"\n"
|
|
"////////////////////////////////////////////////////////////////////////////////\n"
|
|
"/// @}\n"
|
|
"////////////////////////////////////////////////////////////////////////////////\n"
|
|
"\n"
|
|
"// -----------------------------------------------------------------------------\n"
|
|
"// --SECTION-- AvocadoDatabase\n"
|
|
"// -----------------------------------------------------------------------------\n"
|
|
"\n"
|
|
"////////////////////////////////////////////////////////////////////////////////\n"
|
|
"/// @addtogroup V8Json\n"
|
|
"/// @{\n"
|
|
"////////////////////////////////////////////////////////////////////////////////\n"
|
|
"\n"
|
|
"////////////////////////////////////////////////////////////////////////////////\n"
|
|
"/// @brief string representation of a vocbase\n"
|
|
"////////////////////////////////////////////////////////////////////////////////\n"
|
|
"\n"
|
|
"AvocadoDatabase.prototype.toString = function() {\n"
|
|
" if (this instanceof AvocadoDatabase) {\n"
|
|
" return \"[vocbase at \" + JSON.stringify(this._path) + \"]\";\n"
|
|
" }\n"
|
|
" else {\n"
|
|
" return \"[object]\";\n"
|
|
" }\n"
|
|
"}\n"
|
|
"\n"
|
|
"////////////////////////////////////////////////////////////////////////////////\n"
|
|
"/// @brief JSON representation of a vocbase\n"
|
|
"////////////////////////////////////////////////////////////////////////////////\n"
|
|
"\n"
|
|
"AvocadoDatabase.prototype.toJSON = function() {\n"
|
|
" if (this instanceof AvocadoDatabase) {\n"
|
|
" return \"[vocbase at \" + JSON.stringify(this._path) + \"]\";\n"
|
|
" }\n"
|
|
" else {\n"
|
|
" return \"[object]\";\n"
|
|
" }\n"
|
|
"}\n"
|
|
"\n"
|
|
"////////////////////////////////////////////////////////////////////////////////\n"
|
|
"/// @}\n"
|
|
"////////////////////////////////////////////////////////////////////////////////\n"
|
|
"\n"
|
|
"// -----------------------------------------------------------------------------\n"
|
|
"// --SECTION-- AvocadoEdges\n"
|
|
"// -----------------------------------------------------------------------------\n"
|
|
"\n"
|
|
"////////////////////////////////////////////////////////////////////////////////\n"
|
|
"/// @addtogroup V8Json\n"
|
|
"/// @{\n"
|
|
"////////////////////////////////////////////////////////////////////////////////\n"
|
|
"\n"
|
|
"////////////////////////////////////////////////////////////////////////////////\n"
|
|
"/// @brief string representation of a vocbase\n"
|
|
"////////////////////////////////////////////////////////////////////////////////\n"
|
|
"\n"
|
|
"AvocadoEdges.prototype.toString = function() {\n"
|
|
" if (this instanceof AvocadoEdges) {\n"
|
|
" return \"[edges at \" + JSON.stringify(this._path) + \"]\";\n"
|
|
" }\n"
|
|
" else {\n"
|
|
" return \"[object]\";\n"
|
|
" }\n"
|
|
"}\n"
|
|
"\n"
|
|
"////////////////////////////////////////////////////////////////////////////////\n"
|
|
"/// @brief JSON representation of a vocbase\n"
|
|
"////////////////////////////////////////////////////////////////////////////////\n"
|
|
"\n"
|
|
"AvocadoEdges.prototype.toJSON = function() {\n"
|
|
" if (this instanceof AvocadoEdges) {\n"
|
|
" return \"[edges at \" + JSON.stringify(this._path) + \"]\";\n"
|
|
" }\n"
|
|
" else {\n"
|
|
" return \"[object]\";\n"
|
|
" }\n"
|
|
"}\n"
|
|
"\n"
|
|
"////////////////////////////////////////////////////////////////////////////////\n"
|
|
"/// @}\n"
|
|
"////////////////////////////////////////////////////////////////////////////////\n"
|
|
"\n"
|
|
"// -----------------------------------------------------------------------------\n"
|
|
"// --SECTION-- AvocadoEdgesCollection\n"
|
|
"// -----------------------------------------------------------------------------\n"
|
|
"\n"
|
|
"////////////////////////////////////////////////////////////////////////////////\n"
|
|
"/// @addtogroup V8Json\n"
|
|
"/// @{\n"
|
|
"////////////////////////////////////////////////////////////////////////////////\n"
|
|
"\n"
|
|
"////////////////////////////////////////////////////////////////////////////////\n"
|
|
"/// @brief string representation of an edges collection\n"
|
|
"////////////////////////////////////////////////////////////////////////////////\n"
|
|
"\n"
|
|
"AvocadoEdgesCollection.prototype.toString = function() {\n"
|
|
" var status;\n"
|
|
"\n"
|
|
" if (this instanceof AvocadoEdgesCollection) {\n"
|
|
" status = this.status();\n"
|
|
"\n"
|
|
" if (status == 1) {\n"
|
|
" return \"[new born collection at \" + JSON.stringify(this._name) + \"]\";\n"
|
|
" }\n"
|
|
" else if (status == 2) {\n"
|
|
" return \"[unloaded collection at \" + JSON.stringify(this._name) + \"]\";\n"
|
|
" }\n"
|
|
" else if (status == 3) {\n"
|
|
" return \"[collection at \" + JSON.stringify(this._name) + \"]\";\n"
|
|
" }\n"
|
|
" else {\n"
|
|
" return \"[corrupted collection at \" + JSON.stringify(this._name) + \"]\";\n"
|
|
" }\n"
|
|
" }\n"
|
|
" else {\n"
|
|
" return \"[object]\";\n"
|
|
" }\n"
|
|
"}\n"
|
|
"\n"
|
|
"////////////////////////////////////////////////////////////////////////////////\n"
|
|
"/// @brief JSON representation of an edges collection\n"
|
|
"////////////////////////////////////////////////////////////////////////////////\n"
|
|
"\n"
|
|
"AvocadoEdgesCollection.prototype.toJSON = function() {\n"
|
|
" var status;\n"
|
|
"\n"
|
|
" if (this instanceof AvocadoEdgesCollection) {\n"
|
|
" status = this.status();\n"
|
|
"\n"
|
|
" if (status == 1) {\n"
|
|
" return \"[new born collection at \" + JSON.stringify(this._name) + \"]\";\n"
|
|
" }\n"
|
|
" else if (status == 2) {\n"
|
|
" return \"[unloaded collection at \" + JSON.stringify(this._name) + \"]\";\n"
|
|
" }\n"
|
|
" else if (status == 3) {\n"
|
|
" return \"[collection at \" + JSON.stringify(this._name) + \"]\";\n"
|
|
" }\n"
|
|
" else {\n"
|
|
" return \"[corrupted collection at \" + JSON.stringify(this._name) + \"]\";\n"
|
|
" }\n"
|
|
" }\n"
|
|
" else {\n"
|
|
" return \"[object]\";\n"
|
|
" }\n"
|
|
"}\n"
|
|
"\n"
|
|
"////////////////////////////////////////////////////////////////////////////////\n"
|
|
"/// @}\n"
|
|
"////////////////////////////////////////////////////////////////////////////////\n"
|
|
"\n"
|
|
"// -----------------------------------------------------------------------------\n"
|
|
"// --SECTION-- AvocadoQuery\n"
|
|
"// -----------------------------------------------------------------------------\n"
|
|
"\n"
|
|
"////////////////////////////////////////////////////////////////////////////////\n"
|
|
"/// @brief string representation of a query\n"
|
|
"////////////////////////////////////////////////////////////////////////////////\n"
|
|
"\n"
|
|
"AvocadoQuery.prototype.toString = function() {\n"
|
|
" if (this instanceof AvocadoQuery) {\n"
|
|
" return \"[query]\";\n"
|
|
" }\n"
|
|
" else {\n"
|
|
" return \"[object]\";\n"
|
|
" }\n"
|
|
"}\n"
|
|
"\n"
|
|
"////////////////////////////////////////////////////////////////////////////////\n"
|
|
"/// @brief JSON representation of a query\n"
|
|
"////////////////////////////////////////////////////////////////////////////////\n"
|
|
"\n"
|
|
"AvocadoQuery.prototype.toJSON = function() {\n"
|
|
" if (this instanceof AvocadoQuery) {\n"
|
|
" return \"[query]\";\n"
|
|
" }\n"
|
|
" else {\n"
|
|
" return \"[object]\";\n"
|
|
" }\n"
|
|
"}\n"
|
|
"\n"
|
|
"////////////////////////////////////////////////////////////////////////////////\n"
|
|
"/// @}\n"
|
|
"////////////////////////////////////////////////////////////////////////////////\n"
|
|
"\n"
|
|
"// Local Variables:\n"
|
|
"// mode: outline-minor\n"
|
|
"// outline-regexp: \"^\\\\(/// @brief\\\\|/// @addtogroup\\\\|// --SECTION--\\\\)\"\n"
|
|
"// End:\n"
|
|
;
|