1
0
Fork 0

strings converted to char*

This commit is contained in:
Oreste Panaia 2012-10-01 18:36:42 +08:00
parent 5e6d6646a4
commit 5d79b618c7
8 changed files with 6699 additions and 6674 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,141 +1,142 @@
static string JS_common_bootstrap_errors = string("")
+ "/*jslint indent: 2,\n"
+ " nomen: true,\n"
+ " maxlen: 240,\n"
+ " sloppy: true,\n"
+ " vars: true,\n"
+ " white: true,\n"
+ " plusplus: true */\n"
+ "/*global require */\n"
+ "\n"
+ "////////////////////////////////////////////////////////////////////////////////\n"
+ "/// @brief auto-generated file generated from errors.dat\n"
+ "////////////////////////////////////////////////////////////////////////////////\n"
+ "\n"
+ "(function () {\n"
+ " var internal = require(\"internal\");\n"
+ "\n"
+ " internal.errors = {\n"
+ " \"ERROR_NO_ERROR\" : { \"code\" : 0, \"message\" : \"no error\" }, \n"
+ " \"ERROR_FAILED\" : { \"code\" : 1, \"message\" : \"failed\" }, \n"
+ " \"ERROR_SYS_ERROR\" : { \"code\" : 2, \"message\" : \"system error\" }, \n"
+ " \"ERROR_OUT_OF_MEMORY\" : { \"code\" : 3, \"message\" : \"out of memory\" }, \n"
+ " \"ERROR_INTERNAL\" : { \"code\" : 4, \"message\" : \"internal error\" }, \n"
+ " \"ERROR_ILLEGAL_NUMBER\" : { \"code\" : 5, \"message\" : \"illegal number\" }, \n"
+ " \"ERROR_NUMERIC_OVERFLOW\" : { \"code\" : 6, \"message\" : \"numeric overflow\" }, \n"
+ " \"ERROR_ILLEGAL_OPTION\" : { \"code\" : 7, \"message\" : \"illegal option\" }, \n"
+ " \"ERROR_DEAD_PID\" : { \"code\" : 8, \"message\" : \"dead process identifier\" }, \n"
+ " \"ERROR_NOT_IMPLEMENTED\" : { \"code\" : 9, \"message\" : \"not implemented\" }, \n"
+ " \"ERROR_BAD_PARAMETER\" : { \"code\" : 10, \"message\" : \"bad parameter\" }, \n"
+ " \"ERROR_FORBIDDEN\" : { \"code\" : 11, \"message\" : \"forbidden\" }, \n"
+ " \"ERROR_OUT_OF_MEMORY_MMAP\" : { \"code\" : 12, \"message\" : \"out of memory in mmap\" }, \n"
+ " \"ERROR_CORRUPTED_CSV\" : { \"code\" : 13, \"message\" : \"csv is corrupt\" }, \n"
+ " \"ERROR_HTTP_BAD_PARAMETER\" : { \"code\" : 400, \"message\" : \"bad parameter\" }, \n"
+ " \"ERROR_HTTP_FORBIDDEN\" : { \"code\" : 403, \"message\" : \"forbidden\" }, \n"
+ " \"ERROR_HTTP_NOT_FOUND\" : { \"code\" : 404, \"message\" : \"not found\" }, \n"
+ " \"ERROR_HTTP_METHOD_NOT_ALLOWED\" : { \"code\" : 405, \"message\" : \"method not supported\" }, \n"
+ " \"ERROR_HTTP_SERVER_ERROR\" : { \"code\" : 500, \"message\" : \"internal server error\" }, \n"
+ " \"ERROR_HTTP_CORRUPTED_JSON\" : { \"code\" : 600, \"message\" : \"invalid JSON object\" }, \n"
+ " \"ERROR_HTTP_SUPERFLUOUS_SUFFICES\" : { \"code\" : 601, \"message\" : \"superfluous URL suffices\" }, \n"
+ " \"ERROR_ARANGO_ILLEGAL_STATE\" : { \"code\" : 1000, \"message\" : \"illegal state\" }, \n"
+ " \"ERROR_ARANGO_SHAPER_FAILED\" : { \"code\" : 1001, \"message\" : \"illegal shaper\" }, \n"
+ " \"ERROR_ARANGO_DATAFILE_SEALED\" : { \"code\" : 1002, \"message\" : \"datafile sealed\" }, \n"
+ " \"ERROR_ARANGO_UNKNOWN_COLLECTION_TYPE\" : { \"code\" : 1003, \"message\" : \"unknown type\" }, \n"
+ " \"ERROR_ARANGO_READ_ONLY\" : { \"code\" : 1004, \"message\" : \"ready only\" }, \n"
+ " \"ERROR_ARANGO_DUPLICATE_IDENTIFIER\" : { \"code\" : 1005, \"message\" : \"duplicate identifier\" }, \n"
+ " \"ERROR_ARANGO_DATAFILE_UNREADABLE\" : { \"code\" : 1006, \"message\" : \"datafile unreadable\" }, \n"
+ " \"ERROR_ARANGO_CORRUPTED_DATAFILE\" : { \"code\" : 1100, \"message\" : \"corrupted datafile\" }, \n"
+ " \"ERROR_ARANGO_ILLEGAL_PARAMETER_FILE\" : { \"code\" : 1101, \"message\" : \"illegal parameter file\" }, \n"
+ " \"ERROR_ARANGO_CORRUPTED_COLLECTION\" : { \"code\" : 1102, \"message\" : \"corrupted collection\" }, \n"
+ " \"ERROR_ARANGO_MMAP_FAILED\" : { \"code\" : 1103, \"message\" : \"mmap failed\" }, \n"
+ " \"ERROR_ARANGO_FILESYSTEM_FULL\" : { \"code\" : 1104, \"message\" : \"filesystem full\" }, \n"
+ " \"ERROR_ARANGO_NO_JOURNAL\" : { \"code\" : 1105, \"message\" : \"no journal\" }, \n"
+ " \"ERROR_ARANGO_DATAFILE_ALREADY_EXISTS\" : { \"code\" : 1106, \"message\" : \"cannot create/rename datafile because it already exists\" }, \n"
+ " \"ERROR_ARANGO_DATABASE_LOCKED\" : { \"code\" : 1107, \"message\" : \"database is locked\" }, \n"
+ " \"ERROR_ARANGO_COLLECTION_DIRECTORY_ALREADY_EXISTS\" : { \"code\" : 1108, \"message\" : \"cannot create/rename collection because directory already exists\" }, \n"
+ " \"ERROR_ARANGO_CONFLICT\" : { \"code\" : 1200, \"message\" : \"conflict\" }, \n"
+ " \"ERROR_ARANGO_WRONG_VOCBASE_PATH\" : { \"code\" : 1201, \"message\" : \"wrong path for database\" }, \n"
+ " \"ERROR_ARANGO_DOCUMENT_NOT_FOUND\" : { \"code\" : 1202, \"message\" : \"document not found\" }, \n"
+ " \"ERROR_ARANGO_COLLECTION_NOT_FOUND\" : { \"code\" : 1203, \"message\" : \"collection not found\" }, \n"
+ " \"ERROR_ARANGO_COLLECTION_PARAMETER_MISSING\" : { \"code\" : 1204, \"message\" : \"parameter 'collection' not found\" }, \n"
+ " \"ERROR_ARANGO_DOCUMENT_HANDLE_BAD\" : { \"code\" : 1205, \"message\" : \"illegal document handle\" }, \n"
+ " \"ERROR_ARANGO_MAXIMAL_SIZE_TOO_SMALL\" : { \"code\" : 1206, \"message\" : \"maixaml size of journal too small\" }, \n"
+ " \"ERROR_ARANGO_DUPLICATE_NAME\" : { \"code\" : 1207, \"message\" : \"duplicate name\" }, \n"
+ " \"ERROR_ARANGO_ILLEGAL_NAME\" : { \"code\" : 1208, \"message\" : \"illegal name\" }, \n"
+ " \"ERROR_ARANGO_NO_INDEX\" : { \"code\" : 1209, \"message\" : \"no suitable index known\" }, \n"
+ " \"ERROR_ARANGO_UNIQUE_CONSTRAINT_VIOLATED\" : { \"code\" : 1210, \"message\" : \"unique constraint violated\" }, \n"
+ " \"ERROR_ARANGO_GEO_INDEX_VIOLATED\" : { \"code\" : 1211, \"message\" : \"geo index violated\" }, \n"
+ " \"ERROR_ARANGO_INDEX_NOT_FOUND\" : { \"code\" : 1212, \"message\" : \"index not found\" }, \n"
+ " \"ERROR_ARANGO_CROSS_COLLECTION_REQUEST\" : { \"code\" : 1213, \"message\" : \"cross collection request not allowed\" }, \n"
+ " \"ERROR_ARANGO_INDEX_HANDLE_BAD\" : { \"code\" : 1214, \"message\" : \"illegal index handle\" }, \n"
+ " \"ERROR_ARANGO_CAP_CONSTRAINT_ALREADY_DEFINED\" : { \"code\" : 1215, \"message\" : \"cap constraint already defined\" }, \n"
+ " \"ERROR_ARANGO_DOCUMENT_TOO_LARGE\" : { \"code\" : 1216, \"message\" : \"document too large\" }, \n"
+ " \"ERROR_ARANGO_COLLECTION_NOT_UNLOADED\" : { \"code\" : 1217, \"message\" : \"collection must be unloaded\" }, \n"
+ " \"ERROR_ARANGO_COLLECTION_TYPE_INVALID\" : { \"code\" : 1218, \"message\" : \"collection type invalid\" }, \n"
+ " \"ERROR_ARANGO_DATAFILE_FULL\" : { \"code\" : 1300, \"message\" : \"datafile full\" }, \n"
+ " \"ERROR_QUERY_KILLED\" : { \"code\" : 1500, \"message\" : \"query killed\" }, \n"
+ " \"ERROR_QUERY_PARSE\" : { \"code\" : 1501, \"message\" : \"%s\" }, \n"
+ " \"ERROR_QUERY_EMPTY\" : { \"code\" : 1502, \"message\" : \"query is empty\" }, \n"
+ " \"ERROR_QUERY_SCRIPT\" : { \"code\" : 1503, \"message\" : \"runtime error '%s'\" }, \n"
+ " \"ERROR_QUERY_NUMBER_OUT_OF_RANGE\" : { \"code\" : 1504, \"message\" : \"number out of range\" }, \n"
+ " \"ERROR_QUERY_VARIABLE_NAME_INVALID\" : { \"code\" : 1510, \"message\" : \"variable name '%s' has an invalid format\" }, \n"
+ " \"ERROR_QUERY_VARIABLE_REDECLARED\" : { \"code\" : 1511, \"message\" : \"variable '%s' is assigned multiple times\" }, \n"
+ " \"ERROR_QUERY_VARIABLE_NAME_UNKNOWN\" : { \"code\" : 1512, \"message\" : \"unknown variable '%s'\" }, \n"
+ " \"ERROR_QUERY_COLLECTION_NOT_FOUND\" : { \"code\" : 1520, \"message\" : \"unable to open collection '%s'\" }, \n"
+ " \"ERROR_QUERY_COLLECTION_LOCK_FAILED\" : { \"code\" : 1521, \"message\" : \"unable to read-lock collection %s\" }, \n"
+ " \"ERROR_QUERY_TOO_MANY_COLLECTIONS\" : { \"code\" : 1522, \"message\" : \"too many collections\" }, \n"
+ " \"ERROR_QUERY_DOCUMENT_ATTRIBUTE_REDECLARED\" : { \"code\" : 1530, \"message\" : \"document attribute '%s' is assigned multiple times\" }, \n"
+ " \"ERROR_QUERY_FUNCTION_NAME_UNKNOWN\" : { \"code\" : 1540, \"message\" : \"usage of unknown function '%s'\" }, \n"
+ " \"ERROR_QUERY_FUNCTION_ARGUMENT_NUMBER_MISMATCH\" : { \"code\" : 1541, \"message\" : \"invalid number of arguments for function '%s'\" }, \n"
+ " \"ERROR_QUERY_FUNCTION_ARGUMENT_TYPE_MISMATCH\" : { \"code\" : 1542, \"message\" : \"invalid argument type used in call to function '%s()'\" }, \n"
+ " \"ERROR_QUERY_BIND_PARAMETERS_INVALID\" : { \"code\" : 1550, \"message\" : \"invalid structure of bind parameters\" }, \n"
+ " \"ERROR_QUERY_BIND_PARAMETER_MISSING\" : { \"code\" : 1551, \"message\" : \"no value specified for declared bind parameter '%s'\" }, \n"
+ " \"ERROR_QUERY_BIND_PARAMETER_UNDECLARED\" : { \"code\" : 1552, \"message\" : \"bind parameter '%s' was not declared in the query\" }, \n"
+ " \"ERROR_QUERY_BIND_PARAMETER_TYPE\" : { \"code\" : 1553, \"message\" : \"bind parameter '%s' has an invalid value or type\" }, \n"
+ " \"ERROR_QUERY_INVALID_LOGICAL_VALUE\" : { \"code\" : 1560, \"message\" : \"invalid logical value\" }, \n"
+ " \"ERROR_QUERY_INVALID_ARITHMETIC_VALUE\" : { \"code\" : 1561, \"message\" : \"invalid arithmetic value\" }, \n"
+ " \"ERROR_QUERY_DIVISION_BY_ZERO\" : { \"code\" : 1562, \"message\" : \"division by zero\" }, \n"
+ " \"ERROR_QUERY_LIST_EXPECTED\" : { \"code\" : 1563, \"message\" : \"list expected\" }, \n"
+ " \"ERROR_QUERY_FAIL_CALLED\" : { \"code\" : 1569, \"message\" : \"FAIL(%s) called\" }, \n"
+ " \"ERROR_QUERY_GEO_INDEX_MISSING\" : { \"code\" : 1570, \"message\" : \"no suitable geo index found for geo restriction on '%s'\" }, \n"
+ " \"ERROR_CURSOR_NOT_FOUND\" : { \"code\" : 1600, \"message\" : \"cursor not found\" }, \n"
+ " \"ERROR_KEYVALUE_INVALID_KEY\" : { \"code\" : 1800, \"message\" : \"invalid key declaration\" }, \n"
+ " \"ERROR_KEYVALUE_KEY_EXISTS\" : { \"code\" : 1801, \"message\" : \"key already exists\" }, \n"
+ " \"ERROR_KEYVALUE_KEY_NOT_FOUND\" : { \"code\" : 1802, \"message\" : \"key not found\" }, \n"
+ " \"ERROR_KEYVALUE_KEY_NOT_UNIQUE\" : { \"code\" : 1803, \"message\" : \"key is not unique\" }, \n"
+ " \"ERROR_KEYVALUE_KEY_NOT_CHANGED\" : { \"code\" : 1804, \"message\" : \"key value not changed\" }, \n"
+ " \"ERROR_KEYVALUE_KEY_NOT_REMOVED\" : { \"code\" : 1805, \"message\" : \"key value not removed\" }, \n"
+ " \"ERROR_KEYVALUE_NO_VALUE\" : { \"code\" : 1806, \"message\" : \"missing value\" }, \n"
+ " \"ERROR_GRAPH_INVALID_GRAPH\" : { \"code\" : 1901, \"message\" : \"invalid graph\" }, \n"
+ " \"ERROR_GRAPH_COULD_NOT_CREATE_GRAPH\" : { \"code\" : 1902, \"message\" : \"could not create graph\" }, \n"
+ " \"ERROR_GRAPH_INVALID_VERTEX\" : { \"code\" : 1903, \"message\" : \"invalid vertex\" }, \n"
+ " \"ERROR_GRAPH_COULD_NOT_CREATE_VERTEX\" : { \"code\" : 1904, \"message\" : \"could not create vertex\" }, \n"
+ " \"ERROR_GRAPH_COULD_NOT_CHANGE_VERTEX\" : { \"code\" : 1905, \"message\" : \"could not change vertex\" }, \n"
+ " \"ERROR_GRAPH_INVALID_EDGE\" : { \"code\" : 1906, \"message\" : \"invalid edge\" }, \n"
+ " \"ERROR_GRAPH_COULD_NOT_CREATE_EDGE\" : { \"code\" : 1907, \"message\" : \"could not create edge\" }, \n"
+ " \"ERROR_GRAPH_COULD_NOT_CHANGE_EDGE\" : { \"code\" : 1908, \"message\" : \"could not change edge\" }, \n"
+ " \"SIMPLE_CLIENT_UNKNOWN_ERROR\" : { \"code\" : 2000, \"message\" : \"unknown client error\" }, \n"
+ " \"SIMPLE_CLIENT_COULD_NOT_CONNECT\" : { \"code\" : 2001, \"message\" : \"could not connect to server\" }, \n"
+ " \"SIMPLE_CLIENT_COULD_NOT_WRITE\" : { \"code\" : 2002, \"message\" : \"could not write to server\" }, \n"
+ " \"SIMPLE_CLIENT_COULD_NOT_READ\" : { \"code\" : 2003, \"message\" : \"could not read from server\" }, \n"
+ " \"ERROR_ARANGO_INDEX_PQ_INSERT_FAILED\" : { \"code\" : 3100, \"message\" : \"priority queue insert failure\" }, \n"
+ " \"ERROR_ARANGO_INDEX_PQ_REMOVE_FAILED\" : { \"code\" : 3110, \"message\" : \"priority queue remove failure\" }, \n"
+ " \"ERROR_ARANGO_INDEX_PQ_REMOVE_ITEM_MISSING\" : { \"code\" : 3111, \"message\" : \"priority queue remove failure - item missing in index\" }, \n"
+ " \"ERROR_ARANGO_INDEX_HASH_INSERT_ITEM_DUPLICATED\" : { \"code\" : 3312, \"message\" : \"(non-unique) hash index insert failure - document duplicated in index\" }, \n"
+ " \"ERROR_ARANGO_INDEX_SKIPLIST_INSERT_ITEM_DUPLICATED\" : { \"code\" : 3313, \"message\" : \"(non-unique) skiplist index insert failure - document duplicated in index\" }, \n"
+ " \"WARNING_ARANGO_INDEX_HASH_DOCUMENT_ATTRIBUTE_MISSING\" : { \"code\" : 3200, \"message\" : \"hash index insertion warning - attribute missing in document\" }, \n"
+ " \"WARNING_ARANGO_INDEX_HASH_UPDATE_ATTRIBUTE_MISSING\" : { \"code\" : 3202, \"message\" : \"hash index update warning - attribute missing in revised document\" }, \n"
+ " \"WARNING_ARANGO_INDEX_HASH_REMOVE_ITEM_MISSING\" : { \"code\" : 3211, \"message\" : \"hash index remove failure - item missing in index\" }, \n"
+ " \"WARNING_ARANGO_INDEX_SKIPLIST_DOCUMENT_ATTRIBUTE_MISSING\" : { \"code\" : 3300, \"message\" : \"skiplist index insertion warning - attribute missing in document\" }, \n"
+ " \"WARNING_ARANGO_INDEX_SKIPLIST_UPDATE_ATTRIBUTE_MISSING\" : { \"code\" : 3302, \"message\" : \"skiplist index update warning - attribute missing in revised document\" }, \n"
+ " \"WARNING_ARANGO_INDEX_SKIPLIST_REMOVE_ITEM_MISSING\" : { \"code\" : 3311, \"message\" : \"skiplist index remove failure - item missing in index\" }, \n"
+ " \"WARNING_ARANGO_INDEX_BITARRAY_DOCUMENT_ATTRIBUTE_MISSING\" : { \"code\" : 3400, \"message\" : \"bitarray index insertion warning - attribute missing in document\" }, \n"
+ " \"WARNING_ARANGO_INDEX_BITARRAY_UPDATE_ATTRIBUTE_MISSING\" : { \"code\" : 3402, \"message\" : \"bitarray index update warning - attribute missing in revised document\" }, \n"
+ " \"WARNING_ARANGO_INDEX_BITARRAY_REMOVE_ITEM_MISSING\" : { \"code\" : 3411, \"message\" : \"bitarray index remove failure - item missing in index\" }, \n"
+ " \"ERROR_ARANGO_INDEX_BITARRAY_INSERT_ITEM_UNSUPPORTED_VALUE\" : { \"code\" : 3413, \"message\" : \"bitarray index insert failure - document attribute value unsupported in index\" }, \n"
+ " \"ERROR_ARANGO_INDEX_BITARRAY_CREATION_FAILURE_DUPLICATE_ATTRIBUTES\" : { \"code\" : 3415, \"message\" : \"bitarray index creation failure - one or more index attributes are duplicated.\" }, \n"
+ " \"ERROR_ARANGO_INDEX_BITARRAY_CREATION_FAILURE_DUPLICATE_VALUES\" : { \"code\" : 3417, \"message\" : \"bitarray index creation failure - one or more index attribute values are duplicated.\" }, \n"
+ "};\n"
+ "}());\n"
+ "\n"
;
const char* JS_common_bootstrap_errors[] = {
"/*jslint indent: 2,",
" nomen: true,",
" maxlen: 240,",
" sloppy: true,",
" vars: true,",
" white: true,",
" plusplus: true */",
"/*global require */",
"",
"////////////////////////////////////////////////////////////////////////////////",
"/// @brief auto-generated file generated from errors.dat",
"////////////////////////////////////////////////////////////////////////////////",
"",
"(function () {",
" var internal = require(\"internal\");",
"",
" internal.errors = {",
" \"ERROR_NO_ERROR\" : { \"code\" : 0, \"message\" : \"no error\" }, ",
" \"ERROR_FAILED\" : { \"code\" : 1, \"message\" : \"failed\" }, ",
" \"ERROR_SYS_ERROR\" : { \"code\" : 2, \"message\" : \"system error\" }, ",
" \"ERROR_OUT_OF_MEMORY\" : { \"code\" : 3, \"message\" : \"out of memory\" }, ",
" \"ERROR_INTERNAL\" : { \"code\" : 4, \"message\" : \"internal error\" }, ",
" \"ERROR_ILLEGAL_NUMBER\" : { \"code\" : 5, \"message\" : \"illegal number\" }, ",
" \"ERROR_NUMERIC_OVERFLOW\" : { \"code\" : 6, \"message\" : \"numeric overflow\" }, ",
" \"ERROR_ILLEGAL_OPTION\" : { \"code\" : 7, \"message\" : \"illegal option\" }, ",
" \"ERROR_DEAD_PID\" : { \"code\" : 8, \"message\" : \"dead process identifier\" }, ",
" \"ERROR_NOT_IMPLEMENTED\" : { \"code\" : 9, \"message\" : \"not implemented\" }, ",
" \"ERROR_BAD_PARAMETER\" : { \"code\" : 10, \"message\" : \"bad parameter\" }, ",
" \"ERROR_FORBIDDEN\" : { \"code\" : 11, \"message\" : \"forbidden\" }, ",
" \"ERROR_OUT_OF_MEMORY_MMAP\" : { \"code\" : 12, \"message\" : \"out of memory in mmap\" }, ",
" \"ERROR_CORRUPTED_CSV\" : { \"code\" : 13, \"message\" : \"csv is corrupt\" }, ",
" \"ERROR_HTTP_BAD_PARAMETER\" : { \"code\" : 400, \"message\" : \"bad parameter\" }, ",
" \"ERROR_HTTP_FORBIDDEN\" : { \"code\" : 403, \"message\" : \"forbidden\" }, ",
" \"ERROR_HTTP_NOT_FOUND\" : { \"code\" : 404, \"message\" : \"not found\" }, ",
" \"ERROR_HTTP_METHOD_NOT_ALLOWED\" : { \"code\" : 405, \"message\" : \"method not supported\" }, ",
" \"ERROR_HTTP_SERVER_ERROR\" : { \"code\" : 500, \"message\" : \"internal server error\" }, ",
" \"ERROR_HTTP_CORRUPTED_JSON\" : { \"code\" : 600, \"message\" : \"invalid JSON object\" }, ",
" \"ERROR_HTTP_SUPERFLUOUS_SUFFICES\" : { \"code\" : 601, \"message\" : \"superfluous URL suffices\" }, ",
" \"ERROR_ARANGO_ILLEGAL_STATE\" : { \"code\" : 1000, \"message\" : \"illegal state\" }, ",
" \"ERROR_ARANGO_SHAPER_FAILED\" : { \"code\" : 1001, \"message\" : \"illegal shaper\" }, ",
" \"ERROR_ARANGO_DATAFILE_SEALED\" : { \"code\" : 1002, \"message\" : \"datafile sealed\" }, ",
" \"ERROR_ARANGO_UNKNOWN_COLLECTION_TYPE\" : { \"code\" : 1003, \"message\" : \"unknown type\" }, ",
" \"ERROR_ARANGO_READ_ONLY\" : { \"code\" : 1004, \"message\" : \"ready only\" }, ",
" \"ERROR_ARANGO_DUPLICATE_IDENTIFIER\" : { \"code\" : 1005, \"message\" : \"duplicate identifier\" }, ",
" \"ERROR_ARANGO_DATAFILE_UNREADABLE\" : { \"code\" : 1006, \"message\" : \"datafile unreadable\" }, ",
" \"ERROR_ARANGO_CORRUPTED_DATAFILE\" : { \"code\" : 1100, \"message\" : \"corrupted datafile\" }, ",
" \"ERROR_ARANGO_ILLEGAL_PARAMETER_FILE\" : { \"code\" : 1101, \"message\" : \"illegal parameter file\" }, ",
" \"ERROR_ARANGO_CORRUPTED_COLLECTION\" : { \"code\" : 1102, \"message\" : \"corrupted collection\" }, ",
" \"ERROR_ARANGO_MMAP_FAILED\" : { \"code\" : 1103, \"message\" : \"mmap failed\" }, ",
" \"ERROR_ARANGO_FILESYSTEM_FULL\" : { \"code\" : 1104, \"message\" : \"filesystem full\" }, ",
" \"ERROR_ARANGO_NO_JOURNAL\" : { \"code\" : 1105, \"message\" : \"no journal\" }, ",
" \"ERROR_ARANGO_DATAFILE_ALREADY_EXISTS\" : { \"code\" : 1106, \"message\" : \"cannot create/rename datafile because it already exists\" }, ",
" \"ERROR_ARANGO_DATABASE_LOCKED\" : { \"code\" : 1107, \"message\" : \"database is locked\" }, ",
" \"ERROR_ARANGO_COLLECTION_DIRECTORY_ALREADY_EXISTS\" : { \"code\" : 1108, \"message\" : \"cannot create/rename collection because directory already exists\" }, ",
" \"ERROR_ARANGO_CONFLICT\" : { \"code\" : 1200, \"message\" : \"conflict\" }, ",
" \"ERROR_ARANGO_WRONG_VOCBASE_PATH\" : { \"code\" : 1201, \"message\" : \"wrong path for database\" }, ",
" \"ERROR_ARANGO_DOCUMENT_NOT_FOUND\" : { \"code\" : 1202, \"message\" : \"document not found\" }, ",
" \"ERROR_ARANGO_COLLECTION_NOT_FOUND\" : { \"code\" : 1203, \"message\" : \"collection not found\" }, ",
" \"ERROR_ARANGO_COLLECTION_PARAMETER_MISSING\" : { \"code\" : 1204, \"message\" : \"parameter 'collection' not found\" }, ",
" \"ERROR_ARANGO_DOCUMENT_HANDLE_BAD\" : { \"code\" : 1205, \"message\" : \"illegal document handle\" }, ",
" \"ERROR_ARANGO_MAXIMAL_SIZE_TOO_SMALL\" : { \"code\" : 1206, \"message\" : \"maixaml size of journal too small\" }, ",
" \"ERROR_ARANGO_DUPLICATE_NAME\" : { \"code\" : 1207, \"message\" : \"duplicate name\" }, ",
" \"ERROR_ARANGO_ILLEGAL_NAME\" : { \"code\" : 1208, \"message\" : \"illegal name\" }, ",
" \"ERROR_ARANGO_NO_INDEX\" : { \"code\" : 1209, \"message\" : \"no suitable index known\" }, ",
" \"ERROR_ARANGO_UNIQUE_CONSTRAINT_VIOLATED\" : { \"code\" : 1210, \"message\" : \"unique constraint violated\" }, ",
" \"ERROR_ARANGO_GEO_INDEX_VIOLATED\" : { \"code\" : 1211, \"message\" : \"geo index violated\" }, ",
" \"ERROR_ARANGO_INDEX_NOT_FOUND\" : { \"code\" : 1212, \"message\" : \"index not found\" }, ",
" \"ERROR_ARANGO_CROSS_COLLECTION_REQUEST\" : { \"code\" : 1213, \"message\" : \"cross collection request not allowed\" }, ",
" \"ERROR_ARANGO_INDEX_HANDLE_BAD\" : { \"code\" : 1214, \"message\" : \"illegal index handle\" }, ",
" \"ERROR_ARANGO_CAP_CONSTRAINT_ALREADY_DEFINED\" : { \"code\" : 1215, \"message\" : \"cap constraint already defined\" }, ",
" \"ERROR_ARANGO_DOCUMENT_TOO_LARGE\" : { \"code\" : 1216, \"message\" : \"document too large\" }, ",
" \"ERROR_ARANGO_COLLECTION_NOT_UNLOADED\" : { \"code\" : 1217, \"message\" : \"collection must be unloaded\" }, ",
" \"ERROR_ARANGO_COLLECTION_TYPE_INVALID\" : { \"code\" : 1218, \"message\" : \"collection type invalid\" }, ",
" \"ERROR_ARANGO_DATAFILE_FULL\" : { \"code\" : 1300, \"message\" : \"datafile full\" }, ",
" \"ERROR_QUERY_KILLED\" : { \"code\" : 1500, \"message\" : \"query killed\" }, ",
" \"ERROR_QUERY_PARSE\" : { \"code\" : 1501, \"message\" : \"%s\" }, ",
" \"ERROR_QUERY_EMPTY\" : { \"code\" : 1502, \"message\" : \"query is empty\" }, ",
" \"ERROR_QUERY_SCRIPT\" : { \"code\" : 1503, \"message\" : \"runtime error '%s'\" }, ",
" \"ERROR_QUERY_NUMBER_OUT_OF_RANGE\" : { \"code\" : 1504, \"message\" : \"number out of range\" }, ",
" \"ERROR_QUERY_VARIABLE_NAME_INVALID\" : { \"code\" : 1510, \"message\" : \"variable name '%s' has an invalid format\" }, ",
" \"ERROR_QUERY_VARIABLE_REDECLARED\" : { \"code\" : 1511, \"message\" : \"variable '%s' is assigned multiple times\" }, ",
" \"ERROR_QUERY_VARIABLE_NAME_UNKNOWN\" : { \"code\" : 1512, \"message\" : \"unknown variable '%s'\" }, ",
" \"ERROR_QUERY_COLLECTION_NOT_FOUND\" : { \"code\" : 1520, \"message\" : \"unable to open collection '%s'\" }, ",
" \"ERROR_QUERY_COLLECTION_LOCK_FAILED\" : { \"code\" : 1521, \"message\" : \"unable to read-lock collection %s\" }, ",
" \"ERROR_QUERY_TOO_MANY_COLLECTIONS\" : { \"code\" : 1522, \"message\" : \"too many collections\" }, ",
" \"ERROR_QUERY_DOCUMENT_ATTRIBUTE_REDECLARED\" : { \"code\" : 1530, \"message\" : \"document attribute '%s' is assigned multiple times\" }, ",
" \"ERROR_QUERY_FUNCTION_NAME_UNKNOWN\" : { \"code\" : 1540, \"message\" : \"usage of unknown function '%s'\" }, ",
" \"ERROR_QUERY_FUNCTION_ARGUMENT_NUMBER_MISMATCH\" : { \"code\" : 1541, \"message\" : \"invalid number of arguments for function '%s'\" }, ",
" \"ERROR_QUERY_FUNCTION_ARGUMENT_TYPE_MISMATCH\" : { \"code\" : 1542, \"message\" : \"invalid argument type used in call to function '%s()'\" }, ",
" \"ERROR_QUERY_BIND_PARAMETERS_INVALID\" : { \"code\" : 1550, \"message\" : \"invalid structure of bind parameters\" }, ",
" \"ERROR_QUERY_BIND_PARAMETER_MISSING\" : { \"code\" : 1551, \"message\" : \"no value specified for declared bind parameter '%s'\" }, ",
" \"ERROR_QUERY_BIND_PARAMETER_UNDECLARED\" : { \"code\" : 1552, \"message\" : \"bind parameter '%s' was not declared in the query\" }, ",
" \"ERROR_QUERY_BIND_PARAMETER_TYPE\" : { \"code\" : 1553, \"message\" : \"bind parameter '%s' has an invalid value or type\" }, ",
" \"ERROR_QUERY_INVALID_LOGICAL_VALUE\" : { \"code\" : 1560, \"message\" : \"invalid logical value\" }, ",
" \"ERROR_QUERY_INVALID_ARITHMETIC_VALUE\" : { \"code\" : 1561, \"message\" : \"invalid arithmetic value\" }, ",
" \"ERROR_QUERY_DIVISION_BY_ZERO\" : { \"code\" : 1562, \"message\" : \"division by zero\" }, ",
" \"ERROR_QUERY_LIST_EXPECTED\" : { \"code\" : 1563, \"message\" : \"list expected\" }, ",
" \"ERROR_QUERY_FAIL_CALLED\" : { \"code\" : 1569, \"message\" : \"FAIL(%s) called\" }, ",
" \"ERROR_QUERY_GEO_INDEX_MISSING\" : { \"code\" : 1570, \"message\" : \"no suitable geo index found for geo restriction on '%s'\" }, ",
" \"ERROR_CURSOR_NOT_FOUND\" : { \"code\" : 1600, \"message\" : \"cursor not found\" }, ",
" \"ERROR_KEYVALUE_INVALID_KEY\" : { \"code\" : 1800, \"message\" : \"invalid key declaration\" }, ",
" \"ERROR_KEYVALUE_KEY_EXISTS\" : { \"code\" : 1801, \"message\" : \"key already exists\" }, ",
" \"ERROR_KEYVALUE_KEY_NOT_FOUND\" : { \"code\" : 1802, \"message\" : \"key not found\" }, ",
" \"ERROR_KEYVALUE_KEY_NOT_UNIQUE\" : { \"code\" : 1803, \"message\" : \"key is not unique\" }, ",
" \"ERROR_KEYVALUE_KEY_NOT_CHANGED\" : { \"code\" : 1804, \"message\" : \"key value not changed\" }, ",
" \"ERROR_KEYVALUE_KEY_NOT_REMOVED\" : { \"code\" : 1805, \"message\" : \"key value not removed\" }, ",
" \"ERROR_KEYVALUE_NO_VALUE\" : { \"code\" : 1806, \"message\" : \"missing value\" }, ",
" \"ERROR_GRAPH_INVALID_GRAPH\" : { \"code\" : 1901, \"message\" : \"invalid graph\" }, ",
" \"ERROR_GRAPH_COULD_NOT_CREATE_GRAPH\" : { \"code\" : 1902, \"message\" : \"could not create graph\" }, ",
" \"ERROR_GRAPH_INVALID_VERTEX\" : { \"code\" : 1903, \"message\" : \"invalid vertex\" }, ",
" \"ERROR_GRAPH_COULD_NOT_CREATE_VERTEX\" : { \"code\" : 1904, \"message\" : \"could not create vertex\" }, ",
" \"ERROR_GRAPH_COULD_NOT_CHANGE_VERTEX\" : { \"code\" : 1905, \"message\" : \"could not change vertex\" }, ",
" \"ERROR_GRAPH_INVALID_EDGE\" : { \"code\" : 1906, \"message\" : \"invalid edge\" }, ",
" \"ERROR_GRAPH_COULD_NOT_CREATE_EDGE\" : { \"code\" : 1907, \"message\" : \"could not create edge\" }, ",
" \"ERROR_GRAPH_COULD_NOT_CHANGE_EDGE\" : { \"code\" : 1908, \"message\" : \"could not change edge\" }, ",
" \"SIMPLE_CLIENT_UNKNOWN_ERROR\" : { \"code\" : 2000, \"message\" : \"unknown client error\" }, ",
" \"SIMPLE_CLIENT_COULD_NOT_CONNECT\" : { \"code\" : 2001, \"message\" : \"could not connect to server\" }, ",
" \"SIMPLE_CLIENT_COULD_NOT_WRITE\" : { \"code\" : 2002, \"message\" : \"could not write to server\" }, ",
" \"SIMPLE_CLIENT_COULD_NOT_READ\" : { \"code\" : 2003, \"message\" : \"could not read from server\" }, ",
" \"ERROR_ARANGO_INDEX_PQ_INSERT_FAILED\" : { \"code\" : 3100, \"message\" : \"priority queue insert failure\" }, ",
" \"ERROR_ARANGO_INDEX_PQ_REMOVE_FAILED\" : { \"code\" : 3110, \"message\" : \"priority queue remove failure\" }, ",
" \"ERROR_ARANGO_INDEX_PQ_REMOVE_ITEM_MISSING\" : { \"code\" : 3111, \"message\" : \"priority queue remove failure - item missing in index\" }, ",
" \"ERROR_ARANGO_INDEX_HASH_INSERT_ITEM_DUPLICATED\" : { \"code\" : 3312, \"message\" : \"(non-unique) hash index insert failure - document duplicated in index\" }, ",
" \"ERROR_ARANGO_INDEX_SKIPLIST_INSERT_ITEM_DUPLICATED\" : { \"code\" : 3313, \"message\" : \"(non-unique) skiplist index insert failure - document duplicated in index\" }, ",
" \"WARNING_ARANGO_INDEX_HASH_DOCUMENT_ATTRIBUTE_MISSING\" : { \"code\" : 3200, \"message\" : \"hash index insertion warning - attribute missing in document\" }, ",
" \"WARNING_ARANGO_INDEX_HASH_UPDATE_ATTRIBUTE_MISSING\" : { \"code\" : 3202, \"message\" : \"hash index update warning - attribute missing in revised document\" }, ",
" \"WARNING_ARANGO_INDEX_HASH_REMOVE_ITEM_MISSING\" : { \"code\" : 3211, \"message\" : \"hash index remove failure - item missing in index\" }, ",
" \"WARNING_ARANGO_INDEX_SKIPLIST_DOCUMENT_ATTRIBUTE_MISSING\" : { \"code\" : 3300, \"message\" : \"skiplist index insertion warning - attribute missing in document\" }, ",
" \"WARNING_ARANGO_INDEX_SKIPLIST_UPDATE_ATTRIBUTE_MISSING\" : { \"code\" : 3302, \"message\" : \"skiplist index update warning - attribute missing in revised document\" }, ",
" \"WARNING_ARANGO_INDEX_SKIPLIST_REMOVE_ITEM_MISSING\" : { \"code\" : 3311, \"message\" : \"skiplist index remove failure - item missing in index\" }, ",
" \"WARNING_ARANGO_INDEX_BITARRAY_DOCUMENT_ATTRIBUTE_MISSING\" : { \"code\" : 3400, \"message\" : \"bitarray index insertion warning - attribute missing in document\" }, ",
" \"WARNING_ARANGO_INDEX_BITARRAY_UPDATE_ATTRIBUTE_MISSING\" : { \"code\" : 3402, \"message\" : \"bitarray index update warning - attribute missing in revised document\" }, ",
" \"WARNING_ARANGO_INDEX_BITARRAY_REMOVE_ITEM_MISSING\" : { \"code\" : 3411, \"message\" : \"bitarray index remove failure - item missing in index\" }, ",
" \"ERROR_ARANGO_INDEX_BITARRAY_INSERT_ITEM_UNSUPPORTED_VALUE\" : { \"code\" : 3413, \"message\" : \"bitarray index insert failure - document attribute value unsupported in index\" }, ",
" \"ERROR_ARANGO_INDEX_BITARRAY_CREATION_FAILURE_DUPLICATE_ATTRIBUTES\" : { \"code\" : 3415, \"message\" : \"bitarray index creation failure - one or more index attributes are duplicated.\" }, ",
" \"ERROR_ARANGO_INDEX_BITARRAY_CREATION_FAILURE_DUPLICATE_VALUES\" : { \"code\" : 3417, \"message\" : \"bitarray index creation failure - one or more index attribute values are duplicated.\" }, ",
"};",
"}());",
"",
"//__end__"
};

File diff suppressed because it is too large Load Diff

View File

@ -1,333 +1,334 @@
static string JS_common_bootstrap_print = string("")
+ "/*jslint indent: 2,\n"
+ " nomen: true,\n"
+ " maxlen: 100,\n"
+ " sloppy: true,\n"
+ " vars: true,\n"
+ " white: true,\n"
+ " plusplus: true */\n"
+ "/*global require, print */\n"
+ "\n"
+ "////////////////////////////////////////////////////////////////////////////////\n"
+ "/// @brief printing\n"
+ "///\n"
+ "/// @file\n"
+ "///\n"
+ "/// DISCLAIMER\n"
+ "///\n"
+ "/// Copyright 2010-2012 triagens GmbH, Cologne, Germany\n"
+ "///\n"
+ "/// Licensed under the Apache License, Version 2.0 (the \"License\");\n"
+ "/// you may not use this file except in compliance with the License.\n"
+ "/// You may obtain a copy of the License at\n"
+ "///\n"
+ "/// http://www.apache.org/licenses/LICENSE-2.0\n"
+ "///\n"
+ "/// Unless required by applicable law or agreed to in writing, software\n"
+ "/// distributed under the License is distributed on an \"AS IS\" BASIS,\n"
+ "/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n"
+ "/// See the License for the specific language governing permissions and\n"
+ "/// limitations under the License.\n"
+ "///\n"
+ "/// Copyright holder is triAGENS GmbH, Cologne, Germany\n"
+ "///\n"
+ "/// @author Dr. Frank Celler\n"
+ "/// @author Copyright 2011-2012, triAGENS GmbH, Cologne, Germany\n"
+ "////////////////////////////////////////////////////////////////////////////////\n"
+ "\n"
+ "(function () {\n"
+ " var internal = require(\"internal\");\n"
+ "\n"
+ "// -----------------------------------------------------------------------------\n"
+ "// --SECTION-- Module \"internal\"\n"
+ "// -----------------------------------------------------------------------------\n"
+ "\n"
+ "// -----------------------------------------------------------------------------\n"
+ "// --SECTION-- private functions\n"
+ "// -----------------------------------------------------------------------------\n"
+ "\n"
+ "////////////////////////////////////////////////////////////////////////////////\n"
+ "/// @addtogroup V8Shell\n"
+ "/// @{\n"
+ "////////////////////////////////////////////////////////////////////////////////\n"
+ "\n"
+ "////////////////////////////////////////////////////////////////////////////////\n"
+ "/// @brief prints objects to standard output\n"
+ "///\n"
+ "/// @FUN{internal.printShell(@FA{arg1}, @FA{arg2}, @FA{arg3}, ...)}\n"
+ "///\n"
+ "/// Only available in shell mode.\n"
+ "///\n"
+ "/// Prints the arguments. If an argument is an object having a\n"
+ "/// function @FN{_PRINT}, then this function is called. Otherwise @FN{toJson} is\n"
+ "/// used. A final newline is printed\n"
+ "///\n"
+ "/// @verbinclude fluent40\n"
+ "////////////////////////////////////////////////////////////////////////////////\n"
+ "\n"
+ " internal.printShell = function () {\n"
+ " var i;\n"
+ "\n"
+ " for (i = 0; i < arguments.length; ++i) {\n"
+ " if (0 < i) {\n"
+ " internal.output(\" \");\n"
+ " }\n"
+ "\n"
+ " if (typeof(arguments[i]) === \"string\") {\n"
+ " internal.output(arguments[i]);\n"
+ " }\n"
+ " else {\n"
+ " internal.printRecursive(arguments[i], [], \"~\", [], 0);\n"
+ " }\n"
+ " }\n"
+ "\n"
+ " if (internal.COLOR_OUTPUT) {\n"
+ " internal.output(internal.COLOR_OUTPUT_RESET);\n"
+ " }\n"
+ "\n"
+ " internal.output(\"\\n\");\n"
+ " };\n"
+ "\n"
+ "////////////////////////////////////////////////////////////////////////////////\n"
+ "/// @brief quote cache\n"
+ "////////////////////////////////////////////////////////////////////////////////\n"
+ "\n"
+ " internal.characterQuoteCache = {\n"
+ " '\\b': '\\\\b', // ASCII 8, Backspace\n"
+ " '\\t': '\\\\t', // ASCII 9, Tab\n"
+ " '\\n': '\\\\n', // ASCII 10, Newline\n"
+ " '\\f': '\\\\f', // ASCII 12, Formfeed\n"
+ " '\\r': '\\\\r', // ASCII 13, Carriage Return\n"
+ " '\\\"': '\\\\\"',\n"
+ " '\\\\': '\\\\\\\\'\n"
+ " };\n"
+ "\n"
+ "////////////////////////////////////////////////////////////////////////////////\n"
+ "/// @brief quotes a single character\n"
+ "////////////////////////////////////////////////////////////////////////////////\n"
+ "\n"
+ " internal.quoteSingleJsonCharacter = function (c) {\n"
+ " if (internal.characterQuoteCache.hasOwnProperty[c]) {\n"
+ " return internal.characterQuoteCache[c];\n"
+ " }\n"
+ "\n"
+ " var charCode = c.charCodeAt(0);\n"
+ " var result;\n"
+ "\n"
+ " if (charCode < 16) {\n"
+ " result = '\\\\u000';\n"
+ " }\n"
+ " else if (charCode < 256) {\n"
+ " result = '\\\\u00';\n"
+ " }\n"
+ " else if (charCode < 4096) {\n"
+ " result = '\\\\u0';\n"
+ " }\n"
+ " else {\n"
+ " result = '\\\\u';\n"
+ " }\n"
+ "\n"
+ " result += charCode.toString(16);\n"
+ " internal.characterQuoteCache[c] = result;\n"
+ "\n"
+ " return result;\n"
+ " };\n"
+ "\n"
+ "////////////////////////////////////////////////////////////////////////////////\n"
+ "/// @brief quotes a string character\n"
+ "////////////////////////////////////////////////////////////////////////////////\n"
+ "\n"
+ " internal.quoteJsonString = function (str) {\n"
+ " var quotable = /[\\\\\\\"\\x00-\\x1f]/g;\n"
+ " return '\"' + str.replace(quotable, internal.quoteSingleJsonCharacter) + '\"';\n"
+ " };\n"
+ "\n"
+ "////////////////////////////////////////////////////////////////////////////////\n"
+ "/// @brief prints objects to standard output without a new-line\n"
+ "////////////////////////////////////////////////////////////////////////////////\n"
+ "\n"
+ " internal.printRecursive = function (value, seen, path, names, level) {\n"
+ " var p;\n"
+ "\n"
+ " if (seen === undefined) {\n"
+ " seen = [];\n"
+ " names = [];\n"
+ " }\n"
+ "\n"
+ " p = seen.indexOf(value);\n"
+ "\n"
+ " if (0 <= p) {\n"
+ " internal.output(names[p]);\n"
+ " }\n"
+ " else {\n"
+ " if (value instanceof Object) {\n"
+ " seen.push(value);\n"
+ " names.push(path);\n"
+ " }\n"
+ "\n"
+ " if (value instanceof Object) {\n"
+ " if ('_PRINT' in value) {\n"
+ " value._PRINT(seen, path, names, level);\n"
+ " }\n"
+ " else if (value instanceof Array) {\n"
+ " internal.printArray(value, seen, path, names, level);\n"
+ " }\n"
+ " else if (value.__proto__ === Object.prototype) {\n"
+ " internal.printObject(value, seen, path, names, level);\n"
+ " }\n"
+ " else if ('toString' in value) {\n"
+ " internal.output(value.toString());\n"
+ " }\n"
+ " else {\n"
+ " internal.printObject(value, seen, path, names, level);\n"
+ " }\n"
+ " }\n"
+ " else if (value === undefined) {\n"
+ " internal.output(\"undefined\");\n"
+ " }\n"
+ " else {\n"
+ " if (typeof(value) === \"string\") {\n"
+ " internal.output(internal.quoteJsonString(value));\n"
+ " }\n"
+ " else {\n"
+ " internal.output(String(value));\n"
+ " }\n"
+ " }\n"
+ " }\n"
+ " };\n"
+ "\n"
+ "////////////////////////////////////////////////////////////////////////////////\n"
+ "/// @brief prints the ident for pretty printing\n"
+ "///\n"
+ "/// @FUN{internal.printIndent(@FA{level})}\n"
+ "///\n"
+ "/// Only available in shell mode.\n"
+ "////////////////////////////////////////////////////////////////////////////////\n"
+ "\n"
+ " internal.printIndent = function (level) {\n"
+ " var j;\n"
+ "\n"
+ " if (internal.PRETTY_PRINT) {\n"
+ " internal.output(\"\\n\");\n"
+ "\n"
+ " for (j = 0; j < level; ++j) {\n"
+ " internal.output(\" \");\n"
+ " }\n"
+ " }\n"
+ " };\n"
+ "\n"
+ "////////////////////////////////////////////////////////////////////////////////\n"
+ "/// @brief JSON representation of an array\n"
+ "////////////////////////////////////////////////////////////////////////////////\n"
+ "\n"
+ " internal.printArray = function (object, seen, path, names, level) {\n"
+ " if (object.length === 0) {\n"
+ " internal.output(\"[ ]\");\n"
+ " }\n"
+ " else {\n"
+ " var i;\n"
+ " var sep = \"\";\n"
+ "\n"
+ " internal.output(\"[\");\n"
+ "\n"
+ " var newLevel = level + 1;\n"
+ "\n"
+ " for (i = 0; i < object.length; i++) {\n"
+ " internal.output(sep);\n"
+ "\n"
+ " internal.printIndent(newLevel);\n"
+ "\n"
+ " internal.printRecursive(object[i],\n"
+ " seen,\n"
+ " path + \"[\" + i + \"]\",\n"
+ " names,\n"
+ " newLevel);\n"
+ " sep = \", \";\n"
+ " }\n"
+ "\n"
+ " internal.printIndent(level);\n"
+ "\n"
+ " internal.output(\"]\");\n"
+ " }\n"
+ " };\n"
+ "\n"
+ "////////////////////////////////////////////////////////////////////////////////\n"
+ "/// @brief prints an object\n"
+ "////////////////////////////////////////////////////////////////////////////////\n"
+ "\n"
+ " internal.printObject = function (object, seen, path, names, level) {\n"
+ " var sep = \" \";\n"
+ " var k;\n"
+ "\n"
+ " internal.output(\"{\");\n"
+ "\n"
+ " var newLevel = level + 1;\n"
+ "\n"
+ " for (k in object) {\n"
+ " if (object.hasOwnProperty(k)) {\n"
+ " var val = object[k];\n"
+ "\n"
+ " internal.output(sep);\n"
+ "\n"
+ " internal.printIndent(newLevel);\n"
+ "\n"
+ " if (internal.COLOR_OUTPUT) {\n"
+ " internal.output(internal.COLOR_OUTPUT_DEFAULT,\n"
+ " k,\n"
+ " internal.COLOR_OUTPUT_RESET, \n"
+ " \" : \");\n"
+ " }\n"
+ " else {\n"
+ " internal.output(internal.quoteJsonString(k), \" : \");\n"
+ " }\n"
+ "\n"
+ " internal.printRecursive(val,\n"
+ " seen,\n"
+ " path + \"[\" + k + \"]\",\n"
+ " names,\n"
+ " newLevel);\n"
+ " sep = \", \";\n"
+ " }\n"
+ " }\n"
+ "\n"
+ " internal.printIndent(level);\n"
+ "\n"
+ " internal.output(\" }\");\n"
+ " };\n"
+ "\n"
+ "////////////////////////////////////////////////////////////////////////////////\n"
+ "/// @}\n"
+ "////////////////////////////////////////////////////////////////////////////////\n"
+ "\n"
+ "}());\n"
+ "\n"
+ "// -----------------------------------------------------------------------------\n"
+ "// --SECTION-- global functions\n"
+ "// -----------------------------------------------------------------------------\n"
+ "\n"
+ "////////////////////////////////////////////////////////////////////////////////\n"
+ "/// @addtogroup V8Shell\n"
+ "/// @{\n"
+ "////////////////////////////////////////////////////////////////////////////////\n"
+ "\n"
+ "////////////////////////////////////////////////////////////////////////////////\n"
+ "/// @brief global print\n"
+ "////////////////////////////////////////////////////////////////////////////////\n"
+ "\n"
+ "// must be a variable definition for the browser\n"
+ "if (typeof require(\"internal\").printBrowser === \"function\") {\n"
+ " print = require(\"internal\").print = require(\"internal\").printBrowser;\n"
+ "}\n"
+ "else {\n"
+ " print = require(\"internal\").print = require(\"internal\").printShell;\n"
+ "}\n"
+ "\n"
+ "////////////////////////////////////////////////////////////////////////////////\n"
+ "/// @}\n"
+ "////////////////////////////////////////////////////////////////////////////////\n"
+ "\n"
+ "// Local Variables:\n"
+ "// mode: outline-minor\n"
+ "// outline-regexp: \"^\\\\(/// @brief\\\\|/// @addtogroup\\\\|// --SECTION--\\\\|/// @page\\\\|/// @}\\\\)\"\n"
+ "// End:\n"
;
const char* JS_common_bootstrap_print[] = {
"/*jslint indent: 2,",
" nomen: true,",
" maxlen: 100,",
" sloppy: true,",
" vars: true,",
" white: true,",
" plusplus: true */",
"/*global require, print */",
"",
"////////////////////////////////////////////////////////////////////////////////",
"/// @brief printing",
"///",
"/// @file",
"///",
"/// DISCLAIMER",
"///",
"/// Copyright 2010-2012 triagens GmbH, Cologne, Germany",
"///",
"/// Licensed under the Apache License, Version 2.0 (the \"License\");",
"/// you may not use this file except in compliance with the License.",
"/// You may obtain a copy of the License at",
"///",
"/// http://www.apache.org/licenses/LICENSE-2.0",
"///",
"/// Unless required by applicable law or agreed to in writing, software",
"/// distributed under the License is distributed on an \"AS IS\" BASIS,",
"/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.",
"/// See the License for the specific language governing permissions and",
"/// limitations under the License.",
"///",
"/// Copyright holder is triAGENS GmbH, Cologne, Germany",
"///",
"/// @author Dr. Frank Celler",
"/// @author Copyright 2011-2012, triAGENS GmbH, Cologne, Germany",
"////////////////////////////////////////////////////////////////////////////////",
"",
"(function () {",
" var internal = require(\"internal\");",
"",
"// -----------------------------------------------------------------------------",
"// --SECTION-- Module \"internal\"",
"// -----------------------------------------------------------------------------",
"",
"// -----------------------------------------------------------------------------",
"// --SECTION-- private functions",
"// -----------------------------------------------------------------------------",
"",
"////////////////////////////////////////////////////////////////////////////////",
"/// @addtogroup V8Shell",
"/// @{",
"////////////////////////////////////////////////////////////////////////////////",
"",
"////////////////////////////////////////////////////////////////////////////////",
"/// @brief prints objects to standard output",
"///",
"/// @FUN{internal.printShell(@FA{arg1}, @FA{arg2}, @FA{arg3}, ...)}",
"///",
"/// Only available in shell mode.",
"///",
"/// Prints the arguments. If an argument is an object having a",
"/// function @FN{_PRINT}, then this function is called. Otherwise @FN{toJson} is",
"/// used. A final newline is printed",
"///",
"/// @verbinclude fluent40",
"////////////////////////////////////////////////////////////////////////////////",
"",
" internal.printShell = function () {",
" var i;",
"",
" for (i = 0; i < arguments.length; ++i) {",
" if (0 < i) {",
" internal.output(\" \");",
" }",
"",
" if (typeof(arguments[i]) === \"string\") {",
" internal.output(arguments[i]);",
" }",
" else {",
" internal.printRecursive(arguments[i], [], \"~\", [], 0);",
" }",
" }",
"",
" if (internal.COLOR_OUTPUT) {",
" internal.output(internal.COLOR_OUTPUT_RESET);",
" }",
"",
" internal.output(\"\\n\");",
" };",
"",
"////////////////////////////////////////////////////////////////////////////////",
"/// @brief quote cache",
"////////////////////////////////////////////////////////////////////////////////",
"",
" internal.characterQuoteCache = {",
" '\\b': '\\\\b', // ASCII 8, Backspace",
" '\\t': '\\\\t', // ASCII 9, Tab",
" '\\n': '\\\\n', // ASCII 10, Newline",
" '\\f': '\\\\f', // ASCII 12, Formfeed",
" '\\r': '\\\\r', // ASCII 13, Carriage Return",
" '\\\"': '\\\\\"',",
" '\\\\': '\\\\\\\\'",
" };",
"",
"////////////////////////////////////////////////////////////////////////////////",
"/// @brief quotes a single character",
"////////////////////////////////////////////////////////////////////////////////",
"",
" internal.quoteSingleJsonCharacter = function (c) {",
" if (internal.characterQuoteCache.hasOwnProperty[c]) {",
" return internal.characterQuoteCache[c];",
" }",
"",
" var charCode = c.charCodeAt(0);",
" var result;",
"",
" if (charCode < 16) {",
" result = '\\\\u000';",
" }",
" else if (charCode < 256) {",
" result = '\\\\u00';",
" }",
" else if (charCode < 4096) {",
" result = '\\\\u0';",
" }",
" else {",
" result = '\\\\u';",
" }",
"",
" result += charCode.toString(16);",
" internal.characterQuoteCache[c] = result;",
"",
" return result;",
" };",
"",
"////////////////////////////////////////////////////////////////////////////////",
"/// @brief quotes a string character",
"////////////////////////////////////////////////////////////////////////////////",
"",
" internal.quoteJsonString = function (str) {",
" var quotable = /[\\\\\\\"\\x00-\\x1f]/g;",
" return '\"' + str.replace(quotable, internal.quoteSingleJsonCharacter) + '\"';",
" };",
"",
"////////////////////////////////////////////////////////////////////////////////",
"/// @brief prints objects to standard output without a new-line",
"////////////////////////////////////////////////////////////////////////////////",
"",
" internal.printRecursive = function (value, seen, path, names, level) {",
" var p;",
"",
" if (seen === undefined) {",
" seen = [];",
" names = [];",
" }",
"",
" p = seen.indexOf(value);",
"",
" if (0 <= p) {",
" internal.output(names[p]);",
" }",
" else {",
" if (value instanceof Object) {",
" seen.push(value);",
" names.push(path);",
" }",
"",
" if (value instanceof Object) {",
" if ('_PRINT' in value) {",
" value._PRINT(seen, path, names, level);",
" }",
" else if (value instanceof Array) {",
" internal.printArray(value, seen, path, names, level);",
" }",
" else if (value.__proto__ === Object.prototype) {",
" internal.printObject(value, seen, path, names, level);",
" }",
" else if ('toString' in value) {",
" internal.output(value.toString());",
" }",
" else {",
" internal.printObject(value, seen, path, names, level);",
" }",
" }",
" else if (value === undefined) {",
" internal.output(\"undefined\");",
" }",
" else {",
" if (typeof(value) === \"string\") {",
" internal.output(internal.quoteJsonString(value));",
" }",
" else {",
" internal.output(String(value));",
" }",
" }",
" }",
" };",
"",
"////////////////////////////////////////////////////////////////////////////////",
"/// @brief prints the ident for pretty printing",
"///",
"/// @FUN{internal.printIndent(@FA{level})}",
"///",
"/// Only available in shell mode.",
"////////////////////////////////////////////////////////////////////////////////",
"",
" internal.printIndent = function (level) {",
" var j;",
"",
" if (internal.PRETTY_PRINT) {",
" internal.output(\"\\n\");",
"",
" for (j = 0; j < level; ++j) {",
" internal.output(\" \");",
" }",
" }",
" };",
"",
"////////////////////////////////////////////////////////////////////////////////",
"/// @brief JSON representation of an array",
"////////////////////////////////////////////////////////////////////////////////",
"",
" internal.printArray = function (object, seen, path, names, level) {",
" if (object.length === 0) {",
" internal.output(\"[ ]\");",
" }",
" else {",
" var i;",
" var sep = \"\";",
"",
" internal.output(\"[\");",
"",
" var newLevel = level + 1;",
"",
" for (i = 0; i < object.length; i++) {",
" internal.output(sep);",
"",
" internal.printIndent(newLevel);",
"",
" internal.printRecursive(object[i],",
" seen,",
" path + \"[\" + i + \"]\",",
" names,",
" newLevel);",
" sep = \", \";",
" }",
"",
" internal.printIndent(level);",
"",
" internal.output(\"]\");",
" }",
" };",
"",
"////////////////////////////////////////////////////////////////////////////////",
"/// @brief prints an object",
"////////////////////////////////////////////////////////////////////////////////",
"",
" internal.printObject = function (object, seen, path, names, level) {",
" var sep = \" \";",
" var k;",
"",
" internal.output(\"{\");",
"",
" var newLevel = level + 1;",
"",
" for (k in object) {",
" if (object.hasOwnProperty(k)) {",
" var val = object[k];",
"",
" internal.output(sep);",
"",
" internal.printIndent(newLevel);",
"",
" if (internal.COLOR_OUTPUT) {",
" internal.output(internal.COLOR_OUTPUT_DEFAULT,",
" k,",
" internal.COLOR_OUTPUT_RESET, ",
" \" : \");",
" }",
" else {",
" internal.output(internal.quoteJsonString(k), \" : \");",
" }",
"",
" internal.printRecursive(val,",
" seen,",
" path + \"[\" + k + \"]\",",
" names,",
" newLevel);",
" sep = \", \";",
" }",
" }",
"",
" internal.printIndent(level);",
"",
" internal.output(\" }\");",
" };",
"",
"////////////////////////////////////////////////////////////////////////////////",
"/// @}",
"////////////////////////////////////////////////////////////////////////////////",
"",
"}());",
"",
"// -----------------------------------------------------------------------------",
"// --SECTION-- global functions",
"// -----------------------------------------------------------------------------",
"",
"////////////////////////////////////////////////////////////////////////////////",
"/// @addtogroup V8Shell",
"/// @{",
"////////////////////////////////////////////////////////////////////////////////",
"",
"////////////////////////////////////////////////////////////////////////////////",
"/// @brief global print",
"////////////////////////////////////////////////////////////////////////////////",
"",
"// must be a variable definition for the browser",
"if (typeof require(\"internal\").printBrowser === \"function\") {",
" print = require(\"internal\").print = require(\"internal\").printBrowser;",
"}",
"else {",
" print = require(\"internal\").print = require(\"internal\").printShell;",
"}",
"",
"////////////////////////////////////////////////////////////////////////////////",
"/// @}",
"////////////////////////////////////////////////////////////////////////////////",
"",
"// Local Variables:",
"// mode: outline-minor",
"// outline-regexp: \"^\\\\(/// @brief\\\\|/// @addtogroup\\\\|// --SECTION--\\\\|/// @page\\\\|/// @}\\\\)\"",
"// End:",
"//__end__"
};

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -97,6 +97,23 @@ void ScriptLoader::defineScript (string const& name, string const& script) {
_scripts[name] = script;
}
void ScriptLoader::defineScript (const string& name, const char** script) {
string scriptString;
MUTEX_LOCKER(_lock);
while (true) {
string tempStr = string(*script);
if (tempStr == "//__end__") {
break;
}
scriptString += tempStr + "\n";
++script;
}
_scripts[name] = scriptString;
}
////////////////////////////////////////////////////////////////////////////////
/// @brief finds a named script
////////////////////////////////////////////////////////////////////////////////

View File

@ -103,6 +103,8 @@ namespace triagens {
////////////////////////////////////////////////////////////////////////////////
void defineScript (string const& name, string const& script);
void defineScript (const string& name, const char** script);
////////////////////////////////////////////////////////////////////////////////
/// @brief finds a named script